]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps.sh: populate WITH_SEASTAR in the same way as for_make_check
authorKefu Chai <kchai@redhat.com>
Thu, 6 Jun 2019 03:10:41 +0000 (11:10 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 7 Jun 2019 14:17:19 +0000 (22:17 +0800)
because `install-deps.sh` is executed using `source`, we have to pass
these options using env variables. but before this change, `WITH_SEASTAR` is used directly,
while `FOR_MAKE_CHECK` is checked and translated to a local variable
`for_make_check`. which, in my opinion, has better readability.

so, in this change, `WITH_SEASTAR` is translated to `with_seastar`
variable in `install-deps.sh`.

Signed-off-by: Kefu Chai <kchai@redhat.com>
install-deps.sh

index 9e45920ebea091140836e5dfb2892e8a63c09ca5..62bd1297deb97c3a071c0ab5e4da9d8018cde328 100755 (executable)
@@ -24,12 +24,14 @@ export LC_ALL=C # the following is vulnerable to i18n
 ARCH=$(uname -m)
 
 function munge_ceph_spec_in {
+    local with_seastar=$1
+    shift
     local for_make_check=$1
     shift
     local OUTFILE=$1
     sed -e 's/@//g' < ceph.spec.in > $OUTFILE
     # http://rpm.org/user_doc/conditional_builds.html
-    if [ $WITH_SEASTAR ]; then
+    if $with_seastar; then
         sed -i -e 's/%bcond_with seastar/%bcond_without seastar/g' $OUTFILE
     fi
     if $for_make_check; then
@@ -40,6 +42,8 @@ function munge_ceph_spec_in {
 function munge_debian_control {
     local version=$1
     shift
+    local with_seastar=$1
+    shift
     local for_make_check=$1
     shift
     local control=$1
@@ -49,7 +53,7 @@ function munge_debian_control {
            grep -v babeltrace debian/control > $control
            ;;
     esac
-    if [ $with_seastar ]; then
+    if $with_seastar; then
        sed -i -e 's/^# Crimson[[:space:]]//g' $control
     fi
     if $for_make_check; then
@@ -261,6 +265,7 @@ else
     else
         for_make_check=false
     fi
+    [ $WITH_SEASTAR ] && with_seastar=true || with_seastar=false
     source /etc/os-release
     case $ID in
     debian|ubuntu|devuan)
@@ -289,7 +294,7 @@ else
         touch $DIR/status
 
        backports=""
-       control=$(munge_debian_control "$VERSION" "$for_make_check" "debian/control")
+       control=$(munge_debian_control "$VERSION" "$with_seastar" "$for_make_check" "debian/control")
         case "$VERSION" in
             *squeeze*|*wheezy*)
                 backports="-t $codename-backports"
@@ -354,7 +359,7 @@ else
                 fi
                 ;;
         esac
-        munge_ceph_spec_in $for_make_check $DIR/ceph.spec
+        munge_ceph_spec_in $with_seastar $for_make_check $DIR/ceph.spec
         $SUDO $yumdnf install -y \*rpm-macros
         $SUDO $builddepcmd $DIR/ceph.spec 2>&1 | tee $DIR/yum-builddep.out
         [ ${PIPESTATUS[0]} -ne 0 ] && exit 1
@@ -369,7 +374,7 @@ else
         echo "Using zypper to install dependencies"
         zypp_install="zypper --gpg-auto-import-keys --non-interactive install --no-recommends"
         $SUDO $zypp_install systemd-rpm-macros
-        munge_ceph_spec_in $for_make_check $DIR/ceph.spec
+        munge_ceph_spec_in $with_seastar $for_make_check $DIR/ceph.spec
         $SUDO $zypp_install $(rpmspec -q --buildrequires $DIR/ceph.spec) || exit 1
         $SUDO $zypp_install libxmlsec1-1 libxmlsec1-nss1 libxmlsec1-openssl1 xmlsec1-devel xmlsec1-openssl-devel
         ;;