From 10399e8ab36bb53660efa22653ea00cf7716c938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 1 Apr 2019 18:18:22 +0200 Subject: [PATCH] dom0-updates: improve dnf config handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dom0 may not sent /etc/yum.conf but only /etc/dnf/dnf.conf - handle this case too. Since dom0 use dnf for a long time, prefer dnf.conf. Not all versions of dnf supports cachedir option, so handle also the case when it's set by default to /var/cache/dnf (instead of overriden with /var/cache/yum with yum.conf). Simply look for packages in whole /var/cache. QubesOS/qubes-issues#4225 --- misc/qubes-download-dom0-updates.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/misc/qubes-download-dom0-updates.sh b/misc/qubes-download-dom0-updates.sh index 4abe8b2..0e6cb09 100755 --- a/misc/qubes-download-dom0-updates.sh +++ b/misc/qubes-download-dom0-updates.sh @@ -5,7 +5,12 @@ DOM0_UPDATES_DIR=/var/lib/qubes/dom0-updates GUI=1 CLEAN=0 CHECK_ONLY=0 -OPTS="--installroot $DOM0_UPDATES_DIR --config=$DOM0_UPDATES_DIR/etc/yum.conf" +OPTS="--installroot $DOM0_UPDATES_DIR" +if [ -f "$DOM0_UPDATES_DIR/etc/dnf/dnf.conf" ]; then + OPTS="$OPTS --config=$DOM0_UPDATES_DIR/etc/yum.conf" +elif [ -f "$DOM0_UPDATES_DIR/etc/yum.conf" ]; then + OPTS="$OPTS --config=$DOM0_UPDATES_DIR/etc/yum.conf" +fi # DNF uses /etc/yum.repos.d, even when --installroot is specified OPTS="$OPTS --setopt=reposdir=$DOM0_UPDATES_DIR/etc/yum.repos.d" PKGLIST= @@ -159,7 +164,7 @@ else $YUM_COMMAND $OPTS $PKGLIST fi -find "$DOM0_UPDATES_DIR/var/cache/yum" -name '*.rpm' -print0 |\ +find "$DOM0_UPDATES_DIR/var/cache" -name '*.rpm' -print0 |\ xargs -0 -r ln -f -t "$DOM0_UPDATES_DIR/packages/" if ls "$DOM0_UPDATES_DIR"/packages/*.rpm > /dev/null 2>&1; then