mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 22:16:58 +02:00
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:
parent
d91e8d21c4
commit
a70da914ba
@ -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.
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user