commit:     9af2dc246b433bf8503a3e4c92d024c429fec927
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 25 02:47:19 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar 25 02:49:56 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9af2dc24

toolchain.eclass: use mirror://gcc first, then fallback to mirror://gnu

mirror://gnu doesn't always have snapshots, but mirror://gcc do. See
https://gcc.gnu.org/mirrors.html.

Needed because of the ongoing gnu.org DNS and availability issues.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/toolchain.eclass | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 8ffdd9e26f1e..81f2f7328fe4 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -537,12 +537,18 @@ get_gcc_src_uri() {
                # Pull gcc tarball from another location. Frequently used by 
gnat-gpl.
                GCC_SRC_URI="${GCC_TARBALL_SRC_URI}"
        elif [[ -n ${SNAPSHOT} ]] ; then
-               
GCC_SRC_URI="https://gcc.gnu.org/pub/gcc/snapshots/${SNAPSHOT}/gcc-${SNAPSHOT}.tar.xz";
+               
GCC_SRC_URI="mirror://gcc/snapshots/${SNAPSHOT}/gcc-${SNAPSHOT}.tar.xz"
        else
                if tc_version_is_between 5.5 6 || tc_version_is_between 6.4 7 
|| tc_version_is_at_least 7.2 ; then
-                       
GCC_SRC_URI="mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_RELEASE_VER}.tar.xz"
+                       GCC_SRC_URI="
+                               
mirror://gcc/gcc-${GCC_PV}/gcc-${GCC_RELEASE_VER}.tar.xz
+                               
mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_RELEASE_VER}.tar.xz
+                       "
                else
-                       
GCC_SRC_URI="mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_RELEASE_VER}.tar.bz2"
+                       GCC_SRC_URI="
+                               
mirror://gcc/gcc-${GCC_PV}/gcc-${GCC_RELEASE_VER}.tar.bz2
+                               
mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_RELEASE_VER}.tar.bz2
+                       "
                fi
        fi
 

Reply via email to