Skip to content

Fix parsing of EvtGen URL#16883

Merged
adamjstewart merged 2 commits intospack:developfrom
adamjstewart:fixes/url-parsing
Jun 4, 2020
Merged

Fix parsing of EvtGen URL#16883
adamjstewart merged 2 commits intospack:developfrom
adamjstewart:fixes/url-parsing

Conversation

@adamjstewart
Copy link
Copy Markdown
Member

Fixes name/version parsing of a URL reported by @vvolkl in #16880.

Before

$ spack url parse "https://evtgen.hepforge.org/downloads?f=EvtGen-01.07.00.tar.gz"
==> Parsing URL: https://evtgen.hepforge.org/downloads?f=EvtGen-01.07.00.tar.gz

==> Error: Couldn't detect version in: https://evtgen.hepforge.org/downloads?f=EvtGen-01.07.00.tar.gz

After

$ spack url parse "https://evtgen.hepforge.org/downloads?f=EvtGen-01.07.00.tar.gz"
==> Parsing URL: https://evtgen.hepforge.org/downloads?f=EvtGen-01.07.00.tar.gz

==> Matched version regex 21: r'[?&](?:filename|f|get)=[a-zA-Z\\d+-]+[_-]v?(\\d[\\da-zA-Z.]*)'
==> Matched  name   regex  6: r'\\?f=([A-Za-z\\d+-]+)$'

==> Detected:
    https://evtgen.hepforge.org/downloads?f=EvtGen-01.07.00.tar.gz
                                            ------ ~~~~~~~~
    name:    EvtGen
    version: 01.07.00

==> Substituting version 9.9.9b:
    https://evtgen.hepforge.org/downloads?f=EvtGen-9.9.9b.tar.gz
                                            ------ ~~~~~~

Overall URL parsing performance is unchanged:

$ spack url summary
==> Generating a summary of URL parsing in Spack...

    Total URLs found:          3796
    Names correctly parsed:    3437/3796 (90.54%)
    Versions correctly parsed: 3533/3796 (93.07%)

@adamjstewart adamjstewart merged commit dd19d6f into spack:develop Jun 4, 2020
@adamjstewart adamjstewart deleted the fixes/url-parsing branch June 4, 2020 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant