dom0-updates: check "yum check-update" exit code, not only its output

QubesOS/qubes-issues#1168
This commit is contained in:
Marek Marczykowski-Górecki 2015-10-10 22:01:02 +02:00
parent 397f6fdc52
commit 520178d5dc
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -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