bindep: depends: Add support for openSUSE {Leap,Tumbleweed}
lsb_release -cirs reports the following for openSUSE Leap and Tumbleweed respectively - openSUSE Tumbleweed 20170213 n/a - openSUSE project 42.2 n/a As a result of which, 'bindep --profiles' prints the following - platform:opensusetumbleweed [...] - platform:opensuseproject [...] So we need to assign the 'rpm' class to these openSUSE distributions as well. We also make the 'opensuse' platform an alias to these two openSUSE distributions since no actively maintained openSUSE distribution returns just 'openSUSE' in lsb_release -cirs. Change-Id: Id7104045c7f126f70332322a5e4dbf2f5921096c
This commit is contained in:
parent
4a96f38637
commit
0f1dc05165
|
@ -242,10 +242,14 @@ class Depends(object):
|
|||
atoms.add("dpkg")
|
||||
self.platform = Dpkg()
|
||||
elif distro in ["centos", "redhatenterpriseserver", "fedora",
|
||||
"opensuse", "suselinux"]:
|
||||
"opensuseproject", "opensusetumbleweed",
|
||||
"suselinux"]:
|
||||
if distro == "redhatenterpriseserver":
|
||||
# just short alias
|
||||
atoms.add("rhel")
|
||||
elif distro in ["opensuseproject", "opensusetumbleweed"]:
|
||||
# just short alias
|
||||
atoms.add("opensuse")
|
||||
atoms.add("rpm")
|
||||
self.platform = Rpm()
|
||||
elif distro in ["gentoo"]:
|
||||
|
|
|
@ -85,11 +85,23 @@ class TestDepends(TestCase):
|
|||
self.assertThat(
|
||||
depends.platform_profiles(), Contains("platform:fedora"))
|
||||
|
||||
def test_detects_opensuse(self):
|
||||
with self._mock_lsb("openSUSE"):
|
||||
def test_detects_opensuse_project(self):
|
||||
with self._mock_lsb("openSUSE Project"):
|
||||
depends = Depends("")
|
||||
self.assertThat(
|
||||
depends.platform_profiles(), Contains("platform:opensuse"))
|
||||
platform_profiles = depends.platform_profiles()
|
||||
self.assertThat(platform_profiles,
|
||||
Contains("platform:opensuseproject"))
|
||||
self.assertThat(platform_profiles,
|
||||
Contains("platform:opensuse"))
|
||||
|
||||
def test_detects_opensuse_tumbleweed(self):
|
||||
with self._mock_lsb("openSUSE Tumbleweed"):
|
||||
depends = Depends("")
|
||||
platform_profiles = depends.platform_profiles()
|
||||
self.assertThat(platform_profiles,
|
||||
Contains("platform:opensusetumbleweed"))
|
||||
self.assertThat(platform_profiles,
|
||||
Contains("platform:opensuse"))
|
||||
|
||||
def test_detects_suse_linux(self):
|
||||
with self._mock_lsb("SUSE Linux"):
|
||||
|
@ -143,8 +155,15 @@ class TestDepends(TestCase):
|
|||
depends.platform_profiles(), Contains("platform:rpm"))
|
||||
self.assertIsInstance(depends.platform, Rpm)
|
||||
|
||||
def test_opensuse_implies_rpm(self):
|
||||
with self._mock_lsb("openSUSE"):
|
||||
def test_opensuse_project_implies_rpm(self):
|
||||
with self._mock_lsb("openSUSE Project"):
|
||||
depends = Depends("")
|
||||
self.assertThat(
|
||||
depends.platform_profiles(), Contains("platform:rpm"))
|
||||
self.assertIsInstance(depends.platform, Rpm)
|
||||
|
||||
def test_opensuse_tumbleweed_implies_rpm(self):
|
||||
with self._mock_lsb("openSUSE Tumbleweed"):
|
||||
depends = Depends("")
|
||||
self.assertThat(
|
||||
depends.platform_profiles(), Contains("platform:rpm"))
|
||||
|
|
Loading…
Reference in New Issue