summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-06-21 03:05:00 +0100
committerLeah Rowe <leah@libreboot.org>2024-06-21 03:10:46 +0100
commitad1602569ebf1404c47fb8ea4b39d0f8e844b840 (patch)
treef4c7f1350105c7f3cd39082bf439dce31563b11e
parenta6b1a6bddb59fcab84ac0fa3936208f869a0e3ce (diff)
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 <leah@libreboot.org>
-rwxr-xr-xscript/trees12
1 files 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"