ext_conf_builder.rb: hack for obsolete sytle gems

* 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]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-03-02 16:17:22 +00:00
Родитель 9b79ed1292
Коммит 32458a01eb
3 изменённых файлов: 23 добавлений и 1 удалений

Просмотреть файл

@ -1,4 +1,9 @@
Sun Mar 3 01:16:16 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
Sun Mar 3 01:17:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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]

Просмотреть файл

@ -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

Просмотреть файл

@ -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