mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-03-25 13:29:03 +02:00
get.sh: return clone_project if multi-tree
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>
This commit is contained in:
@@ -53,14 +53,13 @@ fetch_project()
|
|||||||
|
|
||||||
clone_project()
|
clone_project()
|
||||||
{
|
{
|
||||||
# if loc is blank, don't create a target
|
|
||||||
# directory; just update the caches
|
|
||||||
loc=""
|
|
||||||
if singletree "$project"; then
|
if singletree "$project"; then
|
||||||
loc="src/$project"
|
loc="src/$project"
|
||||||
fi
|
|
||||||
|
|
||||||
if e "$loc" d missing; then
|
if [ -d "$loc" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
remkdir "${tmpgit%/*}"
|
remkdir "${tmpgit%/*}"
|
||||||
git_prep "$url" "$bkup_url" \
|
git_prep "$url" "$bkup_url" \
|
||||||
"$xbmkpwd/config/$project/patches" "$loc"
|
"$xbmkpwd/config/$project/patches" "$loc"
|
||||||
@@ -87,16 +86,7 @@ git_prep()
|
|||||||
x_ xbmkdir "${_loc%/*}"
|
x_ xbmkdir "${_loc%/*}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$_loc" ]; then
|
x_ mv "$tmpgit" "$_loc"
|
||||||
# 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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch_submodule()
|
fetch_submodule()
|
||||||
|
|||||||
Reference in New Issue
Block a user