gcc-update-hook: regenerate latest gcc prior to calling gcc-config

BUG=chromium-os:19613
TEST=below
1) Manually create a chroot with old gcc
2) Let the script update&select new one, unmerge old

Change-Id: I71732da315ed4effc6df48afab797718e44d7a06
Reviewed-on: http://gerrit.chromium.org/gerrit/7117
Tested-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
This commit is contained in:
Zdenek Behan 2011-09-02 00:51:51 +02:00 committed by chrome-bot
parent 4b964ca646
commit 9a995bb37c

View File

@ -14,10 +14,14 @@ CHOST="$(portageq envvar CHOST)"
# This is the lowest we want to go in this particular case.
MINIMUM_GCC="4.4.6"
GCC_VERSIONS="$(gcc-config -l | grep "${CHOST}" | \
cut -f3 -d' ')"
GCC_LATEST="$(gcc-config -l | grep "${CHOST}" | tail -n1 | \
cut -f3 -d' ')"
function env_setup() {
GCC_VERSIONS="$(gcc-config -l | grep "${CHOST}" | \
cut -f3 -d' ')"
GCC_LATEST="$(gcc-config -l | grep "${CHOST}" | tail -n1 | \
cut -f3 -d' ')"
}
env_setup
if ! [ "$(portageq match / ">=sys-devel/gcc-${MINIMUM_GCC}")" ];
then
@ -34,6 +38,8 @@ then
fi
fi
env_setup
info "Updating the host toolchain. crosbug.com/19613"
info "Currently installed host gcc versions: $(echo -n ${GCC_VERSIONS})"