From 89fba848e188ec2f1fe933a4b3c2f9574189f85a Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Sun, 24 Jul 2011 21:54:10 +0200 Subject: [PATCH] dom0+vm: Polishing qvm-dom0-upgrade (#287) Do not print error message when no package downloaded. Also some more covenient usage when dowloading new packages (implied --resolve --nogui). --- common/qubes_download_dom0_updates.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/common/qubes_download_dom0_updates.sh b/common/qubes_download_dom0_updates.sh index 8ca153e..1b1ea0b 100755 --- a/common/qubes_download_dom0_updates.sh +++ b/common/qubes_download_dom0_updates.sh @@ -28,6 +28,8 @@ PKGLIST="$*" if [ "x$PKGLIST" = "x" ]; then echo "Checking for dom0 updates..." PKGLIST=`yum --installroot $DOM0_UPDATES_DIR check-update -q | cut -f 1 -d ' '` +else + PKGS_FROM_CMDLINE=1 fi if [ -z "$PKGLIST" ]; then @@ -35,23 +37,32 @@ if [ -z "$PKGLIST" ]; then exit 0 fi -if [ "$DOIT" != "1" ]; then +if [ "$DOIT" != "1" -a "$PKGS_FROM_CMDLINE" != "1" ]; then PKGCOUNT=`echo $PKGLIST|wc -w` zenity --question --title="Qubes Dom0 updates" \ --text="$PKGCOUNT updates for dom0 available. Do you want to download its now?" || exit 0 fi +if [ "$PKGS_FROM_CMDLINE" == 1 ]; then + OPTS="--resolve" + GUI=0 +fi + mkdir -p "$DOM0_UPDATES_DIR/packages" set -e if [ "$GUI" = 1 ]; then ( echo "1" - yumdownloader --destdir "$DOM0_UPDATES_DIR/packages" --installroot "$DOM0_UPDATES_DIR" $PKGLIST + yumdownloader --destdir "$DOM0_UPDATES_DIR/packages" --installroot "$DOM0_UPDATES_DIR" $OPTS $PKGLIST echo 100 ) | zenity --progress --pulsate --auto-close --auto-kill \ --text="Downloading updates for Dom0, please wait..." --title="Qubes Dom0 updates" else - yumdownloader --destdir "$DOM0_UPDATES_DIR/packages" --installroot "$DOM0_UPDATES_DIR" $PKGLIST + yumdownloader --destdir "$DOM0_UPDATES_DIR/packages" --installroot "$DOM0_UPDATES_DIR" $OPTS $PKGLIST fi -/usr/lib/qubes/qrexec_client_vm dom0 qubes.ReceiveUpdates /usr/lib/qubes/qfile-agent $DOM0_UPDATES_DIR/packages/*.rpm +if ls $DOM0_UPDATES_DIR/packages/*.rpm > /dev/null 2>&1; then + /usr/lib/qubes/qrexec_client_vm dom0 qubes.ReceiveUpdates /usr/lib/qubes/qfile-agent $DOM0_UPDATES_DIR/packages/*.rpm +else + echo "No packages downloaded" +fi