]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps.sh: use GCC-7 on xenial also
authorKefu Chai <kchai@redhat.com>
Sat, 9 Dec 2017 11:29:58 +0000 (19:29 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 11 Dec 2017 15:26:24 +0000 (23:26 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
install-deps.sh

index d9dbfdd95ee3b0cb5fc0f15caf37b29fee46064e..28d692059ab63b5340e60c922acbd21d847d9d85 100755 (executable)
@@ -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