Skip to content

Commit 4f96bfb

Browse files
authored
Merge pull request #3973 from boegel/opensuse_zypper_check_os_dep
use 'zypper search -i' to check whether specified OS dependency is installed on openSUSE + make sure that rpm is considered for checking OS dependencies on RHEL8
2 parents e596f7a + 9418290 commit 4f96bfb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

easybuild/tools/systemtools.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
# OS package handler name constants
164164
RPM = 'rpm'
165165
DPKG = 'dpkg'
166+
ZYPPER = 'zypper'
166167

167168
SYSTEM_TOOLS = {
168169
'7z': "extracting sources (.iso)",
@@ -178,6 +179,7 @@
178179
'tar': "unpacking source files (.tar)",
179180
'unxz': "decompressing source files (.xz, .txz)",
180181
'unzip': "decompressing files (.zip)",
182+
ZYPPER: "checking OS dependencies (openSUSE)",
181183
}
182184

183185
SYSTEM_TOOL_CMDS = {
@@ -808,14 +810,17 @@ def check_os_dependency(dep):
808810
os_to_pkg_cmd_map = {
809811
'centos': RPM,
810812
'debian': DPKG,
813+
'opensuse': ZYPPER,
811814
'redhat': RPM,
815+
'rhel': RPM,
812816
'ubuntu': DPKG,
813817
}
814818
pkg_cmd_flag = {
815819
DPKG: '-s',
816820
RPM: '-q',
821+
ZYPPER: 'search -i',
817822
}
818-
os_name = get_os_name()
823+
os_name = get_os_name().lower().split(' ')[0]
819824
if os_name in os_to_pkg_cmd_map:
820825
pkg_cmds = [os_to_pkg_cmd_map[os_name]]
821826
else:

0 commit comments

Comments
 (0)