summaryrefslogtreecommitdiff
path: root/include/lib.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-06-06 01:01:22 +0100
committerLeah Rowe <leah@libreboot.org>2024-06-06 01:01:22 +0100
commitbea089bbe4a720e39ba78850f015c67dbe3d1a43 (patch)
treeef02631630323db158f449d07d7865d2621ec465 /include/lib.sh
parent6e1b8087c5133b4f9a384df6ea7de3250ea8e573 (diff)
don't use build.list to detect multi-tree projects
instead, check for the presence of target.cfg files not in config/project/ but config/project/tree/ the way this check is done, it merely returns 1 if config/project/*/target.cfg is detected, and returns 0 in all other cases, even if config/project/target.cfg exists that way, if the maintainer accidentally adds a target.cfg in the main directory, the given multi-tree project will not break Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/lib.sh')
-rwxr-xr-xinclude/lib.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/lib.sh b/include/lib.sh
index 6a4be7ee..bc2232ad 100755
--- a/include/lib.sh
+++ b/include/lib.sh
@@ -228,3 +228,13 @@ e()
eval "$estr"
printf "%s %s\n" "$1" "$es2" 1>&2
}
+
+# return 0 if project is single-tree, otherwise 1
+# e.g. coreboot is multi-tree, so 1
+singletree()
+{
+ for pdir in "config/${1}/"*/target.cfg; do
+ [ ! -e "$pdir" ] && continue
+ [ -f "$pdir" ] && return 1
+ done
+}