summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/mirror.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/spack/spack/mirror.py b/lib/spack/spack/mirror.py
index c929a092b4..78db22f73b 100644
--- a/lib/spack/spack/mirror.py
+++ b/lib/spack/spack/mirror.py
@@ -62,11 +62,11 @@ def mirror_archive_filename(spec, fetcher):
ext = 'tar.gz'
tokens = [spec.package.name, spec.version]
- package = spack.repo.get(spec)
- digests = package.digests
+ digests = spec.package.digests
if digests:
- if 'md5' in digests:
- tokens.extend(['md5', digests['md5']])
+ # If a package has multiple digests, any one is sufficient to identify it
+ digestType, digest = digests.iteritems().next()
+ tokens.extend([digestType, digest])
filename = '-'.join(str(t) for t in tokens)
if ext:
filename += ".%s" % ext