From: Zbigniew Jędrzejewski-Szmek Date: Fri, 23 Jun 2023 14:45:47 +0000 (-0600) Subject: fedora: fix RemovePackages with dnf5 X-Git-Tag: v15~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d38d08955478395381084cd6ed467d2e999956ad;p=thirdparty%2Fmkosi.git fedora: fix RemovePackages with dnf5 --- diff --git a/mkosi/distributions/fedora.py b/mkosi/distributions/fedora.py index 897c12fbb..2f1330a2f 100644 --- a/mkosi/distributions/fedora.py +++ b/mkosi/distributions/fedora.py @@ -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