summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-04-26 19:19:36 +0100
committerLeah Rowe <leah@libreboot.org>2025-04-26 19:19:36 +0100
commit1de77c6558c915723ccb40529357916f2aafbace (patch)
tree4bfa13c64bd360a5160f7cd8e83469f3bd616b23
parent703fe444312ad9087cddd322c00d15e5a2c9700f (diff)
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 <leah@libreboot.org>
-rw-r--r--include/git.sh9
-rw-r--r--include/lib.sh9
2 files changed, 9 insertions, 9 deletions
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 \
diff --git a/include/lib.sh b/include/lib.sh
index dea015e0..f7d3e3b0 100644
--- a/include/lib.sh
+++ b/include/lib.sh
@@ -42,15 +42,6 @@ rmgit()
) || $err "Cannot remove .git/.gitmodules in $1"
}
-# 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; :
-}
-
# can grab from the internet, or copy locally.
# if copying locally, it can only copy a file.
xbmkget()