fix(toolchain_util.sh): Replace TOOLCHAIN_BINONLY with a function.

The new function supports generating arguments for cross toolchain
packages in addition to native ones.
This commit is contained in:
Michael Marineau 2013-11-29 16:52:26 -08:00
parent d91e8d21c4
commit a70da914ba
2 changed files with 7 additions and 6 deletions

View File

@ -10,10 +10,6 @@ TOOLCHAIN_PKGS=(
sys-libs/glibc
)
# Portage arguments to enforce the toolchain to only use binpkgs.
TOOLCHAIN_BINONLY=( "${TOOLCHAIN_PKGS[@]/#/--useoldpkg-atoms=}"
"${TOOLCHAIN_PKGS[@]/#/--rebuild-exclude=}" )
# Portage profile to use for building out the cross compiler's SYSROOT.
# This is only used as an intermediate step to be able to use the cross
# compiler to build a full native toolchain. Packages are not uploaded.
@ -31,7 +27,6 @@ BOARD_NAMES=( "${!BOARD_CHOST[@]}" )
# Declare the above globals as read-only to avoid accidental conflicts.
declare -r \
TOOLCHAIN_PKGS \
TOOLCHAIN_BINONLY \
CROSS_PROFILES \
BOARD_CHOSTS \
BOARD_NAMES \
@ -118,6 +113,12 @@ get_cross_pkgs() {
done
}
# Get portage arguments restricting toolchains to binary packages only.
get_binonly_args() {
local pkgs=( "${TOOLCHAIN_PKGS[@]}" $(get_cross_pkgs "$@") )
echo "${pkgs[@]/#/--useoldpkg-atoms=}" "${pkgs[@]/#/--rebuild-exclude=}"
}
### Toolchain building utilities ###
# Ugly hack to get a dependency list of a set of packages.

View File

@ -95,7 +95,7 @@ if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then
fi
# Only update toolchain when binpkgs are available.
EMERGE_FLAGS+=" ${TOOLCHAIN_BINONLY[*]}"
EMERGE_FLAGS+=" $(get_binonly_args $(get_chost_list))"
fi
if [[ "${FLAGS_jobs}" -ne -1 ]]; then