[gcc r17-2933] contrib: Allow overriding download_prerequisites base URL

Alexander Monakov via Gcc-cvs <[email protected]> Tue, 4 Aug 2026 13:22:40 +0000 (GMT)
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:8cd5fa5e109aec3abc9b7ce6791ce8106e4cdb89

commit r17-2933-g8cd5fa5e109aec3abc9b7ce6791ce8106e4cdb89
Author: Даниил Гусев <[email protected]>
Date:   Sat Aug 1 22:57:04 2026 +0300

    contrib: Allow overriding download_prerequisites base URL
    
    Add support for GCC_PREREQUISITES_BASE_URL, so packages can be
    fetched from a local mirror instead of gcc.gnu.org every time.
    
    contrib/ChangeLog:
    
            * download_prerequisites (base_url): Allow overriding via the
            GCC_PREREQUISITES_BASE_URL environment variable.  Document it
            in --help output.

Diff:
---
 contrib/download_prerequisites | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/contrib/download_prerequisites b/contrib/download_prerequisites
index 2e6693a2aa65..68a384b96beb 100755
--- a/contrib/download_prerequisites
+++ b/contrib/download_prerequisites
@@ -33,7 +33,8 @@ mpc='mpc-1.3.1.tar.gz'
 isl='isl-0.24.tar.bz2'
 gettext='gettext-1.0.tar.gz'
 
-base_url='https://gcc.gnu.org/pub/gcc/infrastructure/'
+base_url="${GCC_PREREQUISITES_BASE_URL:-https://gcc.gnu.org/pub/gcc/infrastructure/}"
+base_url="${base_url%/}/"
 
 echo_archives() {
     echo "${gettext}"
@@ -86,6 +87,11 @@ The following options are available:
  --only-gettext   inhibit downloading any package but gettext
  --help           show this text and exit
  --version        show version information and exit
+
+Environment variables:
+
+ GCC_PREREQUISITES_BASE_URL  URL to download from
+  [${base_url}]
 "
 
 versiontext="${program} ${version}