From: Kefu Chai Date: Mon, 25 Dec 2017 09:06:19 +0000 (+0800) Subject: scripts/build_utils.sh: extract use_ppa() as a function X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=dfbec0cffd226515b40c10aeba092e2e5688ffd7;p=ceph-build.git scripts/build_utils.sh: extract use_ppa() as a function so it can be reused. Signed-off-by: Kefu Chai --- diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index 0b16f60c..5b243ee8 100644 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -411,9 +411,7 @@ setup_pbuilder() { fi } -setup_pbuilder_for_ppa() { - # point gcc,g++ to the newly installed ones - local hookdir=$HOME/.pbuilder/hook.d +use_ppa() { case $vers in 10.*) # jewel @@ -425,20 +423,29 @@ setup_pbuilder_for_ppa() { # mimic, nautilus, * case $DIST in trusty) - old=4.8 use_ppa=true;; xenial) - old=5 use_ppa=true;; *) - use_ppa=false - ;; + use_ppa=false;; esac ;; esac - if ! $use_ppa; then + $use_ppa +} + +setup_pbuilder_for_ppa() { + # point gcc,g++ to the newly installed ones + local hookdir=$HOME/.pbuilder/hook.d + if ! use_ppa; then return fi + case $DIST in + trusty) + old=4.8;; + xenial) + old=5 + esac echo "HOOKDIR=$hookdir" @@ -487,26 +494,7 @@ EOF extra_cmake_args() { # statically link against libstdc++ for building new releases on old distros - case $vers in - 10.*) - # jewel - use_ppa=false;; - 12.*) - # luminous - use_ppa=false;; - *) - # mimic, nautilus, * - case $DIST in - trusty) - use_ppa=true;; - xenial) - use_ppa=true;; - *) - use_ppa=false;; - esac - ;; - esac - if $use_ppa; then + if use_ppa; then echo "-DWITH_STATIC_LIBSTDCXX=ON" fi }