]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps.sh: install new gcc as the default the right way 19417/head
authorKefu Chai <kchai@redhat.com>
Sat, 9 Dec 2017 09:35:28 +0000 (17:35 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 9 Dec 2017 12:00:28 +0000 (20:00 +0800)
* 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 <kchai@redhat.com>
install-deps.sh

index dcc95fba541f169c31149cbf1d8302a574f8e361..d9dbfdd95ee3b0cb5fc0f15caf37b29fee46064e 100755 (executable)
@@ -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
                 ;;
             *)