[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 1dceecb 2/2: Clone wx repository into cache i
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 1dceecb 2/2: Clone wx repository into cache if not yet cached |
Date: |
Sat, 14 Apr 2018 18:26:48 -0400 (EDT) |
branch: master
commit 1dceecb085cbc09d10c7534cd12c0d8fcad63287
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Clone wx repository into cache if not yet cached
The newly-added code doesn't interact smoothly with the configurable
settings that follow it, because this commit deliberately changes the
essential logic of the script. Formerly, it cloned a local repository
from github by default, or from an alternative location (such as cache)
if available. Now, it ensures that a repository exists in the cache,
and clones a local repository from cache. Thus, git repositories are
treated the same as downloaded files:
- if missing from cache, fetch from the internet into cache
- always obtain only from cache for local use
IOW, the cache directory functions as a proxy.
In particular, $default_url is now unconditionally set, so there's no
point in overriding $wx_git_url. We need to determine exactly what part
of $wx_git_url needs to be configurable.
---
install_wx.sh | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/install_wx.sh b/install_wx.sh
index 01da99e..c5fbf36 100755
--- a/install_wx.sh
+++ b/install_wx.sh
@@ -38,11 +38,15 @@ default_url="$default_server"/"$wx_repository"
cache_dir="/cache_for_lmi/vcs"
mkdir --parents "$cache_dir"
-if git ls-remote "$cache_dir"/"$wx_repository" >/dev/null
+cache_wx_url="$cache_dir"/"$wx_repository"
+
+if ! git ls-remote "$cache_wx_url" >/dev/null
then
- default_url="$cache_dir"/"$wx_repository"
+ git clone --bare "$default_url" "$cache_wx_url"
fi
+default_url="$cache_wx_url"
+
# Configurable settings
########################################################
wx_git_url=${wx_git_url:-"$default_url"}