From: Kefu Chai Date: Sat, 9 Dec 2017 09:35:28 +0000 (+0800) Subject: install-deps.sh: install new gcc as the default the right way X-Git-Tag: v13.0.2~827^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3882deae8c94802cfd49153ad2cf33f0a3dba60d;p=ceph.git install-deps.sh: install new gcc as the default the right way * should install software-properties-common beforehand, otherwise the `add-apt-repository` command will not be available. * the update-alternative commandline were copied from ceph-build, should remove the escape characters. Signed-off-by: Kefu Chai --- diff --git a/install-deps.sh b/install-deps.sh index dcc95fba541f..d9dbfdd95ee3 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -36,12 +36,12 @@ function ensure_decent_gcc_on_deb { fi $SUDO update-alternatives \ - --install /usr/bin/gcc gcc /usr/bin/gcc-\${new} 20 \ - --slave /usr/bin/g++ g++ /usr/bin/g++-\${new} + --install /usr/bin/gcc gcc /usr/bin/gcc-${new} 20 \ + --slave /usr/bin/g++ g++ /usr/bin/g++-${new} $SUDO update-alternatives \ - --install /usr/bin/gcc gcc /usr/bin/gcc-\${old} 10 \ - --slave /usr/bin/g++ g++ /usr/bin/g++-\${old} + --install /usr/bin/gcc gcc /usr/bin/gcc-${old} 10 \ + --slave /usr/bin/g++ g++ /usr/bin/g++-${old} $SUDO update-alternatives --auto gcc @@ -140,9 +140,10 @@ else $SUDO apt-get install -y dpkg-dev case "$VERSION" in *Trusty*) + $SUDO apt-get install -y software-properties-common $SUDO add-apt-repository ppa:ubuntu-toolchain-r/test $SUDO apt-get update - $SUDO apt-get install -y gcc-7 + $SUDO apt-get install -y g++-7 ensure_decent_gcc_on_deb 7 ;; *)