Skip to content

Commit

Permalink
Add support for a few RHEL clones (#802)
Browse files Browse the repository at this point in the history
In addition to CentOS, this change adds support for a few other RHEL
clones: AlmaLinux, Oracle Linux, and Rocky Linux.

Co-authored-by: Tully Foote <[email protected]>
  • Loading branch information
cottsay and tfoote authored Apr 6, 2021
1 parent d6c44cb commit 4b6a4f0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'version': '0.20.0',
'packages': ['rosdep2', 'rosdep2.ament_packages', 'rosdep2.platforms'],
'package_dir': {'': 'src'},
'install_requires': ['catkin_pkg >= 0.4.0', 'rospkg >= 1.2.7', 'rosdistro >= 0.7.5', 'PyYAML >= 3.1'],
'install_requires': ['catkin_pkg >= 0.4.0', 'rospkg >= 1.3.0', 'rosdistro >= 0.7.5', 'PyYAML >= 3.1'],
'test_suite': 'nose.collector',
'test_requires': ['mock', 'nose >= 1.0'],
'author': 'Tully Foote, Ken Conley',
Expand Down
24 changes: 17 additions & 7 deletions src/rosdep2/platforms/redhat.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@
import subprocess
import sys

from rospkg.os_detect import OS_CENTOS, OS_RHEL, OS_FEDORA
from rospkg.os_detect import (
OS_ALMALINUX,
OS_CENTOS,
OS_FEDORA,
OS_ORACLE,
OS_RHEL,
OS_ROCKY
)

from .pip import PIP_INSTALLER
from .source import SOURCE_INSTALLER
Expand All @@ -56,7 +63,10 @@ def register_platforms(context):
register_rhel(context)

# Aliases
register_centos(context)
register_rhel_clone(context, OS_ALMALINUX)
register_rhel_clone(context, OS_CENTOS)
register_rhel_clone(context, OS_ORACLE)
register_rhel_clone(context, OS_ROCKY)


def register_fedora(context):
Expand All @@ -77,13 +87,13 @@ def register_rhel(context):
context.set_os_version_type(OS_RHEL, lambda self: self.get_version().split('.', 1)[0])


def register_centos(context):
# CentOS is an alias for RHEL. If CentOS is detected and it's not set as
# an override force RHEL.
def register_rhel_clone(context, os_rhel_clone_name):
# Some distributions are rebuilds of RHEL and can be treated like RHEL
# because they are versioned the same and contain the same packages.
(os_name, os_version) = context.get_os_name_and_version()
if os_name == OS_CENTOS and not context.os_override:
if os_name == os_rhel_clone_name and not context.os_override:
print('rosdep detected OS: [%s] aliasing it to: [%s]' %
(OS_CENTOS, OS_RHEL), file=sys.stderr)
(os_rhel_clone_name, OS_RHEL), file=sys.stderr)
context.set_os_override(OS_RHEL, os_version.split('.', 1)[0])


Expand Down
4 changes: 2 additions & 2 deletions stdeb.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ X-Python3-Version: >= 3.4
Setup-Env-Vars: SKIP_PYTHON_MODULES=1

[rosdep_modules]
Depends: ca-certificates, python-rospkg-modules (>= 1.2.7), python-yaml, python-catkin-pkg-modules (>= 0.4.0), python-rosdistro-modules (>= 0.7.5), sudo
Depends3: ca-certificates, python3-rospkg-modules (>= 1.2.7), python3-yaml, python3-catkin-pkg-modules (>= 0.4.0), python3-rosdistro-modules (>= 0.7.5), sudo
Depends: ca-certificates, python-rospkg-modules (>= 1.3.0), python-yaml, python-catkin-pkg-modules (>= 0.4.0), python-rosdistro-modules (>= 0.7.5), sudo
Depends3: ca-certificates, python3-rospkg-modules (>= 1.3.0), python3-yaml, python3-catkin-pkg-modules (>= 0.4.0), python3-rosdistro-modules (>= 0.7.5), sudo
Conflicts: python-rosdep (<< 0.18.0), python-rosdep2
Conflicts3: python3-rosdep (<< 0.18.0), python3-rosdep2
Replaces: python-rosdep (<< 0.18.0)
Expand Down

0 comments on commit 4b6a4f0

Please sign in to comment.