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

ruby-changes:33415

From: nobu <ko1@a...>
Date: Tue, 1 Apr 2014 17:29:41 +0900 (JST)
Subject: [ruby-changes:33415] nobu:r45494 (trunk): config_files.rb: show failure

nobu	2014-04-01 17:29:36 +0900 (Tue, 01 Apr 2014)

  New Revision: 45494

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45494

  Log:
    config_files.rb: show failure
    
    * tool/config_files.rb (ConfigFiles.download): show failed URI.
      [ruby-core:61792] [Bug #9690]

  Modified files:
    trunk/ChangeLog
    trunk/tool/config_files.rb
    trunk/tool/get-config_files
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45493)
+++ ChangeLog	(revision 45494)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Apr  1 17:29:35 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* tool/config_files.rb (ConfigFiles.download): show failed URI.
+	  [ruby-core:61792] [Bug #9690]
+
 Tue Apr  1 12:06:49 2014  NARUSE, Yui  <naruse@r...>
 
 	* addr2line.c (rb_dump_backtrace_with_lines): don't depend hard coded
Index: tool/config_files.rb
===================================================================
--- tool/config_files.rb	(revision 45493)
+++ tool/config_files.rb	(revision 45494)
@@ -1,8 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/tool/config_files.rb#L1
 require 'open-uri'
 
-ConfigFiles = "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=%s;hb=HEAD"
+ConfigFiles = "http://git0.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=%s;hb=HEAD"
 def ConfigFiles.download(name, dir = nil)
-  data = URI(self % name).read
+  uri = URI(self % name)
+  data = uri.read
   file = dir ? File.join(dir, name) : name
   open(file, "wb", 0755) {|f| f.write(data)}
+rescue => e
+  raise "failed to download #{name}\n#{e.message}: #{uri}"
 end
Index: tool/get-config_files
===================================================================
--- tool/get-config_files	(revision 45493)
+++ tool/get-config_files	(revision 45494)
@@ -2,6 +2,11 @@ https://github.com/ruby/ruby/blob/trunk/tool/get-config_files#L2
 require File.expand_path('../config_files', __FILE__)
 ARGV.each {|n|
   STDOUT.print "Downloading #{n}..."; STDOUT.flush
-  ConfigFiles.download(n)
-  STDOUT.puts
+  begin
+    ConfigFiles.download(n)
+    STDOUT.puts
+  rescue => e
+    STDOUT.puts
+    abort("#{$0}: #{e.message}")
+  end
 }

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

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