From 2b50b3ea9a11b6ba2751ebb4237f0ea7288e5c81 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 19 Jul 2024 00:31:57 +0100 Subject: 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 --- include/git.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'include/git.sh') diff --git a/include/git.sh b/include/git.sh index 3a6247d0..f8441f33 100644 --- a/include/git.sh +++ b/include/git.sh @@ -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 || : -- cgit v1.2.1