From: Kefu Chai Date: Fri, 8 Dec 2017 08:34:59 +0000 (+0800) Subject: install-deps.sh: use DTS on centos if GCC is too old X-Git-Tag: v12.2.13~109^2~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aea530f684513e6444d1f837b826f907b5783510;p=ceph.git install-deps.sh: use DTS on centos if GCC is too old please note, run-make-check.sh sources install-deps.sh here to import the $PATH and other environmental variables, which could be changed by the the DTS "enable" script. Signed-off-by: Kefu Chai (cherry picked from commit 3f8647a7e80b20079bec97d5be12372909083bb4) Conflicts: install-deps.sh run-make-check.sh - RH/CentOS changes only --- diff --git a/install-deps.sh b/install-deps.sh index 016abf5b7ad2..645d3f2c40d1 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -62,6 +62,38 @@ EOF $SUDO ln -nsf /usr/bin/g++ /usr/bin/x86_64-linux-gnu-g++ } +function version_lt { + test $1 != $(echo -e "$1\n$2" | sort -rV | head -n 1) +} + +function ensure_decent_gcc_on_rh { + local old=$(gcc -dumpversion) + local expected=5.1 + local dts_ver=$1 + if version_lt $old $expected; then + case $- in + *i*) + # interactive shell + cat <&1 | tee $DIR/yum-builddep.out + if [ -n dts_ver ]; then + ensure_decent_gcc_on_rh $dts_ver + fi ! grep -q -i error: $DIR/yum-builddep.out || exit 1 ;; opensuse*|suse|sles) diff --git a/run-make-check.sh b/run-make-check.sh index 2244e5ea5b0a..b5679e4e14f6 100755 --- a/run-make-check.sh +++ b/run-make-check.sh @@ -89,7 +89,7 @@ function run() { fi if test -f ./install-deps.sh ; then - $DRY_RUN ./install-deps.sh || return 1 + $DRY_RUN source ./install-deps.sh || return 1 trap clean_up_after_myself EXIT fi