Fetching from URLs falls back to mirrors if they exist (#13881)

Users can now list mirrors of the main url in packages.

- [x] Instead of just a single `url` attribute, users can provide a list (`urls`) in the package, and these will be tried by in order by the fetch strategy.

- [x] To handle one of the most common mirror cases, define a `GNUMirrorPackage` mixin to handle all the standard GNU mirrors.  GNU packages can set `gnu_mirror_path` to define the path within a mirror, and the mixin handles setting up all the requisite GNU mirror URLs.

- [x] update all GNU packages in `builtin` to use the `GNUMirrorPackage` mixin.
This commit is contained in:
Massimiliano Culpo
2019-12-20 23:32:18 +01:00
committed by Todd Gamblin
parent 1b93320848
commit 497fddfcb9
66 changed files with 321 additions and 218 deletions

View File

@@ -7,11 +7,11 @@
import glob
class Binutils(AutotoolsPackage):
class Binutils(AutotoolsPackage, GNUMirrorPackage):
"""GNU binutils, which contain the linker, assembler, objdump and others"""
homepage = "http://www.gnu.org/software/binutils/"
url = "https://ftpmirror.gnu.org/binutils/binutils-2.28.tar.bz2"
gnu_mirror_path = "binutils/binutils-2.28.tar.bz2"
version('2.32', sha256='de38b15c902eb2725eac6af21183a5f34ea4634cb0bcef19612b50e5ed31072d')
version('2.31.1', sha256='ffcc382695bf947da6135e7436b8ed52d991cf270db897190f19d6f9838564d0')