From d3ff8ca00f7f47d365ea88ed717fa7940a1346c6 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 24 Jan 2016 20:14:40 -0800 Subject: 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. --- lib/spack/spack/stage.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') 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 -- cgit v1.2.3-60-g2f50