Skip to content
Snippets Groups Projects

rpm: EL-related fixes

Merged Nicki Křížek requested to merge tkrizek/distro-version into master
1 unresolved thread
Compare and
1 file
+ 12
6
Preferences
Compare changes
+ 12
6
@@ -24,6 +24,8 @@ import re
import subprocess
import sys
from packaging.version import Version
from apkg import ex
from apkg.util import common
from apkg.log import getLogger
@@ -35,16 +37,19 @@ import apkg.util.shutil35 as shutil
log = getLogger(__name__)
SUPPORTED_DISTROS = [
"fedora",
EL_FAMILY_DISTROS = [
"almalinux",
"centos",
"rocky",
"rhel",
"opensuse",
"oracle",
"pidora",
"scientific",
]
SUPPORTED_DISTROS = EL_FAMILY_DISTROS + [
    • This list is sometimes shown, for example in apkg status:

      rpm: rpm pkgstyle default: almalinux | centos | rocky | rhel | oracle | scientific | fedora | opensuse | pidora

      So I'd keep it ordered - make sure SUPPORTED_DISTROS are sorted().

Please register or sign in to reply
"fedora",
"opensuse",
"pidora",
]
DISTRO_REQUIRES = {
'core': ['rpm-build'],
'isolated': ['mock'],
@@ -265,8 +270,9 @@ def get_package_manager_(distro):
return default
if distro.id == 'opensuse':
return 'zypper'
if (distro.id in ['centos', 'rhel', 'oracle', 'scientific']
and distro.version and int(distro.version) <= 7):
if (distro.id in EL_FAMILY_DISTROS
and distro.version
and Version(distro.version) <= Version("7")):
# use yum on EL <= 7
return 'yum'
return default