From 92170ab9f0cc98f382047cf31520d167e95b6a17 Mon Sep 17 00:00:00 2001 From: Ake Sandgren Date: Wed, 6 Nov 2019 16:26:29 +0100 Subject: [PATCH 1/3] check_os_dependency: Handle the fact that get_os_name can produce RHEL and SL* --- easybuild/tools/systemtools.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/easybuild/tools/systemtools.py b/easybuild/tools/systemtools.py index ee6b0bceaf..cc5c819667 100644 --- a/easybuild/tools/systemtools.py +++ b/easybuild/tools/systemtools.py @@ -602,7 +602,6 @@ def check_os_dependency(dep): found = False cmd = None os_to_pkg_cmd_map = { - 'centos': RPM, 'debian': DPKG, 'redhat': RPM, 'ubuntu': DPKG, @@ -612,6 +611,11 @@ def check_os_dependency(dep): RPM: '-q', } os_name = get_os_name() + + rh_based_os = any(os_name.startswith(x) for x in ['centos', 'redhat', 'rhel', 'sl']) + if rh_based_os: + os_name = 'redhat' + if os_name in os_to_pkg_cmd_map: pkg_cmds = [os_to_pkg_cmd_map[os_name]] else: From 4733363fd71f0106f8c0bb2728c4fcb82a4d8d0e Mon Sep 17 00:00:00 2001 From: Ake Sandgren Date: Wed, 6 Nov 2019 16:29:20 +0100 Subject: [PATCH 2/3] check_os_dependency: Also handle fedora --- easybuild/tools/systemtools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/tools/systemtools.py b/easybuild/tools/systemtools.py index cc5c819667..172bd0e381 100644 --- a/easybuild/tools/systemtools.py +++ b/easybuild/tools/systemtools.py @@ -612,7 +612,7 @@ def check_os_dependency(dep): } os_name = get_os_name() - rh_based_os = any(os_name.startswith(x) for x in ['centos', 'redhat', 'rhel', 'sl']) + rh_based_os = any(os_name.startswith(x) for x in ['centos', 'fedora', 'redhat', 'rhel', 'sl']) if rh_based_os: os_name = 'redhat' From 76c8f8efd278df113182e49dd5543a9b24ffe526 Mon Sep 17 00:00:00 2001 From: Ake Sandgren Date: Mon, 30 Mar 2020 07:51:50 +0200 Subject: [PATCH 3/3] Avoid startswith for rh_based check. --- easybuild/tools/systemtools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/tools/systemtools.py b/easybuild/tools/systemtools.py index 743c25eee1..b98af502b3 100644 --- a/easybuild/tools/systemtools.py +++ b/easybuild/tools/systemtools.py @@ -647,7 +647,7 @@ def check_os_dependency(dep): } os_name = get_os_name() - rh_based_os = any(os_name.startswith(x) for x in ['centos', 'fedora', 'redhat', 'rhel', 'sl']) + rh_based_os = os_name in ['centos', 'fedora', 'redhat', 'RHEL', 'SL'] if rh_based_os: os_name = 'redhat'