Skip to content

Commit

Permalink
installer: workaround missing --downloaddir option for dnf install
Browse files Browse the repository at this point in the history
dnf5 doesn't support --downloaddir (nor --destdir) for the install
action yet. Previous attempt of the fix was using download action, but
that on the other hand doesn't support groups. This time fix this by
extracting packages from dnf cache manually. Use find to not rely on
specific directory layout (which is not guaranteed to stay unchanged).

But for the case where download action can be used (templates), adjust
options order for dnf5.
  • Loading branch information
marmarek committed Jan 4, 2025
1 parent 1cd0a17 commit f75e8ac
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions qubesbuilder/plugins/installer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,18 @@ iso-parse-tmpl:

iso-packages-anaconda:
$(DNF) $(DNF_OPTS) clean all
find $(DNF_ROOT) -name "*.rpm" -delete
# workaround for https://github.com/rpm-software-management/dnf/issues/1974
rpmkeys --root=$(DNF_ROOT) --import $$(sed -n '/gpgkey *= *file:/{s,.*file://,,;p}' $(DNF_ROOT)/etc/yum.repos.d/*.repo)
umask 022; $(DNF) $(DNF_OPTS) --downloaddir=$(BASE_DIR)/os/Packages --downloadonly install $(shell cat $(DNF_PACKAGES))
umask 022; $(DNF) $(DNF_OPTS) --downloadonly install $(shell cat $(DNF_PACKAGES))
find $(DNF_ROOT) -name "*.rpm" -exec mv -t $(BASE_DIR)/os/Packages {} +
pushd $(BASE_DIR)/os/ && $(CREATEREPO) -q -g $(TMP_DIR)/comps.xml .

iso-packages-lorax:
$(DNF) $(DNF_OPTS) clean all
umask 022; $(DNF) $(DNF_OPTS) --downloaddir=$(INSTALLER_DIR)/yum/installer/rpm --downloadonly install $(shell cat $(LORAX_PACKAGES))
find $(DNF_ROOT) -name "*.rpm" -delete
umask 022; $(DNF) $(DNF_OPTS) --downloadonly install $(shell cat $(LORAX_PACKAGES))
find $(DNF_ROOT) -name "*.rpm" -exec mv -t $(INSTALLER_DIR)/yum/installer/rpm {} +
pushd $(INSTALLER_DIR)/yum/installer && $(CREATEREPO) -q -g $(TMP_DIR)/comps.xml --update .

iso-templates-cache: iso-prepare iso-parse-kickstart
Expand All @@ -149,7 +153,7 @@ iso-templates-cache: iso-prepare iso-parse-kickstart

$(DNF) $(DNF_OPTS) clean all
rpmkeys --root=$(DNF_ROOT) --import $$(sed -n '/gpgkey *= *file:/{s,.*file://,,;p}' $(DNF_ROOT)/etc/yum.repos.d/*.repo)
umask 022; $(DNF) $(DNF_OPTS_TEMPLATES) --downloaddir=$(INSTALLER_DIR)/yum/installer/rpm --downloaddir=$(BUILDER_DIR)/repository/templates download $(TEMPLATE_PACKAGES)
umask 022; $(DNF) $(DNF_OPTS_TEMPLATES) download --destdir=$(BUILDER_DIR)/repository/templates $(TEMPLATE_PACKAGES)

#
# CAGE -> MOCK
Expand Down

0 comments on commit f75e8ac

Please sign in to comment.