diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/fetch_strategy.py | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index eadcef85f3..d510db568f 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -597,25 +597,33 @@ class GitFetchStrategy(VCSFetchStrategy): tty.msg("Already fetched %s" % self.stage.source_path) return - args = [] + args = '' if self.commit: - args.append('at commit %s' % self.commit) + args = 'at commit %s' % self.commit elif self.tag: - args.append('at tag %s' % self.tag) + args = 'at tag %s' % self.tag elif self.branch: - args.append('on branch %s' % self.branch) - tty.msg("Trying to clone git repository:", self.url, *args) + args = 'on branch %s' % self.branch + tty.msg("Trying to clone git repository: %s %s" % (self.url, args)) if self.commit: # Need to do a regular clone and check out everything if # they asked for a particular commit. - self.git('clone', self.url) + if spack.debug: + self.git('clone', self.url) + else: + self.git('clone', '--quiet', self.url) self.stage.chdir_to_source() - self.git('checkout', self.commit) + if spack.debug: + self.git('checkout', self.commit) + else: + self.git('checkout', '--quiet', self.commit) else: # Can be more efficient if not checking out a specific commit. args = ['clone'] + if not spack.debug: + args.append('--quiet') # If we want a particular branch ask for it. if self.branch: @@ -652,12 +660,19 @@ class GitFetchStrategy(VCSFetchStrategy): # pull --tags returns a "special" error code of 1 in # older versions that we have to ignore. # see: https://github.com/git/git/commit/19d122b - self.git('pull', '--tags', ignore_errors=1) - self.git('checkout', self.tag) + if spack.debug: + self.git('pull', '--tags', ignore_errors=1) + self.git('checkout', self.tag) + else: + self.git('pull', '--quiet', '--tags', ignore_errors=1) + self.git('checkout', '--quiet', self.tag) # Init submodules if the user asked for them. if self.submodules: - self.git('submodule', 'update', '--init') + if spack.debug: + self.git('submodule', 'update', '--init') + else: + self.git('submodule', '--quiet', 'update', '--init') def archive(self, destination): super(GitFetchStrategy, self).archive(destination, exclude='.git') @@ -665,8 +680,12 @@ class GitFetchStrategy(VCSFetchStrategy): @_needs_stage def reset(self): self.stage.chdir_to_source() - self.git('checkout', '.') - self.git('clean', '-f') + if spack.debug: + self.git('checkout', '.') + self.git('clean', '-f') + else: + self.git('checkout', '--quiet', '.') + self.git('clean', '--quiet', '-f') def __str__(self): return "[git] %s" % self.url |