summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>2021-09-13 01:08:00 -0700
committerGitHub <noreply@github.com>2021-09-13 08:08:00 +0000
commita1d792af4c29ca0a612aa42f7f5b65d8b4ef56de (patch)
treed9f4be6edf9deeaeaf1c407bc6d3e8f36fcb111c
parentb7e61a4b756a629df13e008cb13b78cb2582646c (diff)
downloadspack-a1d792af4c29ca0a612aa42f7f5b65d8b4ef56de.tar.gz
spack-a1d792af4c29ca0a612aa42f7f5b65d8b4ef56de.tar.bz2
spack-a1d792af4c29ca0a612aa42f7f5b65d8b4ef56de.tar.xz
spack-a1d792af4c29ca0a612aa42f7f5b65d8b4ef56de.zip
Bugfix: Correct checksum's sha256 when retrieve from remote (#25831)
-rw-r--r--lib/spack/spack/cmd/checksum.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/spack/spack/cmd/checksum.py b/lib/spack/spack/cmd/checksum.py
index 5f27f9d174..96e36b39b6 100644
--- a/lib/spack/spack/cmd/checksum.py
+++ b/lib/spack/spack/cmd/checksum.py
@@ -63,6 +63,16 @@ def checksum(parser, args):
if not url_dict:
tty.die("Could not find any versions for {0}".format(pkg.name))
+ # And ensure the specified version URLs take precedence, if available
+ try:
+ explicit_dict = {}
+ for v in pkg.versions:
+ if not v.isdevelop():
+ explicit_dict[v] = pkg.url_for_version(v)
+ url_dict.update(explicit_dict)
+ except spack.package.NoURLError:
+ pass
+
version_lines = spack.stage.get_checksums_for_versions(
url_dict, pkg.name, keep_stage=args.keep_stage,
batch=(args.batch or len(args.versions) > 0 or len(url_dict) == 1),