From 029e3fc09847bd9a72b870cf49aedb2e8791c8ae Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Mon, 12 Sep 2011 16:21:03 +0200 Subject: [PATCH] dom0/qvm-dom0-update: Filter yum options in dom0 Eg. don't pass --enablerepo to yum install. --- dom0/qvm-tools/qvm-dom0-update | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/dom0/qvm-tools/qvm-dom0-update b/dom0/qvm-tools/qvm-dom0-update index b9dae551..1f261e39 100755 --- a/dom0/qvm-tools/qvm-dom0-update +++ b/dom0/qvm-tools/qvm-dom0-update @@ -29,8 +29,26 @@ qvm-run -a $UPDATEVM true || exit 1 qvm-run --pass_io $UPDATEVM "/usr/lib/qubes/qubes_download_dom0_updates.sh --doit --nogui $*" || exit 1 # Wait for download completed while pidof -x qubes-receive-updates >/dev/null; do sleep 0.5; done -if [ $# -gt 0 ]; then +PKGS= +OPTS= +# Filter out some yum options and collect packages list +while [ $# -gt 0 ]; do + case "$1" in + --enablerepo=*|\ + --disablerepo=*|\ + --clean) + ;; + -*) + OPTS="$OPTS $1" + ;; + *) + PKGS="$PKGS $1" + ;; + esac + shift +done +if [ "x$PKGS" != "x" ]; then ID=$(id -ur) if [ $ID != 0 ] ; then echo "This script should be run as root, use sudo next time." @@ -38,7 +56,7 @@ if [ $# -gt 0 ]; then exit fi - yum install $@ + yum $OPTS install $PKGS elif [ -f /var/lib/qubes/updates/repodata/repomd.xml ]; then # Above file exists only when at least one package was downloaded yum check-update @@ -50,7 +68,7 @@ elif [ -f /var/lib/qubes/updates/repodata/repomd.xml ]; then echo "Now you can manually run yum update (use sudo again)." exit fi - yum update + yum $OPTS update fi else echo "No updates avaliable"