From e1e04aa80d2f80ef9e79fbe499c8a03f351943d4 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 27 Jun 2024 16:38:49 +0100 Subject: trees: err if target.cfg not given if multi-tree it was always by design that an error should occur, if a target.cfg file does not exist on multi-tree projects, but we previously did not support target.cfg files on single-tree projects. single-tree target.cfg support was later added, and it was done by making target.cfg optional there, but i accidentally made it optional on multi-tree projects. in practise, all multi-tree projects included target.cfg, but this was not being enforced in code. this patch should fix the issue. Signed-off-by: Leah Rowe --- script/trees | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'script/trees') diff --git a/script/trees b/script/trees index 85fe4a26..50171608 100755 --- a/script/trees +++ b/script/trees @@ -63,7 +63,7 @@ build_projects() fetch_project_repo; return 0 fi - load_project_config "$cfgsdir" || return 0 + load_project_config "$cfgsdir" 0 || return 0 [ -f "$listfile" ] || listfile="" # optional on single-tree dest_dir="$elfdir" @@ -155,7 +155,12 @@ load_project_config() eval `setvars "" xarch xlang tree bootstrapargs autoconfargs xtree \ tree_depend makeargs btype` [ -f "$1/target.cfg" ] || btype="auto" - eval `setcfg "$1/target.cfg" 0` + + # target.cfg optional on single-tree so return if missing. + # target.cfg mandatory on multi-tree so err if missing. + _setcfgarg="" && [ $# -gt 1 ] && _setcfgarg="$2" + eval `setcfg "$1/target.cfg" $_setcfgarg` + [ -z "$btype" ] || [ "${mode%config}" = "$mode" ] || \ return 1; return 0 } -- cgit v1.2.1