From: Kefu Chai Date: Sat, 9 Dec 2017 11:29:58 +0000 (+0800) Subject: install-deps.sh: use GCC-7 on xenial also X-Git-Tag: v13.0.2~815^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8a0935988fb845d0b88d97470b08e93a8709a03d;p=ceph.git install-deps.sh: use GCC-7 on xenial also Signed-off-by: Kefu Chai --- diff --git a/install-deps.sh b/install-deps.sh index d9dbfdd95ee..28d692059ab 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -31,10 +31,19 @@ function ensure_decent_gcc_on_deb { # new enough local old=$(gcc -dumpversion) local new=$1 - if dpkg --compare-versions $old ge 5.1; then + if dpkg --compare-versions $old ge 7.0; then return fi + if [ ! -f /usr/bin/gcc-${old} ]; then + case $(lsb_release --short --codename) in + trusty) + old=4.8;; + xenial) + old=5;; + esac + fi + $SUDO update-alternatives --remove-all gcc || true $SUDO update-alternatives \ --install /usr/bin/gcc gcc /usr/bin/gcc-${new} 20 \ --slave /usr/bin/g++ g++ /usr/bin/g++-${new} @@ -139,7 +148,7 @@ else $SUDO apt-get install -y lsb-release devscripts equivs $SUDO apt-get install -y dpkg-dev case "$VERSION" in - *Trusty*) + *Trusty*|*Xenial*) $SUDO apt-get install -y software-properties-common $SUDO add-apt-repository ppa:ubuntu-toolchain-r/test $SUDO apt-get update