From: Kefu Chai Date: Wed, 13 Dec 2017 06:22:39 +0000 (+0800) Subject: install-deps.sh: avoid re-installing g++-7 X-Git-Tag: v13.0.1~8^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eba0fca4f63fd02f0dfbf781f3ec667dca2c799a;p=ceph.git install-deps.sh: avoid re-installing g++-7 * add ubuntu-toolchain-r mirrors in case the ppa.launchpad.net is not accessible * add ppa repo manually, it's faster than installing `software-properties-common` and then launch `add-apt-repository` * hardwire $old to the gcc version shipped by the distro, simpler this way. Signed-off-by: Kefu Chai (cherry picked from commit b69e3efe64159417b2c80894ba5c249eb470d80a) --- diff --git a/install-deps.sh b/install-deps.sh index 28d692059ab6..75728e81e24f 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -35,14 +35,26 @@ function ensure_decent_gcc_on_deb { return fi - if [ ! -f /usr/bin/gcc-${old} ]; then - case $(lsb_release --short --codename) in - trusty) - old=4.8;; - xenial) - old=5;; - esac + local dist=$(lsb_release --short --codename) + + if [ ! -f /usr/bin/g++-${new} ]; then + $SUDO cat > /etc/apt/sources.list.d/ubuntu-toolchain-r.list <