summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2014-10-27 21:32:31 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2014-10-27 21:32:31 -0700
commit75e6e794fbb79ca452e13f874edc7cfd2f10041f (patch)
treea3e1458de9c62210b430b7b5f902b7f05434cb62
parentee50a4ccce48a81b1246abc3a0aaa1a133f696f7 (diff)
downloadspack-75e6e794fbb79ca452e13f874edc7cfd2f10041f.tar.gz
spack-75e6e794fbb79ca452e13f874edc7cfd2f10041f.tar.bz2
spack-75e6e794fbb79ca452e13f874edc7cfd2f10041f.tar.xz
spack-75e6e794fbb79ca452e13f874edc7cfd2f10041f.zip
Fix bug with extension() for sourceforge URLs.
-rw-r--r--lib/spack/spack/util/compression.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/spack/spack/util/compression.py b/lib/spack/spack/util/compression.py
index a67576bd50..b4db266fd3 100644
--- a/lib/spack/spack/util/compression.py
+++ b/lib/spack/spack/util/compression.py
@@ -23,6 +23,7 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import re
+import os
from itertools import product
from spack.util.executable import which
@@ -60,6 +61,11 @@ def strip_extension(path):
def extension(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:
suffix = r'\.%s$' % type
if re.search(suffix, path):