Skip to content

Commit 9418290

Browse files
committed
use 'zypper search -i' to check whether specified OS dependency is installed on openSUSE
1 parent 8470097 commit 9418290

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 = {
@@ -785,14 +787,17 @@ def check_os_dependency(dep):
785787
os_to_pkg_cmd_map = {
786788
'centos': RPM,
787789
'debian': DPKG,
790+
'opensuse': ZYPPER,
788791
'redhat': RPM,
792+
'rhel': RPM,
789793
'ubuntu': DPKG,
790794
}
791795
pkg_cmd_flag = {
792796
DPKG: '-s',
793797
RPM: '-q',
798+
ZYPPER: 'search -i',
794799
}
795-
os_name = get_os_name()
800+
os_name = get_os_name().lower().split(' ')[0]
796801
if os_name in os_to_pkg_cmd_map:
797802
pkg_cmds = [os_to_pkg_cmd_map[os_name]]
798803
else:

0 commit comments

Comments
 (0)