summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-07-11 11:56:36 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2016-07-11 13:27:35 -0700
commit86b1b289065a0dd37a20ebc35ff5bd2b7dfa5662 (patch)
tree9fa4679736e2162dd45cc001dd8de91a21b8b5f8
parent255d05a9c123a6632c0ab496f2bde31a2917fdf4 (diff)
downloadspack-86b1b289065a0dd37a20ebc35ff5bd2b7dfa5662.tar.gz
spack-86b1b289065a0dd37a20ebc35ff5bd2b7dfa5662.tar.bz2
spack-86b1b289065a0dd37a20ebc35ff5bd2b7dfa5662.tar.xz
spack-86b1b289065a0dd37a20ebc35ff5bd2b7dfa5662.zip
Add `submodules` option for git fetching.
-rw-r--r--lib/spack/spack/fetch_strategy.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py
index 38133ee0ca..bcb33bd0e6 100644
--- a/lib/spack/spack/fetch_strategy.py
+++ b/lib/spack/spack/fetch_strategy.py
@@ -366,8 +366,8 @@ class CacheURLFetchStrategy(URLFetchStrategy):
try:
self.check()
except ChecksumError:
- # Future fetchers will assume they don't need to download if the
- # file remains
+ # Future fetchers will assume they don't need to
+ # download if the file remains
os.remove(self.archive_file)
raise
@@ -517,6 +517,7 @@ class GitFetchStrategy(VCSFetchStrategy):
super(GitFetchStrategy, self).__init__(
'git', 'tag', 'branch', 'commit', **forwarded_args)
self._git = None
+ self.submodules = kwargs.get('submodules', False)
@property
def git_version(self):
@@ -595,6 +596,10 @@ class GitFetchStrategy(VCSFetchStrategy):
self.git('pull', '--tags', ignore_errors=1)
self.git('checkout', self.tag)
+ # Init submodules if the user asked for them.
+ if self.submodules:
+ self.git('submodule', 'update', '--init')
+
def archive(self, destination):
super(GitFetchStrategy, self).archive(destination, exclude='.git')