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.
This commit is contained in:
Marek Marczykowski-Górecki 2014-03-28 06:52:31 +01:00
parent 0dd45655e3
commit a4fc4822ef
2 changed files with 7 additions and 4 deletions

View File

@ -56,12 +56,12 @@ fi
if [ "x$PKGLIST" = "x" ]; then if [ "x$PKGLIST" = "x" ]; then
echo "Checking for dom0 updates..." >&2 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 else
PKGS_FROM_CMDLINE=1 PKGS_FROM_CMDLINE=1
fi fi
if [ -z "$PKGLIST" ]; then if [ -z "$PKGLIST" -a -z "$UPDATES" ]; then
# No new updates # No new updates
if [ "$GUI" = 1 ]; then if [ "$GUI" = 1 ]; then
zenity --info --text="No new updates available" 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 --text="There are updates for dom0 available, do you want to download them now?" || exit 0
fi fi
YUM_ACTION=upgrade
if [ "$PKGS_FROM_CMDLINE" == 1 ]; then if [ "$PKGS_FROM_CMDLINE" == 1 ]; then
GUI=0 GUI=0
YUM_ACTION=install
fi fi
mkdir -p "$DOM0_UPDATES_DIR/packages" mkdir -p "$DOM0_UPDATES_DIR/packages"
@ -89,11 +91,11 @@ set -e
if [ "$GUI" = 1 ]; then if [ "$GUI" = 1 ]; then
( echo "1" ( 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 \ echo 100 ) | zenity --progress --pulsate --auto-close --auto-kill \
--text="Downloading updates for Dom0, please wait..." --title="Qubes Dom0 updates" --text="Downloading updates for Dom0, please wait..." --title="Qubes Dom0 updates"
else else
yumdownloader --resolve --destdir "$DOM0_UPDATES_DIR/packages" $OPTS $PKGLIST fakeroot yum $YUM_ACTION --downloadonly --downloaddir="$DOM0_UPDATES_DIR/packages" $OPTS $PKGLIST
fi fi
if ls $DOM0_UPDATES_DIR/packages/*.rpm > /dev/null 2>&1; then if ls $DOM0_UPDATES_DIR/packages/*.rpm > /dev/null 2>&1; then

View File

@ -53,6 +53,7 @@ Requires: qubes-utils
Requires: gnome-packagekit-updater Requires: gnome-packagekit-updater
%endif %endif
Requires: ImageMagick Requires: ImageMagick
Requires: fakeroot
Provides: qubes-core-vm Provides: qubes-core-vm
Obsoletes: qubes-core-commonvm Obsoletes: qubes-core-commonvm
Obsoletes: qubes-core-appvm Obsoletes: qubes-core-appvm