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>
This commit is contained in:
Leah Rowe
2025-04-26 19:19:36 +01:00
parent 703fe44431
commit 1de77c6558
2 changed files with 9 additions and 9 deletions
+9
View File
@@ -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 \
-9
View File
@@ -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()