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.
This commit is contained in:
Todd Gamblin 2016-01-24 20:14:40 -08:00
parent fe50593c66
commit d3ff8ca00f

View File

@ -252,7 +252,13 @@ def fetch(self):
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