]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
run-make-check.sh: stricter check for yum/apt-get/zypper 4513/head
authorTim Serong <tserong@suse.com>
Thu, 30 Apr 2015 07:44:10 +0000 (17:44 +1000)
committerTim Serong <tserong@suse.com>
Thu, 30 Apr 2015 07:51:20 +0000 (17:51 +1000)
Believe it or not, it's possible (although not necessarily likely) to
have both yum and zypper installed on openSUSE.  In this case the
previous implementation using `which` would return a string containing
both commands, which doesn't work.

Signed-off-by: Tim Serong <tserong@suse.com>
run-make-check.sh

index 940c3dacc2f187471df792c0ffec96f0f6b8e4ff..c569ff4adc283e9a8af78b1806286d76bbce5590 100755 (executable)
@@ -42,7 +42,16 @@ function get_processors() {
 }
 
 function run() {
-    sudo $(which apt-get yum zypper 2>/dev/null) install -y ccache jq
+    # Same logic as install-deps.sh for finding package installer
+    local install_cmd
+    test -f /etc/redhat-release && install_cmd="yum install -y"
+    type apt-get > /dev/null 2>&1 && install_cmd="apt-get install -y"
+    type zypper > /dev/null 2>&1 && install_cmd="zypper --gpg-auto-import-keys --non-interactive install"
+    if [ -n "$install_cmd" ]; then
+        sudo $install_cmd ccache jq
+    else
+        echo "WARNING: Don't know how to install packages" >&2
+    fi
     sudo /sbin/modprobe rbd
 
     if test -f ./install-deps.sh ; then