lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 330ca8f: Cache any not-yet-cached submodule r


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 330ca8f: Cache any not-yet-cached submodule repositories
Date: Fri, 13 Apr 2018 20:00:48 -0400 (EDT)

branch: master
commit 330ca8f6f71476dc9a02d00cbcaa5c053f5c9035
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Cache any not-yet-cached submodule repositories
---
 install_wx.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/install_wx.sh b/install_wx.sh
index fe518ef..257c10c 100755
--- a/install_wx.sh
+++ b/install_wx.sh
@@ -41,13 +41,6 @@ mkdir --parents "$cache_dir"
 if git ls-remote "$cache_dir"/"$wx_repository" >/dev/null
 then
     default_url="$cache_dir"/"$wx_repository"
-    # Now we could make a list of submodules...
-    cd "$default_url"
-    git show master:.gitmodules |sed -e'/\.git$/!d' -e's!.*\/!!'
-    # ...and download any that are missing to local cache, but
-    # that seems awfully fancy. Instead, we'll let the code that
-    # follows download them to our clone, and if we're mindful,
-    # we'll move them from there to the cache.
 fi
 
 # Configurable settings 
########################################################
@@ -95,6 +88,13 @@ git submodule status | grep '^-' | cut -d' ' -f2 | while 
read -r subpath
 do
     suburl=$(git config --file .gitmodules --get submodule.${subpath}.url)
 
+    # If the submodule hasn't been cached yet, clone it to cache now.
+    cache_url="$cache_dir"/${suburl##*/}
+    if ! git ls-remote "$cache_url" >/dev/null
+    then
+        git clone --bare "$suburl" "$cache_url"
+    fi
+
     # Configure the submodule to use URL relative to the one used for the
     # super-repository itself: this doesn't change anything when using the
     # canonical wxWidgets GitHub URL, but allows to download submodules



reply via email to

[Prev in Thread] Current Thread [Next in Thread]