]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps.sh: extract munge_debian_control()
authorKefu Chai <kchai@redhat.com>
Wed, 13 Feb 2019 11:56:00 +0000 (19:56 +0800)
committerNathan Cutler <ncutler@suse.com>
Fri, 4 Oct 2019 09:40:46 +0000 (11:40 +0200)
this function will uncomment necessary dependencies on demand.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 4fd179654e3c37c837899372859959283479cee6)

Conflicts:
install-deps.sh

install-deps.sh

index fd21a3d1b18826c01ed6727af8fb47eec9b1ce6d..4171e1fd47d55c0878af298310ca41feb27e1e8e 100755 (executable)
@@ -29,6 +29,20 @@ function munge_ceph_spec_in {
     sed -e 's/@//g' -e 's/%bcond_with make_check/%bcond_without make_check/g' < ceph.spec.in > $OUTFILE
 }
 
+function munge_debian_control {
+    local version=$1
+    shift
+    local control=$1
+    shift
+    case "$version" in
+        *squeeze*|*wheezy*)
+           control="/tmp/control.$$"
+           grep -v babeltrace debian/control > $control
+           ;;
+    esac
+    echo $control
+}
+
 function ensure_decent_gcc_on_ubuntu {
     # point gcc to the one offered by g++-7 if the used one is not
     # new enough
@@ -195,11 +209,9 @@ else
         touch $DIR/status
 
        backports=""
-       control="debian/control"
+       control=$(munge_debian_control "$VERSION" "debian/control")
         case "$VERSION" in
             *squeeze*|*wheezy*)
-               control="/tmp/control.$$"
-               grep -v babeltrace debian/control > $control
                 backports="-t $codename-backports"
                 ;;
         esac
@@ -209,7 +221,7 @@ else
        # 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
+       if [ "$control" != "debian/control" ] ; then rm $control; fi
         ;;
     centos|fedora|rhel|ol|virtuozzo)
         yumdnf="yum"