]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps.sh: use mk-build-deps instead of processing control
authorDan Mick <dan.mick@redhat.com>
Thu, 24 Mar 2016 00:43:53 +0000 (17:43 -0700)
committerJosh Durgin <jdurgin@redhat.com>
Tue, 21 Jun 2016 23:36:56 +0000 (16:36 -0700)
mk-build-deps is designed to handle installing build dependencies;
use that instead, so '|' indications are handled properly.

Signed-off-by: Dan Mick <dan.mick@redhat.com>
install-deps.sh

index 902130992a6bc8e08059db8e73d0b0863d46c80e..246aca2ae548ef4508cbe11598f8c36d739e0273 100755 (executable)
@@ -61,7 +61,7 @@ if test -f /etc/redhat-release ; then
 fi
 
 if type apt-get > /dev/null 2>&1 ; then
-    $SUDO apt-get install -y lsb-release
+    $SUDO apt-get install -y lsb-release devscripts equivs
 fi
 
 if type zypper > /dev/null 2>&1 ; then
@@ -76,20 +76,23 @@ Ubuntu|Debian|Devuan)
             exit 1
         fi
         touch $DIR/status
-        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/\s*\|\s*/\|/g;' \
-            -e 's/\(.*?\)//g;' \
-            -e 's/ +/\n/g;' | sort)
+
+       backports=""
+       control="debian/control"
         case $(lsb_release -sc) in
             squeeze|wheezy)
-                packages=$(echo $packages | perl -pe 's/[-\w]*babeltrace[-\w]*//g')
+               control="/tmp/control.$$"
+               grep -v babeltrace debian/control > $control
                 backports="-t $(lsb_release -sc)-backports"
                 ;;
         esac
-        packages=$(echo $packages) # change newlines into spaces
-        $SUDO env DEBIAN_FRONTEND=noninteractive apt-get install $backports -y $packages || exit 1
+
+       # make a metapackage that expresses the build dependencies,
+       # install it, rm the .deb; then uninstall the package as its
+       # work is done
+       $SUDO env DEBIAN_FRONTEND=noninteractive mk-build-deps --install --remove --tool="apt-get -y --no-install-recommends $backports" $control || exit 1
+       $SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y remove ceph-build-deps
+       if [ -n "$backports" ] ; then rm $control; fi
         ;;
 CentOS|Fedora|RedHatEnterpriseServer)
         case $(lsb_release -si) in