mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
put cachedir in environmental variable
XBMK_CACHE is now used, instead of hardcoding cache/ this is exported initialised to cache/, if unset. this means you can set your own directory, and it means ./update release will use the same directory. this means bandwidth wastage is further avoided. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+6
-5
@@ -37,7 +37,7 @@ fetch_project()
|
||||
|
||||
clone_project()
|
||||
{
|
||||
loc="cache/repo/$project" && singletree "$project" && \
|
||||
loc="$XBMK_CACHE/repo/$project" && singletree "$project" && \
|
||||
loc="src/$project"
|
||||
|
||||
printf "Downloading project '%s' to '%s'\n" "$project" "$loc"
|
||||
@@ -62,8 +62,9 @@ git_prep()
|
||||
[ "$project" = "coreboot" ] && [ -n "$xtree" ] && [ $# -gt 2 ] && \
|
||||
[ "$xtree" != "$tree" ] && link_crossgcc "$_loc"
|
||||
|
||||
[ "$XBMK_RELEASE" = "y" ] && [ "$_loc" != "cache/repo/$project" ] \
|
||||
&& rmgit "$tmpgit"
|
||||
[ "$XBMK_RELEASE" = "y" ] && \
|
||||
[ "$_loc" != "$XBMK_CACHE/repo/$project" ] && \
|
||||
rmgit "$tmpgit"
|
||||
|
||||
move_repo "$_loc"
|
||||
}
|
||||
@@ -106,8 +107,8 @@ tmpclone()
|
||||
repofail="n"
|
||||
|
||||
[ $# -lt 6 ] || rm -Rf "$3" || $err "git retry: !rm $3 ($1)"
|
||||
repodir="cache/repo/${1##*/}" && [ $# -gt 5 ] && repodir="$3"
|
||||
x_ mkdir -p "cache/repo"
|
||||
repodir="$XBMK_CACHE/repo/${1##*/}" && [ $# -gt 5 ] && repodir="$3"
|
||||
mkdir -p "$XBMK_CACHE/repo" || $err "!rmdir $XBMK_CACHE/repo"
|
||||
if [ -d "$repodir" ] && [ $# -lt 6 ]; then
|
||||
git -C "$repodir" pull || sleep 3 || git -C "$repodir" pull \
|
||||
|| sleep 3 || git -C "$repodir" pull || :
|
||||
|
||||
Reference in New Issue
Block a user