From 0badc0a5760e598b3b0b87d4872e59ae8f4c1cbb Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Fri, 29 Nov 2013 15:01:03 -0800 Subject: [PATCH] fix(toolchain_util.sh): Don't build via crossdev if pkgs are up to date. When calling update_chroot with --nousepkg it is silly to always force a rebuild of the cross toolchain. Change the test to work regardless of whether binary packages are enabled by checking if anything needs to be built from source. --- build_library/toolchain_util.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build_library/toolchain_util.sh b/build_library/toolchain_util.sh index 08fd55f7e5..e415922130 100644 --- a/build_library/toolchain_util.sh +++ b/build_library/toolchain_util.sh @@ -177,16 +177,16 @@ install_cross_toolchain() { $sudo tee "${cross_cfg}" <<<"${cross_cfg_data}" >/dev/null fi - # If binary packages are enabled try to just emerge them instead of - # doing a full bootstrap which speeds things up greatly. :) - if [[ "$*" == *--usepkg* ]] && \ - emerge "$@" --usepkgonly --binpkg-respect-use=y \ - --pretend "${cross_pkgs[@]}" &>/dev/null + # Check if any packages need to be built from source. If so do a full + # bootstrap via crossdev, otherwise just install the binaries (if enabled). + if emerge "$@" --binpkg-respect-use=y --update --newuse \ + --pretend "${cross_pkgs[@]}" | grep -q '^\[ebuild' then - $sudo emerge "$@" --binpkg-respect-use=y -u "${cross_pkgs[@]}" - else $sudo crossdev --stable --portage "$*" \ --stage4 --target "${cross_chost}" + else + $sudo emerge "$@" --binpkg-respect-use=y --update --newuse \ + "${cross_pkgs[@]}" fi # Setup wrappers for our shiny new toolchain