Bug Fix: When Spack create roots around for other versions, it sometimes finds files it thinks are tarballs, but are not. Previously, it would crash if any such files are found. This change allows it to simply skip them and move on, processing the rest of the files it finds correctly.
This commit is contained in:
parent
21181075b4
commit
a339ac0a72
1 changed files with 9 additions and 4 deletions
|
@ -58,24 +58,29 @@ def get_checksums(versions, urls, **kwargs):
|
||||||
|
|
||||||
tty.msg("Downloading...")
|
tty.msg("Downloading...")
|
||||||
hashes = []
|
hashes = []
|
||||||
for i, (url, version) in enumerate(zip(urls, versions)):
|
i = 0
|
||||||
|
for url, version in zip(urls, versions):
|
||||||
stage = Stage(url)
|
stage = Stage(url)
|
||||||
try:
|
try:
|
||||||
stage.fetch()
|
stage.fetch()
|
||||||
if i == 0 and first_stage_function:
|
if i == 0 and first_stage_function:
|
||||||
first_stage_function(stage)
|
first_stage_function(stage)
|
||||||
|
|
||||||
hashes.append(
|
hashes.append((version,
|
||||||
spack.util.crypto.checksum(hashlib.md5, stage.archive_file))
|
spack.util.crypto.checksum(hashlib.md5, stage.archive_file)))
|
||||||
except FailedDownloadError, e:
|
except FailedDownloadError, e:
|
||||||
tty.msg("Failed to fetch %s" % url)
|
tty.msg("Failed to fetch %s" % url)
|
||||||
continue
|
continue
|
||||||
|
except Exception, e:
|
||||||
|
tty.msg('Something failed on %s, skipping.\n (%s)' % (url, e))
|
||||||
|
continue
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
if not keep_stage:
|
if not keep_stage:
|
||||||
stage.destroy()
|
stage.destroy()
|
||||||
|
i += 1
|
||||||
|
|
||||||
return zip(versions, hashes)
|
return hashes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue