From a31ce17f0b08f2ca5eb9e14b571a8de2db69ab5b Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sat, 5 Aug 2017 10:15:47 -0500 Subject: [PATCH] Various fixes to package name URL parsing (#4978) --- lib/spack/spack/cmd/url.py | 2 ++ lib/spack/spack/test/url_parse.py | 2 ++ lib/spack/spack/url.py | 1 + 3 files changed, 5 insertions(+) diff --git a/lib/spack/spack/cmd/url.py b/lib/spack/spack/cmd/url.py index 49c29ff469..633e345640 100644 --- a/lib/spack/spack/cmd/url.py +++ b/lib/spack/spack/cmd/url.py @@ -334,6 +334,8 @@ def name_parsed_correctly(pkg, name): pkg_name = pkg_name[2:] elif pkg_name.startswith('py-'): pkg_name = pkg_name[3:] + elif pkg_name.startswith('perl-'): + pkg_name = pkg_name[5:] elif pkg_name.startswith('octave-'): pkg_name = pkg_name[7:] diff --git a/lib/spack/spack/test/url_parse.py b/lib/spack/spack/test/url_parse.py index 41a2fda649..5749ff2d6e 100644 --- a/lib/spack/spack/test/url_parse.py +++ b/lib/spack/spack/test/url_parse.py @@ -124,6 +124,8 @@ def test_url_strip_version_suffixes(url, expected): ('converge_install_2.3.16', '2.3.16', 'converge'), # Download type - src ('jpegsrc.v9b', '9b', 'jpeg'), + # Download type - archive + ('coinhsl-archive-2014.01.17', '2014.01.17', 'coinhsl'), # Download type - std ('ghostscript-fonts-std-8.11', '8.11', 'ghostscript-fonts'), # Download version - release diff --git a/lib/spack/spack/url.py b/lib/spack/spack/url.py index e3da753a76..67a58cdd12 100644 --- a/lib/spack/spack/url.py +++ b/lib/spack/spack/url.py @@ -290,6 +290,7 @@ def strip_name_suffixes(path, version): 'install', 'src', '(open)?[Ss]ources?', + '[._-]archive', '[._-]std', # Download version