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.
This commit is contained in:
Michael Marineau 2013-11-29 15:01:03 -08:00
parent 9dfad070c9
commit 0badc0a576

View File

@ -177,16 +177,16 @@ install_cross_toolchain() {
$sudo tee "${cross_cfg}" <<<"${cross_cfg_data}" >/dev/null $sudo tee "${cross_cfg}" <<<"${cross_cfg_data}" >/dev/null
fi fi
# If binary packages are enabled try to just emerge them instead of # Check if any packages need to be built from source. If so do a full
# doing a full bootstrap which speeds things up greatly. :) # bootstrap via crossdev, otherwise just install the binaries (if enabled).
if [[ "$*" == *--usepkg* ]] && \ if emerge "$@" --binpkg-respect-use=y --update --newuse \
emerge "$@" --usepkgonly --binpkg-respect-use=y \ --pretend "${cross_pkgs[@]}" | grep -q '^\[ebuild'
--pretend "${cross_pkgs[@]}" &>/dev/null
then then
$sudo emerge "$@" --binpkg-respect-use=y -u "${cross_pkgs[@]}"
else
$sudo crossdev --stable --portage "$*" \ $sudo crossdev --stable --portage "$*" \
--stage4 --target "${cross_chost}" --stage4 --target "${cross_chost}"
else
$sudo emerge "$@" --binpkg-respect-use=y --update --newuse \
"${cross_pkgs[@]}"
fi fi
# Setup wrappers for our shiny new toolchain # Setup wrappers for our shiny new toolchain