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

ruby-changes:13178

From: nobu <ko1@a...>
Date: Tue, 15 Sep 2009 06:43:19 +0900 (JST)
Subject: [ruby-changes:13178] Ruby:r24930 (trunk): * tool/rbinstall.rb (parse_args): show help message and exit if

nobu	2009-09-15 06:43:00 +0900 (Tue, 15 Sep 2009)

  New Revision: 24930

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

  Log:
    * tool/rbinstall.rb (parse_args): show help message and exit if
      rbconfig could not load.

  Modified files:
    trunk/ChangeLog
    trunk/tool/rbinstall.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 24929)
+++ ChangeLog	(revision 24930)
@@ -1,9 +1,12 @@
-Tue Sep 15 06:24:35 2009  Nobuyoshi Nakada  <nobu@r...>
+Tue Sep 15 06:42:59 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* common.mk (install-all): target to install all.
 
 	* tool/rbinstall.rb (parse_args): accept all install targets.
 
+	* tool/rbinstall.rb (parse_args): show help message and exit if
+	  rbconfig could not load.
+
 Tue Sep 15 04:25:03 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* configure.in (RDOCTARGET): use install-all.  [ruby-dev:39334]
Index: tool/rbinstall.rb
===================================================================
--- tool/rbinstall.rb	(revision 24929)
+++ tool/rbinstall.rb	(revision 24930)
@@ -1,8 +1,13 @@
 #!./miniruby
 
-load "./rbconfig.rb"
-include RbConfig
-$".unshift File.expand_path("./rbconfig.rb")
+begin
+  load "./rbconfig.rb"
+rescue LoadError
+  CONFIG = Hash.new {""}
+else
+  include RbConfig
+  $".unshift File.expand_path("./rbconfig.rb")
+end
 
 srcdir = File.expand_path('../..', __FILE__)
 unless defined?(CROSS_COMPILING) and CROSS_COMPILING
@@ -35,7 +40,7 @@
   $cmdtype = ('bat' if File::ALT_SEPARATOR == '\\')
   mflags = []
   opt = OptionParser.new
-  opt.on('-n') {$dryrun = true}
+  opt.on('-n', '--dry-run') {$dryrun = true}
   opt.on('--dest-dir=DIR') {|dir| $destdir = dir}
   opt.on('--extout=DIR') {|dir| $extout = (dir unless dir.empty?)}
   opt.on('--make=COMMAND') {|make| $make = make}
@@ -79,6 +84,11 @@
     end
   end rescue abort "#{$!.message}\n#{opt.help}"
 
+  unless defined?(RbConfig)
+    puts opt.help
+    exit
+  end
+
   $make, *rest = Shellwords.shellwords($make)
   $mflags.unshift(*rest) unless rest.empty?
   $mflags.unshift(*mflags)

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

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