From 42f48ae1eaa8e16a859606a11cbe5148e8e0a1e1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 6 Oct 2026 03:04:12 +0000 Subject: [PATCH 1/2] Initial plan From 16143bce8719f6f685f40fedbdc68a8125651e08 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 6 Oct 2026 03:07:00 +0000 Subject: [PATCH 2/2] Add robust GNU archive mirror fallback Co-authored-by: chris1111 <6248794+chris1111@users.noreply.github.com> --- build_gcc16.sh | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/build_gcc16.sh b/build_gcc16.sh index 0274c8fe61..de77266203 100755 --- a/build_gcc16.sh +++ b/build_gcc16.sh @@ -147,6 +147,22 @@ function mountRamDisk() { } # Download # +DownloadGNU () { + local path="$1" + local url + + rm -f download.tmp + for url in "https://ftp.gnu.org/gnu/${path}" "https://ftpmirror.gnu.org/${path}" "https://ftp.fu-berlin.de/unix/gnu/${path}"; do + if curl -k -f -L --connect-timeout 15 --retry 2 --retry-connrefused \ + -o download.tmp "$url"; then + return 0 + fi + done + + rm -f download.tmp + return 1 +} + DownloadSource () { if [[ ! -f ${DIR_DOWNLOADS}/${ISL_VERSION}.tar.xz ]]; then echo "Status: ${ISL_VERSION} not found." @@ -163,19 +179,19 @@ DownloadSource () { cd $DIR_DOWNLOADS if [[ ! -f ${DIR_DOWNLOADS}/${GMP_VERSION}.tar.xz ]]; then echo "Status: ${GMP_VERSION} not found." - curl -k -f -o download.tmp --remote-name https://ftp.gnu.org/gnu/gmp/${GMP_VERSION}.tar.xz || exit 1 + DownloadGNU "gmp/${GMP_VERSION}.tar.xz" || exit 1 mv download.tmp ${GMP_VERSION}.tar.xz fi if [[ ! -f ${DIR_DOWNLOADS}/${MPFR_VERSION}.tar.xz ]]; then echo "Status: ${MPFR_VERSION} not found." - curl -k -f -o download.tmp --remote-name https://ftp.gnu.org/gnu/mpfr/${MPFR_VERSION}.tar.xz || exit 1 + DownloadGNU "mpfr/${MPFR_VERSION}.tar.xz" || exit 1 mv download.tmp ${MPFR_VERSION}.tar.xz fi if [[ ! -f ${DIR_DOWNLOADS}/${MPC_VERSION}.tar.gz ]]; then echo "Status: ${MPC_VERSION} not found." - curl -k -f -o download.tmp --remote-name https://ftp.gnu.org/gnu/mpc/${MPC_VERSION}.tar.gz || exit 1 + DownloadGNU "mpc/${MPC_VERSION}.tar.gz" || exit 1 # curl -k -f -o download.tmp --remote-name https://ftp.fu-berlin.de/unix/gnu/mpc/${MPC_VERSION}.tar.gz || exit 1 mv download.tmp ${MPC_VERSION}.tar.gz fi @@ -193,7 +209,7 @@ DownloadSource () { if [[ ! -f ${DIR_DOWNLOADS}/$BINUTILS_VERSION.tar.xz ]]; then echo "Status: $BINUTILS_VERSION not found." - curl -k -f -o download.tmp --remote-name https://ftp.gnu.org/gnu/binutils/binutils-2.46.1.tar.xz || exit 1 + DownloadGNU "binutils/binutils-2.46.1.tar.xz" || exit 1 mv download.tmp $BINUTILS_VERSION.tar.xz fi