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

ruby-changes:22944

From: nobu <ko1@a...>
Date: Tue, 13 Mar 2012 11:00:05 +0900 (JST)
Subject: [ruby-changes:22944] nobu:r34993 (trunk): * tool/rbinstall.rb (prepare): skip if basedir is not defined.

nobu	2012-03-13 10:59:54 +0900 (Tue, 13 Mar 2012)

  New Revision: 34993

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

  Log:
    * tool/rbinstall.rb (prepare): skip if basedir is not defined.
      [ruby-core:39135][Bug #5238]
    * tool/rbinstall.rb (CONFIG.[]): check for mandatory
      configurations.

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34992)
+++ ChangeLog	(revision 34993)
@@ -1,3 +1,11 @@
+Tue Mar 13 10:59:48 2012  Nobuyoshi Nakada  <nobu@r...>
+
+	* tool/rbinstall.rb (prepare): skip if basedir is not defined.
+	  [ruby-core:39135][Bug #5238]
+
+	* tool/rbinstall.rb (CONFIG.[]): check for mandatory
+	  configurations.
+
 Tue Mar 13 00:09:18 2012  Shugo Maeda  <shugo@r...>
 
 	* enumerator.c (enumerable_lazy): added documentation.
Index: tool/rbinstall.rb
===================================================================
--- tool/rbinstall.rb	(revision 34992)
+++ tool/rbinstall.rb	(revision 34993)
@@ -270,6 +270,7 @@
 end
 
 def prepare(mesg, basedir, subdirs=nil)
+  return unless basedir
   case
   when !subdirs
     dirs = basedir
@@ -286,31 +287,39 @@
   makedirs(dirs)
 end
 
+def CONFIG.[](name, mandatory = false)
+  value = super(name)
+  if mandatory
+    raise "CONFIG['#{name}'] must be set" if !value or value.empty?
+  end
+  value
+end
+
 exeext = CONFIG["EXEEXT"]
 
-ruby_install_name = CONFIG["ruby_install_name"]
+ruby_install_name = CONFIG["ruby_install_name", true]
 rubyw_install_name = CONFIG["rubyw_install_name"]
 goruby_install_name = "go" + ruby_install_name
 
-bindir = CONFIG["bindir"]
-libdir = CONFIG["libdir"]
-archhdrdir = rubyhdrdir = CONFIG["rubyhdrdir"]
-archhdrdir += "/" + CONFIG["arch"]
-rubylibdir = CONFIG["rubylibdir"]
-archlibdir = CONFIG["archdir"]
+bindir = CONFIG["bindir", true]
+libdir = CONFIG["libdir", true]
+archhdrdir = rubyhdrdir = CONFIG["rubyhdrdir", true]
+archhdrdir += "/" + CONFIG["arch", true]
+rubylibdir = CONFIG["rubylibdir", true]
+archlibdir = CONFIG["archdir", true]
 sitelibdir = CONFIG["sitelibdir"]
 sitearchlibdir = CONFIG["sitearchdir"]
 vendorlibdir = CONFIG["vendorlibdir"]
 vendorarchlibdir = CONFIG["vendorarchdir"]
-mandir = CONFIG["mandir"]
-capidir = CONFIG["docdir"]
+mandir = CONFIG["mandir", true]
+capidir = CONFIG["docdir", true]
 configure_args = Shellwords.shellwords(CONFIG["configure_args"])
 enable_shared = CONFIG["ENABLE_SHARED"] == 'yes'
-dll = CONFIG["LIBRUBY_SO"]
-lib = CONFIG["LIBRUBY"]
-arc = CONFIG["LIBRUBY_A"]
-major = CONFIG["MAJOR"]
-minor = CONFIG["MINOR"]
+dll = CONFIG["LIBRUBY_SO", enable_shared]
+lib = CONFIG["LIBRUBY", true]
+arc = CONFIG["LIBRUBY_A", true]
+major = CONFIG["MAJOR", true]
+minor = CONFIG["MINOR", true]
 load_relative = configure_args.include?("--enable-load-relative")
 
 install?(:local, :arch, :bin, :'bin-arch') do

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

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