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,15 +7,14 @@
from spack import *
class Gdbm(AutotoolsPackage):
class Gdbm(AutotoolsPackage, GNUMirrorPackage):
"""GNU dbm (or GDBM, for short) is a library of database functions
that use extensible hashing and work similar to the standard UNIX dbm.
These routines are provided to a programmer needing to create and
manipulate a hashed database."""
homepage = "http://www.gnu.org.ua/software/gdbm/gdbm.html"
# URL must remain http:// so Spack can bootstrap curl
url = "http://ftpmirror.gnu.org/gdbm/gdbm-1.13.tar.gz"
gnu_mirror_path = "gdbm/gdbm-1.13.tar.gz"
version('1.18.1', sha256='86e613527e5dba544e73208f42b78b7c022d4fa5a6d5498bf18c8d6f745b91dc')
version('1.14.1', sha256='cdceff00ffe014495bed3aed71c7910aa88bf29379f795abc0f46d4ee5f8bc5f')