From a4fc4822ef97e6dd2eac9d0bd71f533d30c3f3df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 28 Mar 2014 06:52:31 +0100 Subject: [PATCH] dom0-updates: use yum --downloadonly instead of yumdownloader This better handles dependencies (especially of "Obsolete:" type). Unfortunately yum install/upgrade checks if running as root. Because we are only downloading packages, using local "system root" (--installroot option) no real root access is requires, so use fakeroot to mute yum error. --- misc/qubes-download-dom0-updates.sh | 10 ++++++---- rpm_spec/core-vm.spec | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/misc/qubes-download-dom0-updates.sh b/misc/qubes-download-dom0-updates.sh index fd16ac6..2cfae7e 100755 --- a/misc/qubes-download-dom0-updates.sh +++ b/misc/qubes-download-dom0-updates.sh @@ -56,12 +56,12 @@ fi if [ "x$PKGLIST" = "x" ]; then echo "Checking for dom0 updates..." >&2 - PKGLIST=`yum $OPTS check-update -q | cut -f 1 -d ' ' | grep -v "^Obsoleting"` + UPDATES=`yum $OPTS check-update -q | cut -f 1 -d ' ' | grep -v "^Obsoleting"` else PKGS_FROM_CMDLINE=1 fi -if [ -z "$PKGLIST" ]; then +if [ -z "$PKGLIST" -a -z "$UPDATES" ]; then # No new updates if [ "$GUI" = 1 ]; then zenity --info --text="No new updates available" @@ -79,8 +79,10 @@ if [ "$DOIT" != "1" -a "$PKGS_FROM_CMDLINE" != "1" ]; then --text="There are updates for dom0 available, do you want to download them now?" || exit 0 fi +YUM_ACTION=upgrade if [ "$PKGS_FROM_CMDLINE" == 1 ]; then GUI=0 + YUM_ACTION=install fi mkdir -p "$DOM0_UPDATES_DIR/packages" @@ -89,11 +91,11 @@ set -e if [ "$GUI" = 1 ]; then ( echo "1" - yumdownloader --resolve --destdir "$DOM0_UPDATES_DIR/packages" $OPTS $PKGLIST + fakeroot yum $YUM_ACTION --downloadonly --downloaddir="$DOM0_UPDATES_DIR/packages" $OPTS $PKGLIST echo 100 ) | zenity --progress --pulsate --auto-close --auto-kill \ --text="Downloading updates for Dom0, please wait..." --title="Qubes Dom0 updates" else - yumdownloader --resolve --destdir "$DOM0_UPDATES_DIR/packages" $OPTS $PKGLIST + fakeroot yum $YUM_ACTION --downloadonly --downloaddir="$DOM0_UPDATES_DIR/packages" $OPTS $PKGLIST fi if ls $DOM0_UPDATES_DIR/packages/*.rpm > /dev/null 2>&1; then diff --git a/rpm_spec/core-vm.spec b/rpm_spec/core-vm.spec index 8ad152f..731fea6 100644 --- a/rpm_spec/core-vm.spec +++ b/rpm_spec/core-vm.spec @@ -53,6 +53,7 @@ Requires: qubes-utils Requires: gnome-packagekit-updater %endif Requires: ImageMagick +Requires: fakeroot Provides: qubes-core-vm Obsoletes: qubes-core-commonvm Obsoletes: qubes-core-appvm