From 941829083dd3322d81f6dce6c9b7e831c0580ca4 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Sun, 27 Feb 2022 16:04:21 +0100 Subject: [PATCH] use 'zypper search -i' to check whether specified OS dependency is installed on openSUSE --- easybuild/tools/systemtools.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/easybuild/tools/systemtools.py b/easybuild/tools/systemtools.py index 37411e4b86..e681929798 100644 --- a/easybuild/tools/systemtools.py +++ b/easybuild/tools/systemtools.py @@ -163,6 +163,7 @@ # OS package handler name constants RPM = 'rpm' DPKG = 'dpkg' +ZYPPER = 'zypper' SYSTEM_TOOLS = { '7z': "extracting sources (.iso)", @@ -178,6 +179,7 @@ 'tar': "unpacking source files (.tar)", 'unxz': "decompressing source files (.xz, .txz)", 'unzip': "decompressing files (.zip)", + ZYPPER: "checking OS dependencies (openSUSE)", } SYSTEM_TOOL_CMDS = { @@ -785,14 +787,17 @@ def check_os_dependency(dep): os_to_pkg_cmd_map = { 'centos': RPM, 'debian': DPKG, + 'opensuse': ZYPPER, 'redhat': RPM, + 'rhel': RPM, 'ubuntu': DPKG, } pkg_cmd_flag = { DPKG: '-s', RPM: '-q', + ZYPPER: 'search -i', } - os_name = get_os_name() + os_name = get_os_name().lower().split(' ')[0] if os_name in os_to_pkg_cmd_map: pkg_cmds = [os_to_pkg_cmd_map[os_name]] else: