summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2021-11-15 19:57:24 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2021-11-15 19:57:24 +0000
commitf95a2ac4a8469ea00ab342491ceb4d8f2635b49c (patch)
tree55bd5ff6de4575db2c182293639b224f74fd66fe /libexec
parentSpeeding up full-upgrades in container update command by removing redundant u... (diff)
downloadcompute-tools-f95a2ac4a8469ea00ab342491ceb4d8f2635b49c.tar.xz
compute-tools-f95a2ac4a8469ea00ab342491ceb4d8f2635b49c.zip
Preparing update notifications handling in container update command.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'libexec')
-rwxr-xr-xlibexec/container/update19
1 files 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