From 22fe62798137da570acc19452b2a2f507cb013ae Mon Sep 17 00:00:00 2001 From: Zdenek Behan Date: Thu, 26 Jan 2012 16:43:54 +0100 Subject: [PATCH] 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 Reviewed-by: Mike Frysinger Commit-Ready: Zdenek Behan --- setup_board | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/setup_board b/setup_board index 1e500f4e8f..790b929552 100755 --- a/setup_board +++ b/setup_board @@ -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