]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
build/ops: fix /etc/os-release parsing in install-deps.sh
authorNathan Cutler <ncutler@suse.com>
Mon, 5 Sep 2016 13:40:33 +0000 (15:40 +0200)
committerNathan Cutler <ncutler@suse.com>
Mon, 5 Sep 2016 14:20:49 +0000 (16:20 +0200)
85a370e35fc42031a7f7e24dea9e50a649c0f309 introduced the DISTRO variable whose
value was obtained by parsing /etc/os-release like this:

DISTRO=$(grep  "^ID=" /etc/os-release | sed "s/ID=//")

This unfortunately picks up the double-quotes, so on a CentOS system DISTRO
will be equal to '"centos"'.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
install-deps.sh

index 486d40d27c30284ce48312a8370f508789ccc623..96bd419a82246851bb8038057bcca9aad574b332 100755 (executable)
@@ -55,8 +55,8 @@ if [ x`uname`x = xFreeBSDx ]; then
 
     exit
 else
-    DISTRO=$(grep  "^ID=" /etc/os-release | sed "s/ID=//")
-    case $DISTRO in
+    source /etc/os-release
+    case $ID in
     debian|ubuntu|devuan)
         echo "Using apt-get to install dependencies"
         $SUDO apt-get install -y lsb-release devscripts equivs
@@ -118,7 +118,7 @@ else
         $SUDO zypper --non-interactive install $(rpmspec -q --buildrequires $DIR/ceph.spec) || exit 1
         ;;
     *)
-        echo "$DISTRO is unknown, dependencies will have to be installed manually."
+        echo "$ID is unknown, dependencies will have to be installed manually."
         ;;
     esac
 fi