]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
fedora: fix RemovePackages with dnf5
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 23 Jun 2023 14:45:47 +0000 (08:45 -0600)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Tue, 27 Jun 2023 12:09:16 +0000 (14:09 +0200)
mkosi/distributions/fedora.py

index 897c12fbb18fa03620d3bdb15839a5f2d5b54f04..2f1330a2fad92421edafe6cad9544af6fee5d391 100644 (file)
@@ -183,7 +183,6 @@ def invoke_dnf(
         f"--config={state.pkgmngr / 'etc/dnf/dnf.conf'}",
         command,
         "--best",
-        "--allowerasing",
         f"--releasever={release}",
         f"--installroot={state.root}",
         "--setopt=keepcache=1",
@@ -196,6 +195,10 @@ def invoke_dnf(
         "--no-plugins" if dnf.endswith("dnf5") else "--noplugins",
     ]
 
+    # dnf5 doesn't support --allowerasing for remove. Add it for other commands.
+    if command != "remove":
+        cmdline += ["--allowerasing"]
+
     # Make sure we download filelists so all dependencies can be resolved.
     # See https://bugzilla.redhat.com/show_bug.cgi?id=2180842
     if (dnf.endswith("dnf5") and