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
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