diff options
-rwxr-xr-x | tinderbox-restart.sh | 2 | ||||
-rwxr-xr-x | update-gcc-asneeded.sh | 20 |
2 files changed, 14 insertions, 8 deletions
diff --git a/tinderbox-restart.sh b/tinderbox-restart.sh index b2c89ad..2d555a9 100755 --- a/tinderbox-restart.sh +++ b/tinderbox-restart.sh @@ -49,7 +49,7 @@ reset_emergelog emerge -Nu1 sys-apps/portage emerge -Nu1 sys-devel/gcc -if fgrep -q '>>> emerge' /var/log/emerge.log && gcc-config -l | tail -n 1 | grep -v asneeded; then +if fgrep -q '>>> emerge' /var/log/emerge.log; then ${tboxdir}/update-gcc-asneeded.sh exit 0 fi diff --git a/update-gcc-asneeded.sh b/update-gcc-asneeded.sh index 38f5717..31c348c 100755 --- a/update-gcc-asneeded.sh +++ b/update-gcc-asneeded.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright © 2007-2010 Diego Elio Pettenò <flameeyes@gentoo.org> +# Copyright © 2007-2013 Diego Elio Pettenò <flameeyes@gentoo.org> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -15,9 +15,15 @@ # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS # SOFTWARE. -export SPECSFILE=$(dirname "$(gcc -print-libgcc-file-name)")/asneeded.specs -export CURRPROFILE=/etc/env.d/gcc/$(gcc-config -c) -gcc -dumpspecs | sed -e '/link:/,+1 s:--eh-frame-hdr:\0 --as-needed:' > "$SPECSFILE" -sed "${CURRPROFILE}" -e '1i\GCC_SPECS='$SPECSFILE > "${CURRPROFILE}-asneeded" -gcc-config "$(basename "${CURRPROFILE}")-asneeded" -source /etc/profile +SPECSFILE=$(dirname "$(gcc -print-libgcc-file-name)")/asneeded.specs +CURRPROFILE=$(gcc-config -c) +PROFILEFILE=/etc/env.d/gcc/$(gcc-config -c) + +# only proceed with the changes if we're not already on an asneeded +# profile. +if [ ${CURRPROFILE/asneeded} = ${CURRPROFILE} ]; then + gcc -dumpspecs | sed -e '/link:/,+1 s:--eh-frame-hdr:\0 --as-needed:' > "$SPECSFILE" + sed "${PROFILEFILE}" -e '1i\GCC_SPECS='$SPECSFILE > "${PROFILEFILE}-asneeded" + gcc-config "${CURRPROFILE}-asneeded" + source /etc/profile +fi |