gitCloneAll: make "git cclone" optional 73/28273/1
authorPatrick Ohly <patrick.ohly@intel.com>
Wed, 1 Oct 2014 07:11:20 +0000 (09:11 +0200)
committerPatrick Ohly <patrick.ohly@intel.com>
Wed, 1 Oct 2014 08:11:22 +0000 (10:11 +0200)
The dependency on "git cclone" was not documented. Not everyone needs
it, so only use it if available and fall back to "git clone"
otherwise.

Change-Id: Ifc3fd18d253d4e4c385e9854ba04c8d6d83acb38
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
merge: cclone

Change-Id: I060a73e1ae5b911b665abb598f578562e65bfc52

tools/gitCloneAll.sh

index 9b7f01d..f0899a0 100755 (executable)
@@ -28,7 +28,16 @@ cd ${PROTODIR}
 mkdir -p git_package
 mkdir -p specfile-initial
 
-GIT_CLONE="git cclone"
+# Choose "git cclone" (https://github.com/kooltux/git-cache) if
+# available, otherwise "git clone". Can be overriden by setting
+# GIT_CLONE env variable.
+if [ ! "$GIT_CLONE" ]; then
+    if git help -a | grep -q -w cclone; then
+        GIT_CLONE="git cclone"
+    else
+        GIT_CLONE="git clone"
+    fi
+fi
 
 cd git_package