summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2014-02-07 10:36:58 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2014-02-07 10:36:58 -0800
commitf09c58549a31b2de17b572862aa66c432e84439c (patch)
treecc656d26495aac6a858438960d1984e5b8bf9823 /lib
parent3df638dd41c18ea7b8c7152d3d706b7797c194d7 (diff)
downloadspack-f09c58549a31b2de17b572862aa66c432e84439c.tar.gz
spack-f09c58549a31b2de17b572862aa66c432e84439c.tar.bz2
spack-f09c58549a31b2de17b572862aa66c432e84439c.tar.xz
spack-f09c58549a31b2de17b572862aa66c432e84439c.zip
Fix regex used in find_versions_of_archive.
Fixes github issue #2, as well as spack create for mvapich.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/package.py6
-rw-r--r--lib/spack/spack/test/url_parse.py5
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index ce4a98d99b..4f79f56ec9 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -779,15 +779,15 @@ def find_versions_of_archive(archive_url, **kwargs):
if not list_url:
list_url = os.path.dirname(archive_url)
if not wildcard:
- wildcard = url.parse_version(archive_url).wildcard()
+ wildcard = url.wildcard_version(archive_url)
versions = VersionList()
- url_regex = os.path.basename(url.wildcard_version(archive_url))
+ url_regex = os.path.basename(wildcard)
page_map = get_pages(list_url, depth=list_depth)
for site, page in page_map.iteritems():
- strings = re.findall(url_regex, page)
+ strings = set(re.findall(url_regex, page))
for s in strings:
match = re.search(wildcard, s)
diff --git a/lib/spack/spack/test/url_parse.py b/lib/spack/spack/test/url_parse.py
index f02bb72075..109402608b 100644
--- a/lib/spack/spack/test/url_parse.py
+++ b/lib/spack/spack/test/url_parse.py
@@ -267,3 +267,8 @@ class UrlParseTest(unittest.TestCase):
self.assert_detected(
'synergy', '1.3.6p2',
'http://synergy.googlecode.com/files/synergy-1.3.6p2-MacOSX-Universal.zip')
+
+ def test_mvapich2_version(self):
+ self.assert_detected(
+ 'mvapich2', '1.9',
+ 'http://mvapich.cse.ohio-state.edu/download/mvapich2/mv2/mvapich2-1.9.tgz')