From a7c43e6148b097e43dc5fcc7285db462171ceeed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 12 May 2014 00:30:48 +0200 Subject: [PATCH] dom0-updates: clean local repo when --clean given --- dom0-updates/qubes-dom0-update | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dom0-updates/qubes-dom0-update b/dom0-updates/qubes-dom0-update index 125d61b..05e149c 100755 --- a/dom0-updates/qubes-dom0-update +++ b/dom0-updates/qubes-dom0-update @@ -27,12 +27,15 @@ GUI= CHECK_ONLY= ALL_OPTS=$* QVMRUN_OPTS= +CLEAN= # Filter out some yum options and collect packages list while [ $# -gt 0 ]; do case "$1" in --enablerepo=*|\ - --disablerepo=*|\ + --disablerepo=*) + ;; --clean) + CLEAN=1 ;; --gui) GUI=1 @@ -71,6 +74,10 @@ if [ "$CHECK_ONLY" == "1" ] && ! xl domid $UPDATEVM > /dev/null 2>&1; then exit 1 fi +if [ -n "$CLEAN" ]; then + rm -f /var/lib/qubes/updates/rpm/* +fi + # We should ensure the clocks in Dom0 and UpdateVM are in sync # becuase otherwise yum might complain about future timestamps qvm-sync-clock