From 5be6ff11e536cb492dd50dedf8a04fb9acc1222e Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 14 Dec 2017 21:01:43 +0800 Subject: [PATCH] install-deps.sh: readlink /usr/bin/gcc not /usr/bin/x86_64-linux-gnu-gcc See: http://tracker.ceph.com/issues/22220 Signed-off-by: Kefu Chai --- install-deps.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/install-deps.sh b/install-deps.sh index 0b36c6bd13e59..db29156ed8d33 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -21,9 +21,13 @@ export LC_ALL=C # the following is vulnerable to i18n function ensure_decent_gcc_on_deb { # point gcc to the one offered by distro if the used one is different - local old=$(readlink -e /usr/bin/x86_64-linux-gnu-gcc | cut -d'-' -f2) + local old=$(readlink -e /usr/bin/gcc | cut -d'-' -f2) local new=$1 - if dpkg --compare-versions $old eq $new; then + if [ ! -f /usr/bin/gcc-${old} ]; then + $SUDO rm -f /usr/bin/gcc-${old} + $SUDO ln -sf /usr/bin/gcc-${new} /usr/bin/gcc + return + elif dpkg --compare-versions $old eq $new; then return fi @@ -31,8 +35,8 @@ function ensure_decent_gcc_on_deb { *i*) # interactive shell cat <