summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Scheibel <scheibel1@llnl.gov>2020-07-23 10:58:59 -0700
committerGregory Becker <becker33@llnl.gov>2020-07-23 14:00:14 -0700
commit3b4524156616233975b66ca6206f971f77bd2d43 (patch)
tree73e785a469e0912448e30022e6f16531743fa692
parentd5b0f85ea32ebf59143d75327f1bcb9f5cc0a82e (diff)
downloadspack-3b4524156616233975b66ca6206f971f77bd2d43.tar.gz
spack-3b4524156616233975b66ca6206f971f77bd2d43.tar.bz2
spack-3b4524156616233975b66ca6206f971f77bd2d43.tar.xz
spack-3b4524156616233975b66ca6206f971f77bd2d43.zip
Update fetch order to match iteration order of MirrorReference (#17572)
-rw-r--r--lib/spack/spack/stage.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py
index 01f499bd0b..95e7dcc592 100644
--- a/lib/spack/spack/stage.py
+++ b/lib/spack/spack/stage.py
@@ -414,10 +414,11 @@ class Stage(object):
# 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.
- urls = []
+ mirror_urls = []
for mirror in spack.mirror.MirrorCollection().values():
for rel_path in self.mirror_paths:
- urls.append(url_util.join(mirror.fetch_url, rel_path))
+ mirror_urls.append(
+ url_util.join(mirror.fetch_url, rel_path))
# If this archive is normally fetched from a tarball URL,
# then use the same digest. `spack mirror` ensures that
@@ -435,7 +436,8 @@ class Stage(object):
self.skip_checksum_for_mirror = not bool(digest)
# Add URL strategies for all the mirrors with the digest
- for url in urls:
+ # Insert fetchers in the order that the URLs are provided.
+ for url in reversed(mirror_urls):
fetchers.insert(
0, fs.from_url_scheme(
url, digest, expand=expand, extension=extension))