Skip to content
Snippets Groups Projects
Commit 75e6e794 authored by Todd Gamblin's avatar Todd Gamblin
Browse files

Fix bug with extension() for sourceforge URLs.

parent ee50a4cc
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
############################################################################## ##############################################################################
import re import re
import os
from itertools import product from itertools import product
from spack.util.executable import which from spack.util.executable import which
...@@ -60,6 +61,11 @@ def strip_extension(path): ...@@ -60,6 +61,11 @@ def strip_extension(path):
def extension(path): def extension(path):
"""Get the archive extension for a path.""" """Get the archive extension for a path."""
# Strip sourceforge suffix.
if re.search(r'((?:sourceforge.net|sf.net)/.*)/download$', path):
path = os.path.dirname(path)
for type in ALLOWED_ARCHIVE_TYPES: for type in ALLOWED_ARCHIVE_TYPES:
suffix = r'\.%s$' % type suffix = r'\.%s$' % type
if re.search(suffix, path): if re.search(suffix, path):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment