bindep: depends: Add distro family aliases
CentOS, RHEL and Fedora share a lot of similarities when it comes to package names so group them together under the 'redhat' alias. Similarly, group openSUSE Leap, Tumbleweed and SLE under the 'suse' alias. Change-Id: I5bfe33cd48c21b4c94f550a27b96466f488a8df8
This commit is contained in:
parent
0f1dc05165
commit
8d9c48ef06
|
@ -136,6 +136,13 @@ since those entries have the ``platform:rpm`` profile, and
|
|||
``dev-libs/libxml2`` on Gentoo since the entry has the
|
||||
``platform:gentoo`` profile.
|
||||
|
||||
Additionally, you can use ``platform:redhat`` or ``platform:suse`` to only
|
||||
match RedHat-like or SUSE-like distributions respectively as shown in the
|
||||
following example::
|
||||
|
||||
openssh-server [platform:redhat]
|
||||
openssh [platform:suse]
|
||||
|
||||
To select Python3 development packages, the OpenStack CI default file uses::
|
||||
|
||||
python3-all-dev [platform:dpkg !platform:ubuntu-precise]
|
||||
|
|
|
@ -250,6 +250,12 @@ class Depends(object):
|
|||
elif distro in ["opensuseproject", "opensusetumbleweed"]:
|
||||
# just short alias
|
||||
atoms.add("opensuse")
|
||||
# Family aliases
|
||||
if 'suse' in distro:
|
||||
atoms.add("suse")
|
||||
else:
|
||||
atoms.add("redhat")
|
||||
|
||||
atoms.add("rpm")
|
||||
self.platform = Rpm()
|
||||
elif distro in ["gentoo"]:
|
||||
|
|
|
@ -65,8 +65,9 @@ class TestDepends(TestCase):
|
|||
def test_detects_centos(self):
|
||||
with self._mock_lsb("CentOS"):
|
||||
depends = Depends("")
|
||||
self.assertThat(
|
||||
depends.platform_profiles(), Contains("platform:centos"))
|
||||
platform_profiles = depends.platform_profiles()
|
||||
self.assertThat(platform_profiles, Contains("platform:centos"))
|
||||
self.assertThat(platform_profiles, Contains("platform:redhat"))
|
||||
|
||||
def test_detects_rhel(self):
|
||||
with self._mock_lsb("RedHatEnterpriseServer"):
|
||||
|
@ -78,12 +79,16 @@ class TestDepends(TestCase):
|
|||
self.assertThat(
|
||||
platform_profiles,
|
||||
Contains("platform:rhel"))
|
||||
self.assertThat(
|
||||
platform_profiles,
|
||||
Contains("platform:redhat"))
|
||||
|
||||
def test_detects_fedora(self):
|
||||
with self._mock_lsb("Fedora"):
|
||||
depends = Depends("")
|
||||
self.assertThat(
|
||||
depends.platform_profiles(), Contains("platform:fedora"))
|
||||
platform_profiles = depends.platform_profiles()
|
||||
self.assertThat(platform_profiles, Contains("platform:fedora"))
|
||||
self.assertThat(platform_profiles, Contains("platform:redhat"))
|
||||
|
||||
def test_detects_opensuse_project(self):
|
||||
with self._mock_lsb("openSUSE Project"):
|
||||
|
@ -93,6 +98,8 @@ class TestDepends(TestCase):
|
|||
Contains("platform:opensuseproject"))
|
||||
self.assertThat(platform_profiles,
|
||||
Contains("platform:opensuse"))
|
||||
self.assertThat(platform_profiles,
|
||||
Contains("platform:suse"))
|
||||
|
||||
def test_detects_opensuse_tumbleweed(self):
|
||||
with self._mock_lsb("openSUSE Tumbleweed"):
|
||||
|
@ -102,12 +109,15 @@ class TestDepends(TestCase):
|
|||
Contains("platform:opensusetumbleweed"))
|
||||
self.assertThat(platform_profiles,
|
||||
Contains("platform:opensuse"))
|
||||
self.assertThat(platform_profiles,
|
||||
Contains("platform:suse"))
|
||||
|
||||
def test_detects_suse_linux(self):
|
||||
with self._mock_lsb("SUSE Linux"):
|
||||
depends = Depends("")
|
||||
self.assertThat(
|
||||
depends.platform_profiles(), Contains("platform:suselinux"))
|
||||
platform_profiles = depends.platform_profiles()
|
||||
self.assertThat(platform_profiles, Contains("platform:suselinux"))
|
||||
self.assertThat(platform_profiles, Contains("platform:suse"))
|
||||
|
||||
def test_detects_ubuntu(self):
|
||||
with self._mock_lsb("Ubuntu"):
|
||||
|
|
Loading…
Reference in New Issue