From 520178d5dcc86b6177570a259c84cb832e2cbd9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 10 Oct 2015 22:01:02 +0200 Subject: [PATCH] dom0-updates: check "yum check-update" exit code, not only its output QubesOS/qubes-issues#1168 --- misc/qubes-download-dom0-updates.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc/qubes-download-dom0-updates.sh b/misc/qubes-download-dom0-updates.sh index d6b0fcd..0814032 100755 --- a/misc/qubes-download-dom0-updates.sh +++ b/misc/qubes-download-dom0-updates.sh @@ -75,6 +75,11 @@ fi if [ "x$PKGLIST" = "x" ]; then echo "Checking for dom0 updates..." >&2 UPDATES_FULL=`yum $OPTS check-update -q` + if [ $? -eq 1 ]; then + # Exit here if yum have reported an error. Exit code 100 isn't an + # error, it's "updates available" info, so check specifically for exit code 1 + exit 1 + fi UPDATES=`echo "$UPDATES_FULL" | cut -f 1 -d ' ' | grep -v "^Obsoleting"` else PKGS_FROM_CMDLINE=1