From f95a2ac4a8469ea00ab342491ceb4d8f2635b49c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Nov 2021 20:57:24 +0100 Subject: Preparing update notifications handling in container update command. Signed-off-by: Daniel Baumann --- libexec/container/update | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/libexec/container/update b/libexec/container/update index 729baff..42f42c8 100755 --- a/libexec/container/update +++ b/libexec/container/update @@ -119,13 +119,24 @@ do echo "Updating ${NAME}" echo "################################################################################" - case "${FULL_UPGRADE}" in - true) - container run -n ${NAME} -- "apt update && apt ${YES} full-upgrade" + container run -n ${NAME} -- "apt update" + + UPDATES="$(container run -n ${NAME} -- "apt \-\-simulate full-upgrade" | awk '/^[0-9]* upgraded, / { print $1 }')" + + case "${UPDATES}" in + 0) ;; *) - container run -n ${NAME} -- "apt update && apt ${YES} upgrade" + case "${FULL_UPGRADE}" in + true) + container run -n ${NAME} -- "apt ${YES} full-upgrade" + ;; + + *) + container run -n ${NAME} -- "apt ${YES} upgrade" + ;; + esac ;; esac -- cgit v1.2.3