ソースを参照

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
Marek Marczykowski-Górecki 8 年 前
コミット
49c7473848
1 ファイル変更4 行追加3 行削除
  1. 4 3
      misc/qubes-download-dom0-updates.sh

+ 4 - 3
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