[前][次][番号順一覧][スレッド一覧]

ruby-changes:63660

From: Kazuhiro <ko1@a...>
Date: Fri, 20 Nov 2020 14:18:32 +0900 (JST)
Subject: [ruby-changes:63660] 4b899f9164 (master): Try to fix download error

https://git.ruby-lang.org/ruby.git/commit/?id=4b899f9164

From 4b899f91647b7da1174492f891de3d6ee8128458 Mon Sep 17 00:00:00 2001
From: Kazuhiro NISHIYAMA <zn@m...>
Date: Fri, 20 Nov 2020 13:11:05 +0900
Subject: 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
```

diff --git a/tool/downloader.rb b/tool/downloader.rb
index d0cf52e..21f4aab 100644
--- a/tool/downloader.rb
+++ b/tool/downloader.rb
@@ -51,7 +51,12 @@ class Downloader https://github.com/ruby/ruby/blob/trunk/tool/downloader.rb#L51
   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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]