Merge pull request #2288 from calamares/issue-2145

[packages] Add a DNF5 PM backend
This commit is contained in:
Adriaan de Groot 2024-02-25 20:24:23 +01:00 committed by GitHub
commit 7379e7f28d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 31 additions and 0 deletions

View File

@ -279,6 +279,11 @@ class PMApt(PackageManager):
class PMDnf(PackageManager):
"""
This is "legacy" DNF, called DNF-4 even though the
executable is dnf-3 in modern Fedora. Executable dnf
is a symlink to dnf-3 in systems that use it.
"""
backend = "dnf"
def install(self, pkgs, from_local=False):
@ -298,6 +303,30 @@ class PMDnf(PackageManager):
check_target_env_call(["dnf-3", "-y", "upgrade"])
class PMDnf5(PackageManager):
"""
This is "modern" DNF, DNF-5 which is for Fedora 41 (presumably)
and later. Executable dnf is a symlink to dnf5 in systems that use it.
"""
backend = "dnf5"
def install(self, pkgs, from_local=False):
check_target_env_call(["dnf5", "-y", "install"] + pkgs)
def remove(self, pkgs):
# ignore the error code for now because dnf thinks removing a
# nonexistent package is an error
target_env_call(["dnf5", "--disablerepo=*", "-C", "-y",
"remove"] + pkgs)
def update_db(self):
# Doesn't need updates
pass
def update_system(self):
check_target_env_call(["dnf5", "-y", "upgrade"])
class PMDummy(PackageManager):
backend = "dummy"

View File

@ -23,6 +23,7 @@
# - apk - Alpine Linux package manager
# - apt - APT frontend for DEB and RPM
# - dnf - DNF, the new RPM frontend
# - dnf5 - DNF5, the newer new RPM frontend
# - entropy - Sabayon package manager (is being deprecated)
# - luet - Sabayon package manager (next-gen)
# - packagekit - PackageKit CLI tool

View File

@ -12,6 +12,7 @@ properties:
- apk
- apt
- dnf
- dnf5
- entropy
- luet
- packagekit