]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps: fix installing gcc on ubuntu when no old compiler
authorTomasz Setkowski <tom@ai-traders.com>
Sat, 14 Apr 2018 15:23:58 +0000 (15:23 +0000)
committerNathan Cutler <ncutler@suse.com>
Fri, 4 Oct 2019 15:28:16 +0000 (17:28 +0200)
Signed-off-by: Tomasz Setkowski <tom@ai-traders.com>
(cherry picked from commit 0d8d0cf6f7594f4f97677a2069998331998bdfa9)

install-deps.sh

index 372f91698e58db28f977619b41e8638f50867a58..51bfa4c37eb8c528c98691b3b36308090c4d2c58 100755 (executable)
@@ -51,9 +51,11 @@ EOF
         --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}
+    if [ -f /usr/bin/g++-${old} ]; then
+      $SUDO update-alternatives \
+        --install /usr/bin/gcc gcc /usr/bin/gcc-${old} 10 \
+        --slave   /usr/bin/g++ g++ /usr/bin/g++-${old}
+    fi
 
     $SUDO update-alternatives --auto gcc