diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2025-07-03 13:23:36 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2025-07-03 14:29:48 +0900 |
| commit | 319062e4a0608c474e9c934fc4a1171ea2aa1269 (patch) | |
| tree | 2889395848d8c3dcfaf8192706666f6ac2ba0393 | |
| parent | 9782bd52353526a50b77ddba3687d7e921d06eaa (diff) | |
Prefer autotools repository mirror for build-aux files
gcc master is still using 2021 version files.
| -rw-r--r-- | tool/downloader.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tool/downloader.rb b/tool/downloader.rb index e266f3d173..b5ca416ac5 100644 --- a/tool/downloader.rb +++ b/tool/downloader.rb @@ -20,13 +20,20 @@ class Downloader end class GNU < self + Mirrors = %w[ + https://raw.githubusercontent.com/autotools-mirror/autoconf/refs/heads/master/build-aux/ + https://cdn.jsdelivr.net/gh/gcc-mirror/gcc@master + ] + def self.download(name, *rest, **options) - begin - super("https://cdn.jsdelivr.net/gh/gcc-mirror/gcc@master/#{name}", name, *rest, **options) + Mirrors.each_with_index do |url, i| + super("#{url}/#{name}", name, *rest, **options) rescue => e + raise if i + 1 == Mirrors.size # no more URLs m1, m2 = e.message.split("\n", 2) STDERR.puts "Download failed (#{m1}), try another URL\n#{m2}" - super("https://raw.githubusercontent.com/gcc-mirror/gcc/master/#{name}", name, *rest, **options) + else + return end end end |
