From 3882deae8c94802cfd49153ad2cf33f0a3dba60d Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 9 Dec 2017 17:35:28 +0800 Subject: [PATCH] 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 --- install-deps.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 ;; *) -- 2.47.3