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:
parent
fe50593c66
commit
d3ff8ca00f
@ -252,7 +252,13 @@ def fetch(self):
|
|||||||
self.skip_checksum_for_mirror = True
|
self.skip_checksum_for_mirror = True
|
||||||
if self.mirror_path:
|
if self.mirror_path:
|
||||||
mirrors = spack.config.get_config('mirrors')
|
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,
|
# If this archive is normally fetched from a tarball URL,
|
||||||
# then use the same digest. `spack mirror` ensures that
|
# then use the same digest. `spack mirror` ensures that
|
||||||
|
Loading…
Reference in New Issue
Block a user