From eba0fca4f63fd02f0dfbf781f3ec667dca2c799a Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 13 Dec 2017 14:22:39 +0800 Subject: [PATCH] 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) --- install-deps.sh | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/install-deps.sh b/install-deps.sh index 28d692059ab..75728e81e24 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 <