Skip to content

Commit

Permalink
qvm-template-repo-query: don't set pluginpath for DNF5
Browse files Browse the repository at this point in the history
Setting pluginpath makes DNF5 look for plugin configs for every
installed libdnf plugin. If any is missing, it fails to start.
Since the downloadurl plugin isn't applicable to DNF5 don't set
alternative pluginpath to avoid the problem of missing configs for other
plugins.

QubesOS/qubes-issues#9244

(cherry picked from commit 467d0ca)
  • Loading branch information
marmarek committed Nov 5, 2024
1 parent 4f6ab9b commit c064cef
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions qubes-rpc/qvm-template-repo-query
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@ repodir=$(mktemp -d)
trap 'rm -r "$repodir"' EXIT
cat > "$repodir/template.repo"

DNF5=false
if [ "$(readlink /usr/bin/dnf)" = "dnf5" ]; then
DNF5=true
fi

OPTS+=(-y "--setopt=reposdir=${repodir}" --quiet)

# use vendored 'downloadurl' dnf-plugin (fork of 'download' plugin), to print
# all mirrors
OPTS+=("--setopt=pluginpath=/usr/lib/qubes/dnf-plugins")
if ! $DNF5; then
# use vendored 'downloadurl' dnf-plugin (fork of 'download' plugin), to print
# all mirrors
OPTS+=("--setopt=pluginpath=/usr/lib/qubes/dnf-plugins")
fi

if ! command -v dnf >/dev/null; then
echo "ERROR: dnf command is missing, please use newer template for your UpdateVM to download templates." >&2
Expand Down

0 comments on commit c064cef

Please sign in to comment.