Fix detection of dom0 updates
dnf stdout messages differ from yum. Handle this particular difference (info about last metadata check time), but in addition properly use its exit code - 0 means no updates, 100 means some updates. Fixes QubesOS/qubes-issues#2096
This commit is contained in:
parent
bb53619d3d
commit
a9e7f91ca6
@ -84,7 +84,7 @@ if [ "x$PKGLIST" = "x" ]; then
|
|||||||
echo "Checking for dom0 updates..." >&2
|
echo "Checking for dom0 updates..." >&2
|
||||||
UPDATES_FULL=`$YUM $OPTS check-update`
|
UPDATES_FULL=`$YUM $OPTS check-update`
|
||||||
check_update_retcode=$?
|
check_update_retcode=$?
|
||||||
UPDATES_FULL=`echo "$UPDATES_FULL" | grep -v "^Loaded plugins:\|^$"`
|
UPDATES_FULL=`echo "$UPDATES_FULL" | grep -v "^Loaded plugins:\|^Last metadata\|^$"`
|
||||||
if [ $check_update_retcode -eq 1 ]; then
|
if [ $check_update_retcode -eq 1 ]; then
|
||||||
# Exit here if yum have reported an error. Exit code 100 isn't an
|
# 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
|
# error, it's "updates available" info, so check specifically for exit code 1
|
||||||
@ -95,6 +95,9 @@ if [ "x$PKGLIST" = "x" ]; then
|
|||||||
# save not empty string for below condition (-z "$UPDATES"), but blank
|
# save not empty string for below condition (-z "$UPDATES"), but blank
|
||||||
# to not confuse the user wwith magic strings in messages
|
# to not confuse the user wwith magic strings in messages
|
||||||
UPDATES=" "
|
UPDATES=" "
|
||||||
|
elif [ $check_update_retcode -eq 0 ]; then
|
||||||
|
# exit code 0 means no updates available - regardless of stdout messages
|
||||||
|
UPDATES=""
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
PKGS_FROM_CMDLINE=1
|
PKGS_FROM_CMDLINE=1
|
||||||
|
Loading…
Reference in New Issue
Block a user