From 1de77c6558c915723ccb40529357916f2aafbace Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 26 Apr 2025 19:19:36 +0100 Subject: lib.sh: move singletree() to git.sh it is primarily used there, and then in mk, but only after git.sh is sourced. Signed-off-by: Leah Rowe --- include/git.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/git.sh') diff --git a/include/git.sh b/include/git.sh index 272a1af3..9be79527 100644 --- a/include/git.sh +++ b/include/git.sh @@ -66,6 +66,15 @@ git_prep() mv "$tmpgit" "$_loc" || $err "git_prep: !mv $tmpgit $_loc" } +# return 0 if project is single-tree, otherwise 1 +# e.g. coreboot is multi-tree, so 1 +singletree() +{ + for targetfile in "config/${1}/"*/target.cfg; do + [ -e "$targetfile" ] && [ -f "$targetfile" ] && return 1; : + done; : +} + fetch_submodule() { mcfgdir="$mdir/${1##*/}"; eval \ -- cgit v1.2.1