From a8aba53c52b875af36229c30d990c645b63dee67 Mon Sep 17 00:00:00 2001 From: "Rick Farina (Zero_Chaos)" Date: Mon, 15 May 2017 23:29:58 -0400 Subject: [PATCH] scripts: a bit cleaner/safer gcc upgrade --- scripts/pentoo-updater.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/pentoo-updater.sh b/scripts/pentoo-updater.sh index 4b55bc7fd..d555408b4 100755 --- a/scripts/pentoo-updater.sh +++ b/scripts/pentoo-updater.sh @@ -44,9 +44,14 @@ if [ -n "$(find /usr/include/python3.{3,4,5} -type f 2> /dev/null)" ]; then emerge -1v --usepkg=n --buildpkg=y /usr/include/python3.{3,4,5} fi -#taken from news item gcc-5-new-c++11-abi -if [ "$(gcc-config -c)" = "x86_64-pc-linux-gnu-5.4.0" ]; then - revdep-rebuild --library 'libstdc++.so.6' -- --buildpkg=y --usepkg=n --exclude gcc +#modified from news item gcc-5-new-c++11-abi +gcc_target="86_64-pc-linux-gnu-5.4.0" +if [ "$(gcc-config -c)" != "${gcc_target}" ]; then + if gcc-config -l | grep -q "${gcc_target}"; then + gcc-config "${gcc_target}" + . /etc/profile + revdep-rebuild --library 'libstdc++.so.6' -- --buildpkg=y --usepkg=n --exclude gcc + fi fi if [ -n "${clst_target}" ]; then @@ -65,10 +70,6 @@ if [ -n "${clst_target}" ]; then echo "pentoo/pentoo kde mate" >> /etc/portage/package.use emerge @changed-deps || safe_exit emerge --buildpkg --usepkg --onlydeps --oneshot --deep --update --newuse --changed-use --newrepo pentoo/pentoo || safe_exit - #taken from news item gcc-5-new-c++11-abi - if [ "$(gcc-config -c)" = "x86_64-pc-linux-gnu-5.4.0" ]; then - revdep-rebuild --library 'libstdc++.so.6' -- --buildpkg=y --usepkg=n --exclude gcc - fi etc-update --automode -5 || safe_exit fi