Skip to content

Commit

Permalink
Fix spack checksum (spack#141)
Browse files Browse the repository at this point in the history
* fix typo in spack checksum

* black formatting

* switch to importing ver

* putting it back, importing ver still fails

* Fix checksum.py for current upstream and fnal-develop

* Re-do style fix

---------

Co-authored-by: Chris Green <greenc@fnal.gov>
  • Loading branch information
marcmengel and greenc-FNAL authored May 18, 2023
1 parent 24bd704 commit 68ea1bd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/spack/spack/cmd/checksum.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,16 @@ def checksum(parser, args):
d_splitter = re.compile(r"^(\s*version\()(\")([^\"]+)(\"(?:,.*?))\)$")
for line in version_lines.splitlines():
v_match = d_splitter.match(line)
url = vstring_url_dict[v_match.group(3)]
if url in pkg.version_urls().values() or url != pkg.url_for_version(ver(v_match.group(3))):
matched_version = v_match.group(3)
url = vstring_url_dict[matched_version]
if url in pkg.version_urls().values() or url != pkg.url_for_version(
Version(matched_version)
):
print(
*v_match.group(1, 2, 3, 4),
",\n",
re.sub(r".", " ", v_match.group(1)),
'url="{0}"'.format(vstring_url_dict[v_match.group(3)]),
'url="{0}"'.format(vstring_url_dict[url]),
")",
sep="",
)
Expand Down

0 comments on commit 68ea1bd

Please sign in to comment.