mirror archive filename now includes the digest type as well as the digest
This commit is contained in:
parent
06c98320a8
commit
bee224c567
@ -107,8 +107,6 @@ def reset(self): pass # Revert to freshly downloaded state.
|
|||||||
|
|
||||||
def archive(self, destination): pass # Used to create tarball for mirror.
|
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.
|
def __str__(self): # Should be human readable URL.
|
||||||
return "FetchStrategy.__str___"
|
return "FetchStrategy.__str___"
|
||||||
|
|
||||||
@ -219,10 +217,6 @@ def archive_file(self):
|
|||||||
"""Path to the source archive within this stage directory."""
|
"""Path to the source archive within this stage directory."""
|
||||||
return self.stage.archive_file
|
return self.stage.archive_file
|
||||||
|
|
||||||
@property
|
|
||||||
def file_hash(self):
|
|
||||||
return self.digest
|
|
||||||
|
|
||||||
@_needs_stage
|
@_needs_stage
|
||||||
def expand(self):
|
def expand(self):
|
||||||
if not self.expand_archive:
|
if not self.expand_archive:
|
||||||
@ -355,10 +349,6 @@ def archive(self, destination, **kwargs):
|
|||||||
self.stage.chdir()
|
self.stage.chdir()
|
||||||
tar('-czf', destination, os.path.basename(self.stage.source_path))
|
tar('-czf', destination, os.path.basename(self.stage.source_path))
|
||||||
|
|
||||||
@property
|
|
||||||
def file_hash(self):
|
|
||||||
return None
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "VCS: %s" % self.url
|
return "VCS: %s" % self.url
|
||||||
|
|
||||||
|
@ -62,8 +62,11 @@ def mirror_archive_filename(spec, fetcher):
|
|||||||
ext = 'tar.gz'
|
ext = 'tar.gz'
|
||||||
|
|
||||||
tokens = [spec.package.name, spec.version]
|
tokens = [spec.package.name, spec.version]
|
||||||
if fetcher.file_hash:
|
package = spack.repo.get(spec)
|
||||||
tokens.append(fetcher.file_hash)
|
digests = package.digests
|
||||||
|
if digests:
|
||||||
|
if 'md5' in digests:
|
||||||
|
tokens.extend(['md5', digests['md5']])
|
||||||
filename = '-'.join(str(t) for t in tokens)
|
filename = '-'.join(str(t) for t in tokens)
|
||||||
if ext:
|
if ext:
|
||||||
filename += ".%s" % ext
|
filename += ".%s" % ext
|
||||||
|
@ -397,6 +397,13 @@ def version(self):
|
|||||||
raise ValueError("Can only get of package with concrete version.")
|
raise ValueError("Can only get of package with concrete version.")
|
||||||
return self.spec.versions[0]
|
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
|
@memoized
|
||||||
def version_urls(self):
|
def version_urls(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user