summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-10-05 03:52:50 +0100
committerLeah Rowe <leah@libreboot.org>2024-10-05 03:52:50 +0100
commit44473d6832dd827d9301ba50bbeb35a43a1c474c (patch)
tree2ff4b1cad8d02400dc266000cac86d1d6f3ed5b8
parentc3ef0a863912af184c4a49e4876c7845ba3100aa (diff)
git.sh: fix error with cache re-download
in some cases, on a fresh clone, the cached repo already exists but lbmk tries to download it again. work around this by checking that the directory exists; it's in the main if statement, so that the "else" still applies. as a result, the fallback to a live repo would un-fall back to doing git-pull if the cached directory exists exists. if it doesn't seem to make sense, it's because it doesn't. this whole function needs to be rewritten better. Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--include/git.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/git.sh b/include/git.sh
index 0c2f7acc..2c43cd22 100644
--- a/include/git.sh
+++ b/include/git.sh
@@ -103,9 +103,9 @@ tmpclone()
repodir="$XBMK_CACHE/repo/${1##*/}" && [ $# -gt 5 ] && repodir="$3"
mkdir -p "$XBMK_CACHE/repo" || $err "!rmdir $XBMK_CACHE/repo"
- if [ "$livepull" = "y" ]; then
+ if [ "$livepull" = "y" ] && [ ! -d "$repodir" ]; then
git clone $1 "$repodir" || git clone $2 "$repodir" || \
- $err "!clone $1 $2 $repodir $4 $5"
+ $err "!clone $1 $2 $repodir $4 $5" #
elif [ -d "$repodir" ] && [ $# -lt 6 ]; then
git -C "$repodir" pull || sleep 3 || git -C "$repodir" pull \
|| sleep 3 || git -C "$repodir" pull || :