diff --git a/lib/spack/spack/test/url_parse.py b/lib/spack/spack/test/url_parse.py index cf6f262fdf..5489cc8d26 100644 --- a/lib/spack/spack/test/url_parse.py +++ b/lib/spack/spack/test/url_parse.py @@ -160,6 +160,8 @@ def test_url_strip_name_suffixes(url, version, expected): ('sionlib', 30, '1.7.1', 59, 'http://apps.fz-juelich.de/jsc/sionlib/download.php?version=1.7.1'), # Regex in name ('voro++', 40, '0.4.6', 47, 'http://math.lbl.gov/voro++/download/dir/voro++-0.4.6.tar.gz'), + # SourceForge download + ('glew', 55, '2.0.0', 60, 'https://sourceforge.net/projects/glew/files/glew/2.0.0/glew-2.0.0.tgz/download'), ]) def test_url_parse_offset(name, noffset, ver, voffset, path): """Tests that the name, version and offsets are computed correctly. diff --git a/lib/spack/spack/url.py b/lib/spack/spack/url.py index 8f2129b84a..54b3b74f1b 100644 --- a/lib/spack/spack/url.py +++ b/lib/spack/spack/url.py @@ -301,7 +301,8 @@ def split_url_extension(path): prefix, ext, suffix = path, '', '' # Strip off sourceforge download suffix. - match = re.search(r'((?:sourceforge\.net|sf\.net)/.*)(/download)$', path) + # e.g. https://sourceforge.net/projects/glew/files/glew/2.0.0/glew-2.0.0.tgz/download + match = re.search(r'(.*(?:sourceforge\.net|sf\.net)/.*)(/download)$', path) if match: prefix, suffix = match.groups()