From d44c8acdeb6ecb1a1f57168f80405687463e6592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 4 Nov 2015 00:42:52 +0100 Subject: [PATCH] dom0-updates: prefer yum-deprecated over dnf Some of the reasons: - dnf doesn't support --downloaddir option - dnf doesn't support `copy_local` repo option (used in automated tests only) - dnf is horribly slow, especially without cache fetched (https://bugzilla.redhat.com/show_bug.cgi?id=1227014) This is all needed (instead of simply using `yum` command), because Fedora >= 22 have an command redirection `yum`->`dnf`. QubesOS/qubes-issues#1282 --- misc/qubes-download-dom0-updates.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/qubes-download-dom0-updates.sh b/misc/qubes-download-dom0-updates.sh index 9a5ddac..5a6df23 100755 --- a/misc/qubes-download-dom0-updates.sh +++ b/misc/qubes-download-dom0-updates.sh @@ -104,9 +104,12 @@ if [ "$DOIT" != "1" -a "$PKGS_FROM_CMDLINE" != "1" ]; then fi YUM_COMMAND="fakeroot yum $YUM_ACTION -y --downloadonly --downloaddir=$DOM0_UPDATES_DIR/packages" +# prefer yum-deprecated over dnf, because of still missing features in dnf (at least --downloaddir) +if type dnf >/dev/null 2>&1 && type yum-deprecated >/dev/null 2>&1; then + YUM_COMMAND="fakeroot yum-deprecated $YUM_ACTION -y --downloadonly --downloaddir=$DOM0_UPDATES_DIR/packages" # check for --downloadonly option - if not supported (Debian), fallback to # yumdownloader -if ! yum --help | grep -q downloadonly; then +elif ! yum --help | grep -q downloadonly; then if [ "$YUM_ACTION" != "install" -a "$YUM_ACTION" != "upgrade" ]; then echo "ERROR: yum version installed in VM `hostname` does not suppport --downloadonly option" >&2 echo "ERROR: only 'install' and 'upgrade' actions supported ($YUM_ACTION not)" >&2