summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDr. Christian Tacke <58549698+ChristianTackeGSI@users.noreply.github.com>2020-01-21 20:14:38 +0100
committerAdam J. Stewart <ajstewart426@gmail.com>2020-01-21 13:14:38 -0600
commit5eed196f74f1589daa76a6fe5cd9ee862fadc9f0 (patch)
tree75c230b39fda8c1881d04db4f852b13871bd3ca0 /lib
parent54ecc4e504b98f2482e85929a4b75ebb4a731b1b (diff)
downloadspack-5eed196f74f1589daa76a6fe5cd9ee862fadc9f0.tar.gz
spack-5eed196f74f1589daa76a6fe5cd9ee862fadc9f0.tar.bz2
spack-5eed196f74f1589daa76a6fe5cd9ee862fadc9f0.tar.xz
spack-5eed196f74f1589daa76a6fe5cd9ee862fadc9f0.zip
Use util.url.join for URLs in GNU Mirrors / reorder Mirrors (#14395)
* Reorder GNU mirrors (#14395) As @adamjstewart commented in #14395, GNU suggests to use their mirror. So reorder the mirror to the top. GNU Doc: https://www.gnu.org/prep/ftp.en.html * Use spack.util.url.join for URLs in GNU mirrors (#14395) One should not use os.path.join for URLs. This does only work on POSIX systems. Instead use spack.util.url.join. So every part in spack uses the same url joining method.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_systems/gnu.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/spack/spack/build_systems/gnu.py b/lib/spack/spack/build_systems/gnu.py
index f0e70f440f..c5b5e74bb9 100644
--- a/lib/spack/spack/build_systems/gnu.py
+++ b/lib/spack/spack/build_systems/gnu.py
@@ -3,8 +3,7 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-import os.path
-
+import spack.util.url
import spack.package
@@ -15,8 +14,8 @@ class GNUMirrorPackage(spack.package.PackageBase):
#: List of GNU mirrors used by Spack
base_mirrors = [
- 'https://ftp.gnu.org/gnu',
'https://ftpmirror.gnu.org/',
+ 'https://ftp.gnu.org/gnu/',
# Fall back to http if https didn't work (for instance because
# Spack is bootstrapping curl)
'http://ftpmirror.gnu.org/'
@@ -26,7 +25,8 @@ class GNUMirrorPackage(spack.package.PackageBase):
def urls(self):
self._ensure_gnu_mirror_path_is_set_or_raise()
return [
- os.path.join(m, self.gnu_mirror_path) for m in self.base_mirrors
+ spack.util.url.join(m, self.gnu_mirror_path, resolve_href=True)
+ for m in self.base_mirrors
]
def _ensure_gnu_mirror_path_is_set_or_raise(self):