mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 22:51:03 +02:00
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:
parent
9dfad070c9
commit
0badc0a576
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user