summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPeter Scheibel <scheibel1@llnl.gov>2016-03-29 18:25:22 -0700
committerPeter Scheibel <scheibel1@llnl.gov>2016-03-29 18:25:22 -0700
commitbee224c567ee735547bb183cd6a1d6e04309c81a (patch)
tree70e7448707c946be831eb41dad244a2dad34fdf6 /lib
parent06c98320a88924234a86b038ca7d3a60a8361f8c (diff)
downloadspack-bee224c567ee735547bb183cd6a1d6e04309c81a.tar.gz
spack-bee224c567ee735547bb183cd6a1d6e04309c81a.tar.bz2
spack-bee224c567ee735547bb183cd6a1d6e04309c81a.tar.xz
spack-bee224c567ee735547bb183cd6a1d6e04309c81a.zip
mirror archive filename now includes the digest type as well as the digest
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/fetch_strategy.py10
-rw-r--r--lib/spack/spack/mirror.py7
-rw-r--r--lib/spack/spack/package.py7
3 files changed, 12 insertions, 12 deletions
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py
index 9938f011d0..b696a12e7a 100644
--- a/lib/spack/spack/fetch_strategy.py
+++ b/lib/spack/spack/fetch_strategy.py
@@ -107,8 +107,6 @@ class FetchStrategy(object):
def archive(self, destination): pass # Used to create tarball for mirror.
- def file_hash(self): pass # Identifies the resource to be retrieved
-
def __str__(self): # Should be human readable URL.
return "FetchStrategy.__str___"
@@ -219,10 +217,6 @@ class URLFetchStrategy(FetchStrategy):
"""Path to the source archive within this stage directory."""
return self.stage.archive_file
- @property
- def file_hash(self):
- return self.digest
-
@_needs_stage
def expand(self):
if not self.expand_archive:
@@ -355,10 +349,6 @@ class VCSFetchStrategy(FetchStrategy):
self.stage.chdir()
tar('-czf', destination, os.path.basename(self.stage.source_path))
- @property
- def file_hash(self):
- return None
-
def __str__(self):
return "VCS: %s" % self.url
diff --git a/lib/spack/spack/mirror.py b/lib/spack/spack/mirror.py
index cb2588fb29..c929a092b4 100644
--- a/lib/spack/spack/mirror.py
+++ b/lib/spack/spack/mirror.py
@@ -62,8 +62,11 @@ def mirror_archive_filename(spec, fetcher):
ext = 'tar.gz'
tokens = [spec.package.name, spec.version]
- if fetcher.file_hash:
- tokens.append(fetcher.file_hash)
+ package = spack.repo.get(spec)
+ digests = package.digests
+ if digests:
+ if 'md5' in digests:
+ tokens.extend(['md5', digests['md5']])
filename = '-'.join(str(t) for t in tokens)
if ext:
filename += ".%s" % ext
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index d007f37aeb..2feea51fa5 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -397,6 +397,13 @@ class Package(object):
raise ValueError("Can only get of package with concrete version.")
return self.spec.versions[0]
+ @property
+ def digests(self):
+ versionInfo = self.versions[self.version]
+ digests = {}
+ if 'md5' in versionInfo:
+ digests['md5'] = versionInfo['md5']
+ return digests
@memoized
def version_urls(self):