Skip to content

Commit d5c627b

Browse files
committed
python: setup: fedora: Check dnf version in dnf_add_repo()
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
1 parent 9c7442c commit d5c627b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/setup/fedora.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ def dnf_add_repo(repo_url):
3737
# config-manager does not support --add-repo with dnf5, which is the
3838
# default in Fedora 41 now.
3939
# https://github.com/rpm-software-management/dnf5/issues/1537
40-
if get_fedora_version() >= 41:
40+
# Done in an agnostic way because this is shared with AlmaLinux.
41+
if Path(shutil.which('dnf')).resolve().name.endswith('5'):
4142
local_dst = Path('/etc/yum.repos.d', repo_url.rsplit('/', 1)[1])
4243
lib.utils.curl(repo_url, output=local_dst)
4344
else:

0 commit comments

Comments
 (0)