From: Daan De Meyer Date: Wed, 31 Jan 2024 13:11:53 +0000 (+0100) Subject: kernel-install: Prefer dnf over dnf5 X-Git-Tag: v21~77^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b9290492d43552d1f249fb67c57b2a58f0fb385;p=thirdparty%2Fmkosi.git kernel-install: Prefer dnf over dnf5 --- diff --git a/kernel-install/50-mkosi.install b/kernel-install/50-mkosi.install index 477a1f7cd..290c9dd56 100644 --- a/kernel-install/50-mkosi.install +++ b/kernel-install/50-mkosi.install @@ -13,7 +13,7 @@ from mkosi import identify_cpu from mkosi.archive import make_cpio from mkosi.config import OutputFormat, __version__ from mkosi.log import die, log_setup -from mkosi.run import run, uncaught_exception_handler +from mkosi.run import find_binary, run, uncaught_exception_handler from mkosi.tree import copy_tree from mkosi.types import PathString from mkosi.util import umask @@ -179,7 +179,9 @@ def main() -> None: logging.info(f"Building {output}") - run(cmdline) + # Prefer dnf as dnf5 has not yet officially replaced it and there's a much bigger chance that there will be a + # populated dnf cache directory. + run(cmdline, env={"MKOSI_DNF": dnf.name} if (dnf := find_binary("dnf", "dnf5")) else {}) (context.staging_area / output).unlink()