summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-01-24 20:14:40 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2016-01-24 20:14:40 -0800
commitd3ff8ca00f7f47d365ea88ed717fa7940a1346c6 (patch)
treef580f4a3b42b2aed65c4807881d0b0b556e16223 /lib
parentfe50593c66d8cf7ee527fa13928990595d8b0a29 (diff)
downloadspack-d3ff8ca00f7f47d365ea88ed717fa7940a1346c6.tar.gz
spack-d3ff8ca00f7f47d365ea88ed717fa7940a1346c6.tar.bz2
spack-d3ff8ca00f7f47d365ea88ed717fa7940a1346c6.tar.xz
spack-d3ff8ca00f7f47d365ea88ed717fa7940a1346c6.zip
Fixes #382: Issues with spack fetch.
- urljoin() was compliant with RFC 1808 but not with my understanding of how paths should be joined. - updated path joining logic to comply.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/stage.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py
index 31635a854a..19b7d03664 100644
--- a/lib/spack/spack/stage.py
+++ b/lib/spack/spack/stage.py
@@ -252,7 +252,13 @@ class Stage(object):
self.skip_checksum_for_mirror = True
if self.mirror_path:
mirrors = spack.config.get_config('mirrors')
- urls = [urljoin(u, self.mirror_path) for name, u in mirrors.items()]
+
+ # Join URLs of mirror roots with mirror paths. Because
+ # urljoin() will strip everything past the final '/' in
+ # the root, so we add a '/' if it is not present.
+ mirror_roots = [root if root.endswith('/') else root + '/'
+ for root in mirrors.values()]
+ urls = [urljoin(root, self.mirror_path) for root in mirror_roots]
# If this archive is normally fetched from a tarball URL,
# then use the same digest. `spack mirror` ensures that