From ad1602569ebf1404c47fb8ea4b39d0f8e844b840 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 21 Jun 2024 03:05:00 +0100 Subject: trees: more robust check to avoid "make fetch" do not use shorthand here. the test was failing to produce the desired result under some circumstances, for example when i did "./update release" i got this: make: Entering directory '/home/lbdev/lbmk/release/20240612-62-ga6b1a6bd/libreboot-20240612-62-ga6b1a6bd_src/src/stm32-vserprog' make: *** No rule to make target 'fetch'. Stop. make: Leaving directory '/home/lbdev/lbmk/release/20240612-62-ga6b1a6bd/libreboot-20240612-62-ga6b1a6bd_src/src/stm32-vserprog' ERROR script/trees: !mk src/stm32-vserprog fetch ERROR ./update: excmd: script/trees -f ERROR script/roms: Unhandled non-zero exit: ./update ERROR ./build: excmd: script/roms serprog ERROR ./update: build_release release/20240612-62-ga6b1a6bd: stm32 ERROR ./update: can't build rom images in the above circumstance, run_make_command was executed, which is not the desired behaviour; rather, fetch_project_trees or fetch_project_repo should be called, and then the script should immediately exit. it should also exit, without downloading anything, if a changelog file exists as in release archives. Signed-off-by: Leah Rowe --- script/trees | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/script/trees b/script/trees index 78ffaed8..b2b1e561 100755 --- a/script/trees +++ b/script/trees @@ -58,8 +58,10 @@ build_projects() { [ $# -gt 0 ] && x_ ./update trees $_f $@ - [ "$mode" = "fetch" ] && [ ! -f "CHANGELOG" ] && \ - eval "fetch_project_repo; return 0;" + if [ "$mode" = "fetch" ]; then + [ -f "CHANGELOG" ] && return 0 + fetch_project_repo; return 0 + fi load_project_config "$cfgsdir" [ -f "$listfile" ] || listfile="" # optional on single-tree @@ -124,8 +126,10 @@ handle_defconfig() handle_src_tree() { target_dir="$cfgsdir/$target" - [ "$mode" = "fetch" ] && [ ! -f "CHANGELOG" ] && \ - eval "fetch_project_trees; return 1;" + if [ "$mode" = "fetch" ]; then + [ -f "CHANGELOG" ] && return 1 + fetch_project_trees; return 1 + fi load_project_config "$target_dir" x_ mkdir -p "$elfdir/$target" -- cgit v1.2.1