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

ruby-changes:27736

From: nagachika <ko1@a...>
Date: Sun, 17 Mar 2013 23:20:21 +0900 (JST)
Subject: [ruby-changes:27736] nagachika:r39788 (ruby_2_0_0): merge revision(s) 39558: [Backport #7991]

nagachika	2013-03-17 23:20:09 +0900 (Sun, 17 Mar 2013)

  New Revision: 39788

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

  Log:
    merge revision(s) 39558: [Backport #7991]
    
    * lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
      revert use of temporary directory for build, to work some buggy
      extconf.rb which cannot build outside the source directory.
      [ruby-core:53056] [Bug #7698]

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/lib/rubygems/ext/ext_conf_builder.rb
    branches/ruby_2_0_0/version.h

Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 39787)
+++ ruby_2_0_0/ChangeLog	(revision 39788)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Sun Mar 17 23:19:34 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
+	  revert use of temporary directory for build, to work some buggy
+	  extconf.rb which cannot build outside the source directory.
+	  [ruby-core:53056] [Bug #7698]
+
 Sun Mar 17 23:11:35 2013  Eric Hodel  <drbrain@s...>
 
 	* lib/rubygems/ext/builder.rb:  Fix incompatibilities when installing
Index: ruby_2_0_0/lib/rubygems/ext/ext_conf_builder.rb
===================================================================
--- ruby_2_0_0/lib/rubygems/ext/ext_conf_builder.rb	(revision 39787)
+++ ruby_2_0_0/lib/rubygems/ext/ext_conf_builder.rb	(revision 39788)
@@ -7,37 +7,30 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/rubygems/ext/ext_conf_builder.rb#L7
 require 'rubygems/ext/builder'
 require 'rubygems/command'
 require 'fileutils'
-require 'tmpdir'
+require 'tempfile'
 
 class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
 
   def self.build(extension, directory, dest_path, results, args=[])
-    pwd = Dir.pwd
-    cmd = "#{Gem.ruby} -r./siteconf #{File.join pwd, File.basename(extension)}"
-    cmd << " #{args.join ' '}" unless args.empty?
-
-    Dir.mktmpdir("gem-install.") do |tmpdir|
-      Dir.chdir(tmpdir) do
-        open("siteconf.rb", "w") do |f|
-          f.puts "require 'rbconfig'"
-          f.puts "dest_path = #{dest_path.dump}"
-          %w[sitearchdir sitelibdir].each do |dir|
-            f.puts "RbConfig::MAKEFILE_CONFIG['#{dir}'] = dest_path"
-            f.puts "RbConfig::CONFIG['#{dir}'] = dest_path"
-          end
-        end
-
-        begin
-          run cmd, results
-
-          make dest_path, results
-        ensure
-          FileUtils.mv("mkmf.log", pwd) if $! and File.exist?("mkmf.log")
-        end
+    siteconf = Tempfile.open(%w"siteconf .rb", ".") do |f|
+      f.puts "require 'rbconfig'"
+      f.puts "dest_path = #{dest_path.dump}"
+      %w[sitearchdir sitelibdir].each do |dir|
+        f.puts "RbConfig::MAKEFILE_CONFIG['#{dir}'] = dest_path"
+        f.puts "RbConfig::CONFIG['#{dir}'] = dest_path"
       end
+      f
     end
 
+    cmd = [Gem.ruby, "-r#{siteconf.path}", File.basename(extension), *args].join ' '
+
+    run cmd, results
+
+    make dest_path, results
+
     results
+  ensure
+    siteconf.close(true) if siteconf
   end
 
 end
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 39787)
+++ ruby_2_0_0/version.h	(revision 39788)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2013-03-17"
-#define RUBY_PATCHLEVEL 58
+#define RUBY_PATCHLEVEL 59
 
 #define RUBY_RELEASE_YEAR 2013
 #define RUBY_RELEASE_MONTH 3

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r39558


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

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