]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
fedora: allow cross builds with dnf5
authorPaul Meyer <49727155+katexochen@users.noreply.github.com>
Fri, 27 Oct 2023 12:36:48 +0000 (14:36 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 31 Oct 2023 06:29:30 +0000 (07:29 +0100)
The `--forcearch` flag is global an can be used in dnf5 from v5.1.6 up.

Co-authored-by: Malte Poll <mp@edgeless.systems>
mkosi/installer/dnf.py

index a6410b6868a7cdd4e94639b4418afc30ed1aa7e9..d5273501adb636ec0a9a9f0b5fe80957b3a66741 100644 (file)
@@ -34,10 +34,7 @@ def find_rpm_gpgkey(state: MkosiState, key: str, url: str) -> str:
 
 
 def dnf_executable(state: MkosiState) -> str:
-    # dnf5 does not support building for foreign architectures yet (missing --forcearch)
-    dnf = shutil.which("dnf5") if state.config.architecture.is_native() else None
-    dnf = dnf or shutil.which("dnf") or "yum"
-    return dnf
+    return shutil.which("dnf5") or shutil.which("dnf") or "yum"
 
 
 def setup_dnf(state: MkosiState, repos: Iterable[Repo], filelists: bool = True) -> None: