From 373c2eb23dfed9ca0cef80321e7d57ddaf550d35 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 13 Jul 2024 23:07:45 +0100 Subject: trees: move dependency building to new function configure_project is a bit big. move the dependencies build logic to a new function. it may be desirable in future to make the way that function works the way all build commands are done. for example: ./update trees -b coreboot x230_12mb would become: ./update trees -b coreboot/x230_12mb this would enable to mix and match multi/single tree projects. for now, leave things as they are. Signed-off-by: Leah Rowe --- script/trees | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'script') diff --git a/script/trees b/script/trees index a260cf24..db5f52b6 100755 --- a/script/trees +++ b/script/trees @@ -139,21 +139,24 @@ configure_project() [ "$XBMK_RELEASE" = "y" ] && [ "$release" = "n" ] && return 1 [ -z "$btype" ] || [ "${mode%config}" = "$mode" ] || return 1 - if [ -z "$mode" ]; then - for bd in $build_depend; do - bd_p="${bd%%/*}"; bd_t="${bd##*/}" - [ -z "$bd_p" ] && $dry $err "$project/$tree: !bd '$bd'" - [ "${bd##*/}" = "$bd" ] && bd_t="" - [ -z "$bd_p" ] || $dry ./update trees -b $bd_p $bd_t \ - || $err "!mk $project/$tree $bd_p/$bd_t" - done - fi + [ -z "$mode" ] && build_dependencies [ "$mode" = "fetch" ] || x_ ./update trees -f "$project" $target [ "$mode" = "fetch" ] || return 0 [ -f "CHANGELOG" ] && return 1; fetch_${cmd#build_}; return 1 } +build_dependencies() +{ + for bd in $build_depend; do + bd_p="${bd%%/*}"; bd_t="${bd##*/}" + [ -z "$bd_p" ] && $dry $err "$project/$tree: !bd '$bd'" + [ "${bd##*/}" = "$bd" ] && bd_t="" + [ -z "$bd_p" ] || $dry ./update trees -b $bd_p $bd_t \ + || $err "!mk $project/$tree $bd_p/$bd_t"; continue + done; return 0 +} + check_cross_compiler() { for _xarch in $xarch; do -- cgit v1.2.1