]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps.sh: keep debian alternatives
authorLoic Dachary <ldachary@redhat.com>
Fri, 29 May 2015 21:55:01 +0000 (23:55 +0200)
committerLoic Dachary <ldachary@redhat.com>
Fri, 29 May 2015 21:55:01 +0000 (23:55 +0200)
Instead of removing the | when an alternative is found in the control
file such as

     cryptsetup-bin | cryptsetup

remove the surrounding spaces so that it is treated as a regular
expression that matches either one.

Replace the form

    sudo bash -c "FOO=bar ..."

with

    sudo env FOO=bar ...

to reduce the levels of shell escaping.

Reported-by: http://dyweni.com/
Signed-off-by: Loic Dachary <ldachary@redhat.com>
install-deps.sh

index e074f6de465d481c6b0c35449ba5a0082a654b82..a8954fd99bfda568d09947000993e97225b2907e 100755 (executable)
@@ -42,7 +42,7 @@ Ubuntu|Debian|Devuan)
         packages=$(dpkg-checkbuilddeps --admindir=$DIR debian/control 2>&1 | \
             perl -p -e 's/.*Unmet build dependencies: *//;' \
             -e 's/build-essential:native/build-essential/;' \
-            -e 's/\|//g;' \
+            -e 's/\s*\|\s*/\|/g;' \
             -e 's/\(.*?\)//g;' \
             -e 's/ +/\n/g;' | sort)
         case $(lsb_release -sc) in
@@ -52,7 +52,7 @@ Ubuntu|Debian|Devuan)
                 ;;
         esac
         packages=$(echo $packages) # change newlines into spaces
-        $SUDO bash -c "DEBIAN_FRONTEND=noninteractive apt-get install $backports -y $packages" || exit 1
+        $SUDO env DEBIAN_FRONTEND=noninteractive apt-get install $backports -y $packages || exit 1
         ;;
 CentOS|Fedora|RedHatEnterpriseServer)
         case $(lsb_release -si) in