diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2016-03-29 05:11:21 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2016-03-29 05:11:21 -0700 |
commit | a05bea7de5f9f196ffd5179b6df327c3e5ceb9d8 (patch) | |
tree | 2c6c695830c6b6d0cca0fb2f6dd95a826f82023c | |
parent | 275943d8df782c45ba6fc849852c2eb2009da4bd (diff) | |
parent | dfc5cf288c1017ef62390489cb534848aef5a9a6 (diff) | |
download | spack-a05bea7de5f9f196ffd5179b6df327c3e5ceb9d8.tar.gz spack-a05bea7de5f9f196ffd5179b6df327c3e5ceb9d8.tar.bz2 spack-a05bea7de5f9f196ffd5179b6df327c3e5ceb9d8.tar.xz spack-a05bea7de5f9f196ffd5179b6df327c3e5ceb9d8.zip |
Merge pull request #681 from LLNL/bugfix/complete-restage
Fix bug in restage
-rw-r--r-- | lib/spack/spack/fetch_strategy.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index 0d0a7db8a9..4ea87bea7e 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -289,8 +289,14 @@ class URLFetchStrategy(FetchStrategy): if not self.archive_file: raise NoArchiveFileError("Tried to reset URLFetchStrategy before fetching", "Failed on reset() for URL %s" % self.url) - if self.stage.source_path: - shutil.rmtree(self.stage.source_path, ignore_errors=True) + + # Remove everythigng but the archive from the stage + for filename in os.listdir(self.stage.path): + abspath = os.path.join(self.stage.path, filename) + if abspath != self.archive_file: + shutil.rmtree(abspath, ignore_errors=True) + + # Expand the archive again self.expand() def __repr__(self): |