diff --git a/package-managers/qubes-download-dom0-updates.sh b/package-managers/qubes-download-dom0-updates.sh index 5e0a2eab..d5815bca 100755 --- a/package-managers/qubes-download-dom0-updates.sh +++ b/package-managers/qubes-download-dom0-updates.sh @@ -60,7 +60,9 @@ if [ -z "$YUM_ACTION" ]; then fi if type dnf >/dev/null 2>&1; then - YUM=(dnf --best --allowerasing --noplugins -y) + YUM=(dnf --noplugins -y) + "${YUM[@]}" "$YUM_ACTION" --help | grep -q best && YUM+=(--best) + "${YUM[@]}" "$YUM_ACTION" --help | grep -q allowerasing && YUM+=(--allowerasing) else YUM=(yum -y) fi @@ -129,10 +131,11 @@ if [ ${#PKGLIST[@]} -eq 0 ] && [ "$CHECK_ONLY" = "1" ]; then fi # now, we will download something -YUM_COMMAND=(fakeroot "${YUM[@]}" "$YUM_ACTION" --downloadonly) +YUM_COMMAND=(fakeroot "${YUM[@]}" "$YUM_ACTION") +"${YUM[@]}" "$YUM_ACTION" --help | grep -q downloadonly && YUM_COMMAND+=(--downloadonly) # check for --downloadonly option - if not supported (Debian), fallback to # yumdownloader -if ! "${YUM[@]}" --help | grep -q downloadonly; then +if ! "${YUM[@]}" --help | grep -q downloadonly && ! "${YUM[@]}" upgrade --help | grep -q dnf5; then if dpkg --compare-versions \ "$(dpkg-query --show --showformat='${version}' rpm)" gt 4.14; then SIGNATURE_REGEX="^[A-Za-z0-9._+-/]{1,128}\.rpm: digests signatures OK$"