diff --git a/.github/workflows/redhat-compat.yml b/.github/workflows/redhat-compat.yml index da2adde..5ba66e1 100644 --- a/.github/workflows/redhat-compat.yml +++ b/.github/workflows/redhat-compat.yml @@ -6,6 +6,7 @@ on: platforms: description: 'Platforms' default: '["centos:7", "quay.io/centos/centos:stream8", "quay.io/centos/centos:stream9", + "redhat/ubi9:latest", "rockylinux:8", "rockylinux:9", "oraclelinux:7", "oraclelinux:8", "oraclelinux:9", "amazonlinux:2", "amazonlinux:2022", "amazonlinux:2023", @@ -48,9 +49,12 @@ jobs: echo "/etc/os-release:"; cat /etc/os-release echo "/etc/redhat-release:"; cat /etc/redhat-release || true echo "uname -a: $(uname -a)" - echo "python: $(python3 --version)" + echo "bash: $BASH_VERSION" + echo "System Python: $(/usr/bin/python3 --version)" + echo "Python: $(python3 --version)" echo "pip list:"; python3 -m pip list -v echo "System gcc: $(/usr/bin/gcc --version | head -1)" echo "gcc: $(gcc --version | head -1)" echo "glibc: $(./bin/glibcver)" echo "libstdc++: $(./bin/libstdc++ver)" + echo "binutils: $(ld --version | head -1)" diff --git a/bin/getclang b/bin/getclang index 6a68393..8136be7 100755 --- a/bin/getclang +++ b/bin/getclang @@ -115,13 +115,8 @@ class CLangSetup(paella.Setup): if not self.modern: return self.run("%s/bin/getepel" % READIES, sudo=True) - - if self.os_version[0] == 9: - if self.dist in ['centos', 'ol', 'redhat']: - self.install("clang llvm-toolset") - elif self.os_version[0] == 8: - if self.dist in ['centos', 'ol']: - self.install("clang llvm-toolset") + if self.dist in ['centos', 'ol'] and self.os_version[0] >= 8: + self.install("clang llvm-toolset") else: self.install("llvm-toolset-7.0") self.cp_to_profile_d("/opt/rh/llvm-toolset-7.0/enable", "llvm-toolset-7.0.sh") diff --git a/bin/getepel b/bin/getepel index a393d4a..3e5d3cb 100755 --- a/bin/getepel +++ b/bin/getepel @@ -23,19 +23,27 @@ READIES=$(cd $HERE/.. && pwd) # https://developers.redhat.com/products/red-hat-software-collections/overview # SCL/ol https://docs.oracle.com/en/operating-systems/oracle-linux/scl-user/#Oracle-Linux -# centos7 centos8 centos9 rocky8 rocky9 ol7 ol8 ol9 amzn2 amzn2022 amzn2023 -# EPEL v v v v v v v v v - - -# raven - v v v v - v v - v v -# powertools v v - v - - - - - - - -# crb - - v - v - - - - - - -# REMI v v v v v v v v v - - -# SCL v - - - - v* - - v - - +# centos7 centos8 centos9 rocky8 rocky9 ubi9 ol7 ol8 ol9 amzn2 amzn2022 amzn2023 +# EPEL v v v v v v v v v v - - +# raven - v v v v v - v v - v v +# powertools v v - v - - - - - - - - +# crb - - v - v v* - - - - - - +# REMI v v v v v v v v v v - - +# SCL v - - - - - v* - - v - - # Notes: # - rockylinux and almalinux are compatible # - Rocky Linux repos (https://wiki.rockylinux.org/rocky/repo): # baseos, appstream, powertools(8), crb(9), highavailibility, resilientstorage # - for Oracle Linux 7. SCL/ol should be used instead of SCL +# - ubi9 uses rocky9's repos (baseos, appstream, crb) + +# Useful commands and locations: +# dnf repolist [--all] +# dnf groupinfo GROUP +# dnf info PACKAGE +# dnf makecache +# /etc/yum.repos.d #---------------------------------------------------------------------------------------------- @@ -127,6 +135,102 @@ install_centos_stream_appstream() { runn $SUDO dnf makecache } +install_rocky_repos() { + if [[ $osver != rhel9* ]]; then + return + fi + # check whether rhel repos are in place + if dnf info bison &> /dev/null; then + return + fi + + tmp_yumd=$(mktemp -d) + cat <<-'END' > $tmp_yumd/rocky.repo + [rocky-baseos] + name=Rocky Linux $releasever - BaseOS + mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever + #baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/os/ + gpgcheck=1 + enabled=1 + countme=1 + metadata_expire=6h + gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + priority=100 + + [rocky-appstream] + name=Rocky Linux $releasever - AppStream + mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever + #baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/os/ + gpgcheck=1 + enabled=1 + countme=1 + metadata_expire=6h + gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + priority=100 + + [crb] + name=Rocky Linux $releasever - CRB + mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=CRB-$releasever + #baseurl=http://dl.rockylinux.org/$contentdir/$releasever/CRB/$basearch/os/ + gpgcheck=1 + enabled=1 + countme=1 + metadata_expire=6h + gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + priority=100 + + [rocky-extras] + name=Rocky Linux $releasever - Extras + mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=extras-$releasever + #baseurl=http://dl.rockylinux.org/$contentdir/$releasever/extras/$basearch/os/ + gpgcheck=1 + enabled=1 + countme=1 + metadata_expire=6h + gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + priority=100 + END + + cat <<-'END' > $tmp_yumd/RPM-GPG-KEY + -----BEGIN PGP PUBLIC KEY BLOCK----- + Version: resf.keykeeper.v1 + Comment: Keykeeper + + xsFNBGJ5RksBEADF/Lzssm7uryV6+VHAgL36klyCVcHwvx9Bk853LBOuHVEZWsme + kbJF3fQG7i7gfCKGuV5XW15xINToe4fBThZteGJziboSZRpkEQ2z3lYcbg34X7+d + co833lkBNgz1v6QO7PmAdY/x76Q6Hx0J9yiJWd+4j+vRi4hbWuh64vUtTd7rPwk8 + 0y3g4oK1YT0NR0Xm/QUO9vWmkSTVflQ6y82HhHIUrG+1vQnSOrWaC0O1lqUI3Nuo + b6jTARCmbaPsi+XVQnBbsnPPq6Tblwc+NYJSqj5d9nT0uEXT7Zovj4Je5oWVFXp9 + P1OWkbo2z5XkKjoeobM/zKDESJR78h+YQAN9IOKFjL/u/Gzrk1oEgByCABXOX+H5 + hfucrq5U3bbcKy4e5tYgnnZxqpELv3fN/2l8iZknHEh5aYNT5WXVHpD/8u2rMmwm + I9YTEMueEtmVy0ZV3opUzOlC+3ZUwjmvAJtdfJyeVW/VMy3Hw3Ih0Fij91rO613V + 7n72ggVlJiX25jYyT4AXlaGfAOMndJNVgBps0RArOBYsJRPnvfHlLi5cfjVd7vYx + QhGX9ODYuvyJ/rW70dMVikeSjlBDKS08tvdqOgtiYy4yhtY4ijQC9BmCE9H9gOxU + FN297iLimAxr0EVsED96fP96TbDGILWsfJuxAvoqmpkElv8J+P1/F7to2QARAQAB + zU9Sb2NreSBFbnRlcnByaXNlIFNvZnR3YXJlIEZvdW5kYXRpb24gLSBSZWxlYXNl + IGtleSAyMDIyIDxyZWxlbmdAcm9ja3lsaW51eC5vcmc+wsGKBBMBCAA0BQJieUZL + FiEEIcslauFvxUxuZSlJcC1CbTUNJ10CGwMCHgECGQEDCwkHAhUIAxYAAgIiAQAK + CRBwLUJtNQ0nXWQ5D/9472seOyRO6//bQ2ns3w9lE+aTLlJ5CY0GSTb4xNuyv+AD + IXpgvLSMtTR0fp9GV3vMw6QIWsehDqt7O5xKWi+3tYdaXRpb1cvnh8r/oCcvI4uL + k8kImNgsx+Cj+drKeQo03vFxBTDi1BTQFkfEt32fA2Aw5gYcGElM717sNMAMQFEH + P+OW5hYDH4kcLbtUypPXFbcXUbaf6jUjfiEp5lLjqquzAyDPLlkzMr5RVa9n3/rI + R6OQp5loPVzCRZMgDLALBU2TcFXLVP+6hAW8qM77c+q/rOysP+Yd+N7GAd0fvEvA + mfeA4Y6dP0mMRu96EEAJ1qSKFWUul6K6nuqy+JTxktpw8F/IBAz44na17Tf02MJH + GCUWyM0n5vuO5kK+Ykkkwd+v43ZlqDnwG7akDkLwgj6O0QNx2TGkdgt3+C6aHN5S + MiF0pi0qYbiN9LO0e05Ai2r3zTFC/pCaBWlG1ph2jx1pDy4yUVPfswWFNfe5I+4i + CMHPRFsZNYxQnIA2Prtgt2YMwz3VIGI6DT/Z56Joqw4eOfaJTTQSXCANts/gD7qW + D3SZXPc7wQD63TpDEjJdqhmepaTECbxN7x/p+GwIZYWJN+AYhvrfGXfjud3eDu8/ + i+YIbPKH1TAOMwiyxC106mIL705p+ORf5zATZMyB8Y0OvRIz5aKkBDFZM2QN6A== + =PzIf + -----END PGP PUBLIC KEY BLOCK----- + END + + runn $SUDO mv $tmp_yumd/rocky.repo /etc/yum.repos.d/ + runn $SUDO mv $tmp_yumd/RPM-GPG-KEY /etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + runn rm -rf $tmp_yumd + runn $SUDO dnf makecache +} + #---------------------------------------------------------------------------------------------- if [[ $1 == --help || $1 == help || $HELP == 1 ]]; then @@ -224,23 +328,23 @@ fi if is_command dnf; then xinstall dnf-plugins-core - if [[ $os != amzn* && $os != rhel ]]; then + if [[ $os != amzn* ]]; then (( EPEL < 9 )) && runn $SUDO dnf config-manager -y --set-enabled powertools - (( EPEL >= 9 )) && runn $SUDO dnf config-manager -y --set-enabled crb + (( EPEL > 8 )) && [[ $os != rhel ]] && runn $SUDO dnf config-manager -y --set-enabled crb + if [[ $os == rhel* ]]; then + install_rocky_repos + fi xinstall epel-release # xinstall --allowerasing https://dl.fedoraproject.org/pub/epel/epel-release-latest-${EPEL}.noarch.rpm fi install_raven install_remi - + install_centos_stream_appstream + elif is_command yum; then xinstall -y yum-utils - - if [[ $os != amzn* && $os != rhel ]]; then - (( EPEL >= 9 )) && runn $SUDO yum config-manager -y --set-enabled crb - fi xinstall epel-release install_scl diff --git a/bin/getgcc b/bin/getgcc index fd75168..b15b934 100755 --- a/bin/getgcc +++ b/bin/getgcc @@ -42,11 +42,7 @@ class SystemSetup(paella.Setup): self.install("build-essential") def redhat_compat(self): - if((self.dist == "redhat" or self.dist == "centos") and self.os_ver == 9): - pass - else: - self.group_install("'Development Tools'") - + self.group_install("'Development Tools'") if not self.modern: return self.run(f"{ROOT}/bin/getepel") diff --git a/bin/getget b/bin/getget index fc91ec2..92c6361 100755 --- a/bin/getget +++ b/bin/getget @@ -22,9 +22,11 @@ elif is_command yum; then elif is_command brew; then packs=${packs/ca-certificates/} fi - -if is_command curl; then - packs=${packs/curl/} +if [[ $os == rocky || $os == almalinux || $os == rhel ]]; then + # has curl-minimal which conflicts with curl + if [[ $(echo "$osver >= 9.0" | bc -l) ]]; then + packs=${packs/curl/} + fi fi if [[ $FORCE != 1 ]]; then diff --git a/bin/getredis b/bin/getredis index 2b5b9ac..0a88a4e 100755 --- a/bin/getredis +++ b/bin/getredis @@ -459,8 +459,7 @@ index b0727db2c..ae7f3f80a 100644 def redhat_compat(self): if self.no_prepare: return - if shutil.which('gcc') is None: - self.run(f"{ROOT}/bin/getgcc --modern") + self.group_install("'Development Tools'") self.install("openssl-devel") def fedora(self): diff --git a/bin/getrmpytools b/bin/getrmpytools index 5488d4f..637a344 100755 --- a/bin/getrmpytools +++ b/bin/getrmpytools @@ -93,7 +93,7 @@ class RMPyToolsSetup(paella.Setup): redis_py_cluster_installed = False if self.redispy_version is None: if self.modern: - self.pip_install("--no-cache-dir redis==5.0.0b4") # redis~=5.0.0 / redis~=5.0.0rc1 + self.pip_install("--no-cache-dir redis~=5.0.0") elif self.legacy: self.pip_install("--no-cache-dir git+https://github.com/redisfab/redis-py.git@3.5") self.pip_install("--no-cache-dir git+https://github.com/redisfab/redis-py-cluster@2.1") diff --git a/bin/platform b/bin/platform index f8c6b65..317a0f7 100755 --- a/bin/platform +++ b/bin/platform @@ -1,5 +1,4 @@ -#!/bin/sh -''''[ ! -z $VIRTUAL_ENV ] && exec python -u -- "$0" ${1+"$@"}; command -v python3 > /dev/null && exec python3 -u -- "$0" ${1+"$@"}; exec python2 -u -- "$0" ${1+"$@"} # ''' +#!/usr/bin/env python3 import sys import os diff --git a/mk/docker b/mk/docker index 54b2bd6..890ac34 100644 --- a/mk/docker +++ b/mk/docker @@ -90,8 +90,6 @@ OS.archlinux=archlinux:latest OS.ol8=oraclelinux:8 OS.alma8=almalinux:8 OS.rocky8=rockylinux:8 -OS.rocky9=rockylinux:9 -OS.rhel9=redhat/ubi9 endif # OS diff --git a/mk/docker.cross b/mk/docker.cross index 54b2bd6..890ac34 100644 --- a/mk/docker.cross +++ b/mk/docker.cross @@ -90,8 +90,6 @@ OS.archlinux=archlinux:latest OS.ol8=oraclelinux:8 OS.alma8=almalinux:8 OS.rocky8=rockylinux:8 -OS.rocky9=rockylinux:9 -OS.rhel9=redhat/ubi9 endif # OS diff --git a/mk/docker.native b/mk/docker.native index 2c11a31..b99447c 100644 --- a/mk/docker.native +++ b/mk/docker.native @@ -99,8 +99,6 @@ OS.archlinux=archlinux:latest OS.ol8=oraclelinux:8 OS.alma8=almalinux:8 OS.rocky8=rockylinux:8 -OS.rocky9=rockylinux:9 -OS.rhel9=redhat/ubi9 OS.jammy=ubuntu:jammy endif # OS diff --git a/mk/osnick.defs b/mk/osnick.defs index 3645ef9..b768e8a 100644 --- a/mk/osnick.defs +++ b/mk/osnick.defs @@ -27,6 +27,7 @@ OS.leap15.2=opensuse/leap:15.2 OS.leap15.3=opensuse/leap:15.3 OS.tumbleweed=opensuse/tumbleweed OS.archlinux=archlinux:latest +OS.manjaro=manjarolinux/base:latest OS.alpine3=alpine:latest OS.ol7=oraclelinux:7 OS.ol8=oraclelinux:8 @@ -35,7 +36,7 @@ OS.alma8=almalinux:8 OS.alma9=almalinux:9 OS.rocky8=rockylinux:8 OS.rocky9=rockylinux:9 -OS.rhel9=redhat/ubi9 +OS.rhel9=redhat/ubi9:latest OS.jammy=ubuntu:jammy OS.amzn2=amazonlinux:2 OS.amzn2022=amazonlinux:2022 diff --git a/paella/platform.py b/paella/platform.py index 13fcd47..2ff9ec9 100755 --- a/paella/platform.py +++ b/paella/platform.py @@ -65,6 +65,7 @@ "bigsur": "11", "monterey": "12", "ventura": "13", + "sonoma": "14", } DARWIN_VERSIONS = { @@ -87,6 +88,7 @@ "bigsur": "20", "monterey": "21", "ventura": "22", + "sonoma": "23", } MACOS_VERSIONS_NICKS = {v: k for k, v in MACOS_VERSIONS.items()} @@ -97,10 +99,10 @@ class Platform: class OSRelease(): - CUSTOM_BRANDS = [ 'elementary', 'pop', 'rocky', 'almalinux' ] + CUSTOM_BRANDS = [ 'elementary', 'pop' ] # , 'rocky', 'almalinux' UBUNTU_BRANDS = [ 'elementary', 'pop' ] - RHEL_BRANDS = [ 'rocky', 'almalinux' ] - ROLLING_RELEASES = ['arch', 'gentoo', 'manjaro'] + RHEL_BRANDS = [ 'centos', 'rhel', 'redhat', 'rocky', 'almalinux' ] + ROLLING_BRANDS = [ 'arch', 'gentoo', 'manjaro' ] def __init__(self, brand=False): self.defs = {} @@ -116,18 +118,12 @@ def __init__(self, brand=False): def __repr__(self): return str(self.defs) - def is_custom_brand(self): - id = self.defs.get("ID", "") - return id != "" and id in self.CUSTOM_BRANDS - #-------------------------------------------------------------------------------------- + # e.g. "centos", "fedora", "rhel", "ubuntu", "debian" def id(self): - # e.g. "centos" if self.is_custom_brand() and not self.brand_mode: like = self.id_like() - if 'rhel' in like or 'centos' in like: - return 'centos' return like[0] return self.defs.get("ID", "") @@ -137,7 +133,7 @@ def id_like(self): def version_id(self): brand = self.brand_id() - if brand in self.ROLLING_RELEASES: + if brand in self.ROLLING_BRANDS: return "rolling" if brand in self.UBUNTU_BRANDS: @@ -162,6 +158,7 @@ def debian_sid_version(self): # returns version_id, codename else: return "", "" + # e.g. "bionic", "focal", "jammy" - not always present def version_codename(self): brand = self.brand_id() if brand in self.UBUNTU_BRANDS: @@ -177,6 +174,7 @@ def variant_id(self): # fedora-specific return self.defs.get("VARIANT_ID") + # e.g. "bionic", "focal", "jammy" def ubuntu_codename(self): # ubuntu-specific return self.defs.get("UBUNTU_CODENAME") @@ -204,6 +202,10 @@ def brand_codename(self): def brand_version_id(self): return self.defs.get("VERSION_ID", "") + def is_custom_brand(self): + id = self.brand_id() + return id != "" and id in self.CUSTOM_BRANDS + #------------------------------------------------------------------------------------------ def __init__(self, strict=False, brand=False): @@ -236,22 +238,22 @@ def _identify_linux(self): try: os_release = Platform.OSRelease(brand=self.brand_mode) self.os_ver = os_release.version_id() - self.osnick = self._identify_linux_osnick(os_release) self.dist = self._identify_linux_dist(os_release) + self.osnick = self._identify_linux_osnick(os_release) self.os_full_ver = self._identify_linux_full_ver(os_release, self.dist) except: if self.strict: raise Error("Cannot determine distribution") self.os_ver = self.os_full_ver = 'unknown' - def _identify_linux_full_ver(self, os_release, distname): - if distname == 'centos' or distname == 'redhat' or distname == 'rocky' or distname == 'almalinux': + def _identify_linux_full_ver(self, os_release, dist): + if dist in Platform.OSRelease.RHEL_BRANDS + ['ol']: redhat_release = fread('/etc/redhat-release') m = match(r'.* release ([^\s]+)', redhat_release) if m: fullver = m[1] return fullver - elif distname == 'ubuntu': + elif dist == 'ubuntu': brand = os_release.brand_id() if brand in os_release.UBUNTU_BRANDS: return self.os_ver @@ -261,43 +263,42 @@ def _identify_linux_full_ver(self, os_release, distname): return os_release.version_id() def _identify_linux_dist(self, os_release): - distname = os_release.id() - if distname == 'fedora' or distname == 'debian': + dist = os_release.id() + if dist == 'fedora' or dist == 'debian': pass - elif distname == 'ubuntu': - if self.osnick == 'ubuntu14.04': - self.osnick = 'trusty' - elif distname.startswith('centos') or distname.startswith('rocky') or distname.startswith('almalinux'): - distname = 'centos' - elif distname.startswith('redhat') or distname == 'rhel': - distname = 'redhat' - elif distname.startswith('suse'): - distname = 'suse' - elif distname.startswith('amzn'): - distname = 'amzn' - self.osnick = 'amzn' + str(os_release.version_id()) + elif dist == 'ubuntu': + pass + elif dist.startswith('rocky') or dist.startswith('almalinux') or dist.startswith('redhat') or dist == 'rhel': + if not self.brand_mode: + dist = 'centos' + elif dist.startswith('suse'): + dist = 'suse' + elif dist.startswith('amzn'): + dist = 'amzn' else: if 'arch' in os_release.id_like(): - distname = 'arch' + dist = 'arch' if self.strict: raise Error("Cannot determine distribution") - elif distname == '': - distname = 'unknown' - return distname + elif dist == '': + dist = 'unknown' + return dist def _identify_linux_osnick(self, os_release): osnick = "" - distname = os_release.id() - if distname == 'ubuntu' or distname == 'debian': + dist = self.dist + if dist == 'ubuntu' or dist == 'debian': osnick = os_release.version_codename() if osnick == "": - versions = DEBIAN_VERSIONS if distname == 'debian' else UBUNTU_VERSIONS + versions = DEBIAN_VERSIONS if dist == 'debian' else UBUNTU_VERSIONS versions_nicks = {v: k for k, v in versions.items()} osnick = versions_nicks.get(os_release.version_id(), "") - if distname == 'ol': - osnick = distname + str(os_release.version_id().split('.')[0]) + if osnick == 'ubuntu14.04': + osnick = 'trusty' + elif dist == 'ol': + osnick = dist + str(os_release.version_id().split('.')[0]) if osnick == "": - osnick = distname + str(os_release.version_id()) + osnick = dist + str(os_release.version_id()) return osnick #------------------------------------------------------------------------------------------ @@ -362,7 +363,19 @@ def is_debian_compat(self): return self.dist in ['debian', 'ubuntu', 'linuxmint', 'raspbian'] def is_redhat_compat(self): - return self.dist in ['redhat', 'centos', 'amzn', 'ol'] + return self.dist in ['redhat', 'rhel', 'centos', 'rocky', 'alma', 'almalinux', 'amzn', 'ol'] + + def redhat_compat_version(self): + if self.dist in ['redhat', 'rhel', 'centos', 'rocky', 'alma', 'almalinux', 'amzn', 'ol']: + return self.os_version[0] + elif self.dist == 'amzn': + amzn_vers = { 2: 7, 2022: 8, 2023: 9 } + try: + return amzn_vers[os_version[0]] + except: + raise Error("unknown amazonlinux version") + else: + raise Error("unknown RHEL version") def is_arch_compat(self): return self.dist == 'arch' @@ -427,9 +440,9 @@ def invoke(self): self.ubuntu() elif dist == 'debian': self.debian() - elif dist == 'centos': + elif dist in ['centos', 'rocky', 'alma', 'redhat', 'rhel']: self.centos() - elif dist == 'redhat': + elif dist in ['redhat', 'rhel']: self.redhat() elif dist == 'ol': self.oracle() @@ -492,7 +505,7 @@ def oracle(self): def fedora(self): pass - def redhat_compat(self): # centos, rhel, amzn, etc + def redhat_compat(self): # redhat, rhel, centos, rocky, alma, amzn, ol, etc pass def redhat(self): diff --git a/paella/setup.py b/paella/setup.py index b0ee034..633889a 100755 --- a/paella/setup.py +++ b/paella/setup.py @@ -136,12 +136,12 @@ def __init__(self, runner): @staticmethod def detect(platform, runner): if platform.os == 'linux': - if platform.dist == 'fedora' or platform.dist == 'centos' and platform.os_version[0] == 8: - return Dnf(runner) - elif platform.is_debian_compat(): + if platform.is_debian_compat(): return Apt(runner) elif platform.is_redhat_compat(): - return Yum(runner) + return Yum(runner) if platform.redhat_compat_version() == 7 else Dnf(runner) + elif platform.dist == 'fedora': + return Dnf(runner) elif platform.dist == 'suse': return Zypper(runner) elif platform.dist == 'arch': @@ -477,7 +477,8 @@ def pip_uninstall(self, cmd, output="on_error", _try=False): def install_downloaders(self, _try=False): if self.os == 'linux': self.install("ca-certificates", _try=_try) - if self.platform.is_redhat_compat() and self.platform.os_version[0] < 9: + if not (self.platform.is_redhat_compat() and self.platform.os_version[0] >= 9): + # has curl-minimal which conflicts with curl self.install("curl", _try=_try) self.install("wget unzip", _try=_try)