1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Try to fix download error

https://github.com/ruby/ruby/runs/1428320660?check_suite_focus=true#step:9:10
```
tool/downloader.rb:243:in `rescue in download': failed to download config.guess (RuntimeError)
OpenURI::HTTPError: 403 Forbidden: https://cdn.jsdelivr.net/gh/gcc-mirror/gcc@master/config.guess
```
This commit is contained in:
Kazuhiro NISHIYAMA 2020-11-20 13:11:05 +09:00 committed by Kazuhiro NISHIYAMA
parent 8cbd5f218b
commit 4b899f9164
Notes: git 2020-11-20 14:18:39 +09:00

View file

@ -51,7 +51,12 @@ class Downloader
class GNU < self
def self.download(name, *rest)
if https?
super("https://cdn.jsdelivr.net/gh/gcc-mirror/gcc@master/#{name}", name, *rest)
begin
super("https://cdn.jsdelivr.net/gh/gcc-mirror/gcc@master/#{name}", name, *rest)
rescue => e
STDERR.puts "Download failed (#{e.message}), try another URL"
super("https://raw.githubusercontent.com/gcc-mirror/gcc/master/#{name}", name, *rest)
end
else
super("https://repo.or.cz/official-gcc.git/blob_plain/HEAD:/#{name}", name, *rest)
end