summaryrefslogtreecommitdiffstats
path: root/pkgs/build-support/fetchgit/nix-prefetch-git
diff options
context:
space:
mode:
authorambrop7@gmail.com <Ambroz Bizjak>2014-03-23 17:19:39 +0100
committerambrop7@gmail.com <Ambroz Bizjak>2014-03-25 20:03:55 +0100
commit3a765a7309504957961363960eb03b3e4fb9d680 (patch)
tree1da6f4fa00939834f37b2df089879cbf69a90b26 /pkgs/build-support/fetchgit/nix-prefetch-git
parentae8a8b5deb305e2e8884d9f34a91a7ab28b62b1b (diff)
fetchgit: Implement option to not check out submodules.
Diffstat (limited to 'pkgs/build-support/fetchgit/nix-prefetch-git')
-rwxr-xr-xpkgs/build-support/fetchgit/nix-prefetch-git7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git
index 8d0de055c756..6e79f82eae86 100755
--- a/pkgs/build-support/fetchgit/nix-prefetch-git
+++ b/pkgs/build-support/fetchgit/nix-prefetch-git
@@ -6,6 +6,7 @@ expHash=
hashType=$NIX_HASH_ALGO
deepClone=$NIX_PREFETCH_GIT_DEEP_CLONE
leaveDotGit=$NIX_PREFETCH_GIT_LEAVE_DOT_GIT
+fetchSubmodules=
builder=
if test -n "$deepClone"; then
@@ -33,6 +34,7 @@ for arg; do
--deepClone) deepClone=true;;
--no-deepClone) deepClone=false;;
--leave-dotGit) leaveDotGit=true;;
+ --fetch-submodules) fetchSubmodules=true;;
--builder) builder=true;;
*)
argi=$(($argi + 1))
@@ -66,6 +68,7 @@ Options:
--deepClone Clone submodules recursively.
--no-deepClone Do not clone submodules.
--leave-dotGit Keep the .git directories.
+ --fetch-submodules Fetch submodules.
--builder Clone as fetchgit does, but url, rev, and out option are mandatory.
"
exit 1
@@ -178,7 +181,9 @@ clone(){
)
# Checkout linked sources.
- init_submodules;
+ if test -n "$fetchSubmodules"; then
+ init_submodules;
+ fi
if [ -z "$builder" -a -f .topdeps ]; then
if tg help 2>&1 > /dev/null