diff --git a/ChangeLog b/ChangeLog index 5f3424b957..d575dcbb6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -Sun Mar 3 01:16:16 2013 Nobuyoshi Nakada +Sun Mar 3 01:17:20 2013 Nobuyoshi Nakada + + * lib/rubygems/ext/ext_conf_builder.rb + (Gem::Ext::ExtConfBuilder.hack_for_obsolete_sytle_gems): remove + circular dependencies for old style gems which locate extconf.rb on + the toplevel. [ruby-core:53059] [ruby-trunk - Bug #7698] * lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build): use RUBYOPT instead of -r option, and revert some tests. [Bug #7698] diff --git a/lib/rubygems/ext/ext_conf_builder.rb b/lib/rubygems/ext/ext_conf_builder.rb index e11a1cdfbc..f3fc5d8e30 100644 --- a/lib/rubygems/ext/ext_conf_builder.rb +++ b/lib/rubygems/ext/ext_conf_builder.rb @@ -11,6 +11,18 @@ require 'tempfile' class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder + def self.hack_for_obsolete_sytle_gems(directory) + return unless directory and File.identical?(directory, ".") + mf = Gem.read_binary 'Makefile' + changed = false + changed |= mf.gsub!(/^(install-rb-default:)(.*)/) { + "#$1#{$2.gsub(/(?:^|\s+)\$\(RUBY(?:ARCH|LIB)DIR\)\/\S+(?=\s|$)/, '')}" + } + if changed + File.open('Makefile', 'wb') {|f| f.print mf} + end + end + def self.build(extension, directory, dest_path, results, args=[]) siteconf = Tempfile.open(%w"siteconf .rb", ".") do |f| f.puts "require 'rbconfig'" @@ -28,6 +40,8 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder run cmd, results + hack_for_obsolete_sytle_gems directory + make dest_path, results results diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb index d9a4a82418..acbc0447df 100644 --- a/test/rubygems/test_gem_installer.rb +++ b/test/rubygems/test_gem_installer.rb @@ -1038,6 +1038,9 @@ gem 'other', version RUBY end + # make sure timestamp file will become newer than the script file. + sleep 2 + assert !File.exist?(File.join(@spec.gem_dir, rb)) use_ui @ui do path = Gem::Package.build @spec