-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also move all platform alias registration after the regular platform registrations. These aliases call `get_os_name_and_version`, which behaves differently if the calling platform is registered.
- Loading branch information
Showing
2 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,9 +27,11 @@ | |
|
||
# Author Tully Foote/[email protected] | ||
|
||
from __future__ import print_function | ||
import subprocess | ||
import sys | ||
|
||
from rospkg.os_detect import OS_RHEL, OS_FEDORA | ||
from rospkg.os_detect import OS_CENTOS, OS_RHEL, OS_FEDORA | ||
|
||
from .pip import PIP_INSTALLER | ||
from .source import SOURCE_INSTALLER | ||
|
@@ -53,6 +55,9 @@ def register_platforms(context): | |
register_fedora(context) | ||
register_rhel(context) | ||
|
||
# Aliases | ||
register_centos(context) | ||
|
||
|
||
def register_fedora(context): | ||
context.add_os_installer_key(OS_FEDORA, PIP_INSTALLER) | ||
|
@@ -71,6 +76,16 @@ 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. | ||
(os_name, os_version) = context.get_os_name_and_version() | ||
if os_name == OS_CENTOS and not context.os_override: | ||
print('rosdep detected OS: [%s] aliasing it to: [%s]' % | ||
(OS_CENTOS, OS_RHEL), file=sys.stderr) | ||
context.set_os_override(OS_RHEL, os_version.split('.', 1)[0]) | ||
|
||
|
||
def rpm_detect_py(packages): | ||
ret_list = [] | ||
import rpm | ||
|