Merge branch 'master' of git.qubes-os.org:/var/lib/qubes/git/marmarek/core

Conflicts:
	dom0/qvm-tools/qvm-backup-restore
This commit is contained in:
Joanna Rutkowska 2011-09-13 10:33:42 +02:00
commit 541c5d09ef

View File

@ -4,14 +4,27 @@ DOM0_UPDATES_DIR=/var/lib/qubes/dom0-updates
DOIT=0 DOIT=0
GUI=1 GUI=1
CLEAN=0
OPTS="--installroot $DOM0_UPDATES_DIR"
PKGLIST=
while [ -n "$1" ]; do while [ -n "$1" ]; do
if [ "x--doit" = "x$1" ]; then case "$1" in
DOIT=1 --doit)
elif [ "x--nogui" = "x$1" ]; then DOIT=1
GUI=0 ;;
else --nogui)
break GUI=0
fi ;;
--clean)
CLEAN=1
;;
-*)
OPTS="$OPTS $1"
;;
*)
PKGLIST="$PKGLIST $1"
;;
esac
shift shift
done done
@ -23,11 +36,13 @@ fi
mkdir -p $DOM0_UPDATES_DIR/etc mkdir -p $DOM0_UPDATES_DIR/etc
cp /etc/yum.conf $DOM0_UPDATES_DIR/etc/ cp /etc/yum.conf $DOM0_UPDATES_DIR/etc/
PKGLIST="$*" if [ "x$CLEAN" = "1" ]; then
yum $OPTS clean all
fi
if [ "x$PKGLIST" = "x" ]; then if [ "x$PKGLIST" = "x" ]; then
echo "Checking for dom0 updates..." echo "Checking for dom0 updates..."
PKGLIST=`yum --installroot $DOM0_UPDATES_DIR check-update -q | cut -f 1 -d ' '` PKGLIST=`yum $OPTS check-update -q | cut -f 1 -d ' '`
else else
PKGS_FROM_CMDLINE=1 PKGS_FROM_CMDLINE=1
fi fi
@ -38,13 +53,12 @@ if [ -z "$PKGLIST" ]; then
fi fi
if [ "$DOIT" != "1" -a "$PKGS_FROM_CMDLINE" != "1" ]; then if [ "$DOIT" != "1" -a "$PKGS_FROM_CMDLINE" != "1" ]; then
PKGCOUNT=`echo $PKGLIST|wc -w`
zenity --question --title="Qubes Dom0 updates" \ zenity --question --title="Qubes Dom0 updates" \
--text="$PKGCOUNT updates for dom0 available. Do you want to download its now?" || exit 0 --text="There are updates for dom0 available, do you want to download them now?" || exit 0
fi fi
if [ "$PKGS_FROM_CMDLINE" == 1 ]; then if [ "$PKGS_FROM_CMDLINE" == 1 ]; then
OPTS="--resolve" OPTS="$OPTS --resolve"
GUI=0 GUI=0
fi fi
@ -54,11 +68,11 @@ set -e
if [ "$GUI" = 1 ]; then if [ "$GUI" = 1 ]; then
( echo "1" ( echo "1"
yumdownloader --destdir "$DOM0_UPDATES_DIR/packages" --installroot "$DOM0_UPDATES_DIR" $OPTS $PKGLIST yumdownloader --destdir "$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 --destdir "$DOM0_UPDATES_DIR/packages" --installroot "$DOM0_UPDATES_DIR" $OPTS $PKGLIST yumdownloader --destdir "$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