From d4023791a249656365068309b3aa1182253ff7c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 26 Mar 2015 00:59:28 +0100 Subject: [PATCH] dom0-update: allow to specify custom yum action --- misc/qubes-download-dom0-updates.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/misc/qubes-download-dom0-updates.sh b/misc/qubes-download-dom0-updates.sh index d5dfc97..3ba3d6d 100755 --- a/misc/qubes-download-dom0-updates.sh +++ b/misc/qubes-download-dom0-updates.sh @@ -8,6 +8,8 @@ CLEAN=0 CHECK_ONLY=0 OPTS="--installroot $DOM0_UPDATES_DIR --config=$DOM0_UPDATES_DIR/etc/yum.conf" PKGLIST= +YUM_ACTION= + export LC_ALL=C while [ -n "$1" ]; do @@ -27,16 +29,26 @@ while [ -n "$1" ]; do --check-only) CHECK_ONLY=1 ;; + --action=*) + YUM_ACTION=${1#--action=} + ;; -*) OPTS="$OPTS $1" ;; *) PKGLIST="$PKGLIST $1" + if [ -z "$YUM_ACTION" ]; then + YUM_ACTION=install + fi ;; esac shift done +if [ -z "$YUM_ACTION" ]; then + YUM_ACTION=upgrade +fi + if ! [ -d "$DOM0_UPDATES_DIR" ]; then echo "Dom0 updates dir does not exists: $DOM0_UPDATES_DIR" >&2 exit 1 @@ -79,12 +91,6 @@ 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" set -e