setup_board: make the gcc/glibc version stable by default, take 2

This is needed as part of transition to cros-workon.

Crossdev has a -S option to install the current stable, which is
the preferred future option, but would greatly complicate the logic.

BUG=chromium-os:25338
TEST=setup_board --board=any --force, see it build the right versions

Change-Id: I9139b8a38c9156ea27dfb428cff8c7deffb0e6de
Reviewed-on: https://gerrit.chromium.org/gerrit/15011
Tested-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
This commit is contained in:
Zdenek Behan 2012-01-26 16:43:54 +01:00 committed by Gerrit
parent 4eb59d19a4
commit 22fe627981

View File

@ -48,9 +48,9 @@ DEFINE_boolean force $FLAGS_FALSE \
"Force re-creating board root."
DEFINE_string binutils_version "2.21-r3" \
"Version of binutils to use."
DEFINE_string gcc_version "4.6.0-r13" \
DEFINE_string gcc_version "stable" \
"Version of gcc to use."
DEFINE_string libc_version "2.11.1-r3" \
DEFINE_string libc_version "stable" \
"Version of libc to use."
DEFINE_string kernel_version "3.1" \
"Version of kernel headers to use."
@ -142,9 +142,23 @@ toolchain_needs_update() {
return 1
fi
# Unmask any ebuilds previously masked by crossdev. crossdev will re-setup
# its masks appropriately the next time we run it.
sudo rm -f /etc/portage/package.mask/cross-$toolchain
# Unmask any ebuilds previously [un]masked by crossdev. crossdev will
# re-setup its masks appropriately the next time we run it.
sudo rm -f /etc/portage/package.{mask,keywords}/cross-$toolchain
pkg_to_flag() {
[ "${1}" = "glibc" ] && echo "libc" || echo "$1"
}
local pkg
for pkg in gcc glibc binutils; do
local flagname=FLAGS_$(pkg_to_flag ${pkg})_version
if [ "${!flagname}" = "stable" ]; then
eval ${flagname}=$( \
portageq best_visible / "cross-$toolchain/${pkg}"| \
sed -e "s,cross-$toolchain/${pkg}-,,")
fi
done
local flags="--pretend --quiet --update"
local pkgs