From 49c7473848714fdc3ce075058406df9fe14c716d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 11 Nov 2015 05:14:16 +0100 Subject: [PATCH] dom0-updates: do not use 'yum check-update -q' Depending on yum version, adding '-q' option may hide not only informational messages, but also updates list. This is especially the case for yum-deprecated in Fedora 22. So instead of '-q' option, filter the output manually. QubesOS/qubes-issues#1282 --- misc/qubes-download-dom0-updates.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/qubes-download-dom0-updates.sh b/misc/qubes-download-dom0-updates.sh index de20edc..f07e83c 100755 --- a/misc/qubes-download-dom0-updates.sh +++ b/misc/qubes-download-dom0-updates.sh @@ -80,14 +80,14 @@ fi if [ "x$PKGLIST" = "x" ]; then echo "Checking for dom0 updates..." >&2 - UPDATES_FULL=`$YUM $OPTS check-update -q` + UPDATES_FULL=`$YUM $OPTS check-update | grep -v "^Loaded plugins:\|^$"` check_update_retcode=$? if [ $check_update_retcode -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"` + UPDATES=`echo "$UPDATES_FULL" | grep -v "^Obsoleting\|Could not" | cut -f 1 -d ' '` if [ -z "$UPDATES" -a $check_update_retcode -eq 100 ]; then # save not empty string for below condition (-z "$UPDATES"), but blank # to not confuse the user wwith magic strings in messages @@ -106,7 +106,8 @@ if [ -z "$PKGLIST" -a -z "$UPDATES" ]; then fi if [ "$CHECK_ONLY" = "1" ]; then - echo "Available updates: $UPDATES_FULL" + echo "Available updates: " + echo "$UPDATES_FULL" exit 100 fi