summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-10-17 22:40:29 +0100
committerLeah Rowe <leah@libreboot.org>2025-10-17 22:40:29 +0100
commit25f523bbacb4374337f443f0ffd9b458aa328c50 (patch)
treeeaccef00649102f4f2d4258c49330982462dcfb4
parentbec7e6d4cbbb47afb26980056d8f46fc8e4f992c (diff)
get.sh: return clone_project if multi-treeHEADmaster
this is the true fix, replacing the fixes previously reverted. the problem with the old fix was that it was a hack, and could result in the archived backup of a code repo being the wrong one; the destination was the one for the main repo, but what if we were cloning the backup? Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--include/get.sh20
1 files changed, 5 insertions, 15 deletions
diff --git a/include/get.sh b/include/get.sh
index e3e4c311..9ab6956d 100644
--- a/include/get.sh
+++ b/include/get.sh
@@ -53,14 +53,13 @@ fetch_project()
clone_project()
{
- # if loc is blank, don't create a target
- # directory; just update the caches
- loc=""
if singletree "$project"; then
loc="src/$project"
- fi
- if e "$loc" d missing; then
+ if [ -d "$loc" ]; then
+ return 0
+ fi
+
remkdir "${tmpgit%/*}"
git_prep "$url" "$bkup_url" \
"$xbmkpwd/config/$project/patches" "$loc"
@@ -87,16 +86,7 @@ git_prep()
x_ xbmkdir "${_loc%/*}"
fi
- if [ -z "$_loc" ]; then
- # we only used git_prep to update caches, on
- # a multi-tree project. tmpgit is useless now.
-
- x_ rm -Rf "$tmpgit"
- else
- # actual downloaded
-
- x_ mv "$tmpgit" "$_loc"
- fi
+ x_ mv "$tmpgit" "$_loc"
}
fetch_submodule()