diff options
author | Elizabeth F <rpf2116@columbia.edu> | 2016-02-29 22:29:30 -0500 |
---|---|---|
committer | Elizabeth F <rpf2116@columbia.edu> | 2016-02-29 23:04:11 -0500 |
commit | a339ac0a727458ab55b2e0d27ff17dcc139c0a32 (patch) | |
tree | d161e0528f79f054535d3740e29545f5d809f64e /lib | |
parent | 21181075b40367b3fa9891c51930c7aedcfab4bf (diff) | |
download | spack-a339ac0a727458ab55b2e0d27ff17dcc139c0a32.tar.gz spack-a339ac0a727458ab55b2e0d27ff17dcc139c0a32.tar.bz2 spack-a339ac0a727458ab55b2e0d27ff17dcc139c0a32.tar.xz spack-a339ac0a727458ab55b2e0d27ff17dcc139c0a32.zip |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/cmd/checksum.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/spack/spack/cmd/checksum.py b/lib/spack/spack/cmd/checksum.py index b1ad89dbb8..c451993233 100644 --- a/lib/spack/spack/cmd/checksum.py +++ b/lib/spack/spack/cmd/checksum.py @@ -58,24 +58,29 @@ def get_checksums(versions, urls, **kwargs): tty.msg("Downloading...") hashes = [] - for i, (url, version) in enumerate(zip(urls, versions)): + i = 0 + for url, version in zip(urls, versions): stage = Stage(url) try: stage.fetch() if i == 0 and first_stage_function: first_stage_function(stage) - hashes.append( - spack.util.crypto.checksum(hashlib.md5, stage.archive_file)) + hashes.append((version, + spack.util.crypto.checksum(hashlib.md5, stage.archive_file))) except FailedDownloadError, e: tty.msg("Failed to fetch %s" % url) continue + except Exception, e: + tty.msg('Something failed on %s, skipping.\n (%s)' % (url, e)) + continue finally: if not keep_stage: stage.destroy() + i += 1 - return zip(versions, hashes) + return hashes |