From 5d6a6c58b0eda84615d8d57fd2fb3c58768cc61b Mon Sep 17 00:00:00 2001 From: Erik Berg Date: Fri, 8 Apr 2022 13:23:52 +0200 Subject: [PATCH] Add AlmaLinux support Depends-On: I6cc3bedaa9753dc86d6560d32961b5a22cf3a36e Change-Id: I037e1b0306315f7d12af0a4b6cba4226c24e6748 --- bindep/depends.py | 4 ++-- bindep/tests/fixtures/almalinux/etc/os-release | 15 +++++++++++++++ bindep/tests/test_depends.py | 6 ++++++ .../notes/almalinux-154befa793559c61.yaml | 4 ++++ 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 bindep/tests/fixtures/almalinux/etc/os-release create mode 100644 releasenotes/notes/almalinux-154befa793559c61.yaml diff --git a/bindep/depends.py b/bindep/depends.py index dc6b2ea..dbf029d 100644 --- a/bindep/depends.py +++ b/bindep/depends.py @@ -353,7 +353,7 @@ class Depends(object): "opensuseproject", "opensuse", "opensuse-leap", "opensuse-tumbleweed", "sles", "suselinux", "ol", "oracle", - "rocky"]: + "rocky", "almalinux"]: # Distro aliases if distro_id in ["redhatenterpriseserver", "redhatenterpriseworkstation"]: @@ -404,7 +404,7 @@ class Depends(object): elif "fedora" in distro_id: atoms.add(PY2 if release_version < as_ver("23") else PY3) elif any(w in distro_id for w in ["centos", "oracle", "rhel", - "rocky"]): + "rocky", "almalinux"]): atoms.add(PY2 if release_version < as_ver("8") else PY3) # Family aliases diff --git a/bindep/tests/fixtures/almalinux/etc/os-release b/bindep/tests/fixtures/almalinux/etc/os-release new file mode 100644 index 0000000..b7454b3 --- /dev/null +++ b/bindep/tests/fixtures/almalinux/etc/os-release @@ -0,0 +1,15 @@ +NAME="AlmaLinux" +VERSION="8.5 (Arctic Sphynx)" +ID="almalinux" +ID_LIKE="rhel centos fedora" +VERSION_ID="8.5" +PLATFORM_ID="platform:el8" +PRETTY_NAME="AlmaLinux 8.5 (Arctic Sphynx)" +ANSI_COLOR="0;34" +CPE_NAME="cpe:/o:almalinux:almalinux:8::baseos" +HOME_URL="https://almalinux.org/" +DOCUMENTATION_URL="https://wiki.almalinux.org/" +BUG_REPORT_URL="https://bugs.almalinux.org/" + +ALMALINUX_MANTISBT_PROJECT="AlmaLinux-8" +ALMALINUX_MANTISBT_PROJECT_VERSION="8.5" diff --git a/bindep/tests/test_depends.py b/bindep/tests/test_depends.py index 01ca29d..58feee4 100644 --- a/bindep/tests/test_depends.py +++ b/bindep/tests/test_depends.py @@ -257,6 +257,12 @@ class TestDepends(TestCase): self.assertThat( depends.platform_profiles(), Contains("platform:rpm")) + def test_detects_almalinux(self): + with DistroFixture("almalinux"): + depends = Depends("") + self.assertThat( + depends.platform_profiles(), Contains("platform:rpm")) + def test_detects_release(self): with DistroFixture("Ubuntu"): depends = Depends("") diff --git a/releasenotes/notes/almalinux-154befa793559c61.yaml b/releasenotes/notes/almalinux-154befa793559c61.yaml new file mode 100644 index 0000000..bbbf94c --- /dev/null +++ b/releasenotes/notes/almalinux-154befa793559c61.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Add support for AlmaLinux to Bindep.