mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-04 19:56:32 +02:00
fix(toolchain_util.sh): Move native->cross pkg translation to function
Will be useful in other places and seems better to hide the bash magic.
This commit is contained in:
parent
0ba3d9ea04
commit
986548722d
@ -47,7 +47,7 @@ EOF
|
||||
|
||||
build_cross_toolchain() {
|
||||
local cross_chost="$1"
|
||||
local cross_pkgs=( "${TOOLCHAIN_PKGS[@]/*\//cross-${cross_chost}/}" )
|
||||
local cross_pkgs=( $(get_cross_pkgs $cross_chost) )
|
||||
local PORTDIR="$(portageq envvar PORTDIR)"
|
||||
local PKGDIR="${PORTDIR}/packages/crossdev"
|
||||
|
||||
|
||||
@ -62,3 +62,12 @@ get_board_profile() {
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
get_cross_pkgs() {
|
||||
local cross_chost native_pkg
|
||||
for cross_chost in "$@"; do
|
||||
for native_pkg in "${TOOLCHAIN_PKGS[@]}"; do
|
||||
echo "${native_pkg/*\//cross-${cross_chost}/}"
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user