mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rubygems.rb: Bump version to 2.0.1 for upcoming bugfix release
* lib/rubygems/ext/ext_conf_builder.rb: Restore ruby 1.8 compatibility for [Bug #9698] * test/rubygems/test_gem_installer.rb: Ditto. * lib/rubygems/package.rb: Restore ruby 1.8 compatibility. * test/rubygems/test_gem_dependency_installer.rb: Fix warnings git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6c77ae07a5
commit
85164e551a
6 changed files with 56 additions and 31 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
Tue Mar 5 12:30:55 2013 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
|
* lib/rubygems.rb: Bump version to 2.0.1 for upcoming bugfix release
|
||||||
|
|
||||||
|
* lib/rubygems/ext/ext_conf_builder.rb: Restore ruby 1.8 compatibility
|
||||||
|
for [Bug #9698]
|
||||||
|
* test/rubygems/test_gem_installer.rb: Ditto.
|
||||||
|
|
||||||
|
* lib/rubygems/package.rb: Restore ruby 1.8 compatibility.
|
||||||
|
|
||||||
|
* test/rubygems/test_gem_dependency_installer.rb: Fix warnings
|
||||||
|
|
||||||
Tue Mar 5 12:24:23 2013 Eric Hodel <drbrain@segment7.net>
|
Tue Mar 5 12:24:23 2013 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
* enumerator.c (enumerator_with_index): Restore handling of a nil memo
|
* enumerator.c (enumerator_with_index): Restore handling of a nil memo
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
require 'rbconfig'
|
require 'rbconfig'
|
||||||
|
|
||||||
module Gem
|
module Gem
|
||||||
VERSION = '2.0.0'
|
VERSION = '2.0.1'
|
||||||
end
|
end
|
||||||
|
|
||||||
# Must be first since it unloads the prelude from 1.9.2
|
# Must be first since it unloads the prelude from 1.9.2
|
||||||
|
|
|
@ -13,41 +13,45 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
||||||
FileEntry = FileUtils::Entry_ # :nodoc:
|
FileEntry = FileUtils::Entry_ # :nodoc:
|
||||||
|
|
||||||
def self.build(extension, directory, dest_path, results, args=[])
|
def self.build(extension, directory, dest_path, results, args=[])
|
||||||
tmp_dest = (Dir.mktmpdir(".gem.", ".") if File.identical?(dest_path, "."))
|
tmp_dest = Dir.mktmpdir(".gem.", ".") if File.identical?(dest_path, ".")
|
||||||
|
|
||||||
siteconf = Tempfile.open(%w"siteconf .rb", ".") do |f|
|
Tempfile.open %w"siteconf .rb", "." do |siteconf|
|
||||||
f.puts "require 'rbconfig'"
|
siteconf.puts "require 'rbconfig'"
|
||||||
f.puts "dest_path = #{(tmp_dest || dest_path).dump}"
|
siteconf.puts "dest_path = #{(tmp_dest || dest_path).dump}"
|
||||||
%w[sitearchdir sitelibdir].each do |dir|
|
%w[sitearchdir sitelibdir].each do |dir|
|
||||||
f.puts "RbConfig::MAKEFILE_CONFIG['#{dir}'] = dest_path"
|
siteconf.puts "RbConfig::MAKEFILE_CONFIG['#{dir}'] = dest_path"
|
||||||
f.puts "RbConfig::CONFIG['#{dir}'] = dest_path"
|
siteconf.puts "RbConfig::CONFIG['#{dir}'] = dest_path"
|
||||||
end
|
end
|
||||||
f
|
|
||||||
end
|
|
||||||
|
|
||||||
rubyopt = ENV["RUBYOPT"]
|
siteconf.flush
|
||||||
ENV["RUBYOPT"] = ["-r#{siteconf.path}", rubyopt].compact.join(' ')
|
|
||||||
cmd = [Gem.ruby, File.basename(extension), *args].join ' '
|
|
||||||
|
|
||||||
run cmd, results
|
rubyopt = ENV["RUBYOPT"]
|
||||||
|
destdir = ENV["DESTDIR"]
|
||||||
|
|
||||||
destdir = ENV["DESTDIR"]
|
begin
|
||||||
ENV["DESTDIR"] = nil
|
ENV["RUBYOPT"] = ["-r#{siteconf.path}", rubyopt].compact.join(' ')
|
||||||
|
cmd = [Gem.ruby, File.basename(extension), *args].join ' '
|
||||||
|
|
||||||
make dest_path, results
|
run cmd, results
|
||||||
|
|
||||||
if tmp_dest
|
ENV["DESTDIR"] = nil
|
||||||
FileEntry.new(tmp_dest).traverse do |ent|
|
|
||||||
destent = ent.class.new(dest_path, ent.rel)
|
make dest_path, results
|
||||||
destent.exist? or File.rename(ent.path, destent.path)
|
|
||||||
|
if tmp_dest
|
||||||
|
FileEntry.new(tmp_dest).traverse do |ent|
|
||||||
|
destent = ent.class.new(dest_path, ent.rel)
|
||||||
|
destent.exist? or File.rename(ent.path, destent.path)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
results
|
||||||
|
ensure
|
||||||
|
ENV["RUBYOPT"] = rubyopt
|
||||||
|
ENV["DESTDIR"] = destdir
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
results
|
|
||||||
ensure
|
ensure
|
||||||
ENV["RUBYOPT"] = rubyopt
|
|
||||||
ENV["DESTDIR"] = destdir
|
|
||||||
siteconf.close(true) if siteconf
|
|
||||||
FileUtils.rm_rf tmp_dest if tmp_dest
|
FileUtils.rm_rf tmp_dest if tmp_dest
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -387,8 +387,9 @@ EOM
|
||||||
@spec = Gem::Specification.from_yaml entry.read
|
@spec = Gem::Specification.from_yaml entry.read
|
||||||
when 'metadata.gz' then
|
when 'metadata.gz' then
|
||||||
args = [entry]
|
args = [entry]
|
||||||
args << { :external_encoding => Encoding::UTF_8 } unless
|
args << { :external_encoding => Encoding::UTF_8 } if
|
||||||
Zlib::GzipReader.method(:wrap).arity == 1
|
Object.const_defined?(:Encoding) &&
|
||||||
|
Zlib::GzipReader.method(:wrap).arity != 1
|
||||||
|
|
||||||
Zlib::GzipReader.wrap(*args) do |gzio|
|
Zlib::GzipReader.wrap(*args) do |gzio|
|
||||||
@spec = Gem::Specification.from_yaml gzio.read
|
@spec = Gem::Specification.from_yaml gzio.read
|
||||||
|
|
|
@ -37,7 +37,7 @@ class TestGemDependencyInstaller < Gem::TestCase
|
||||||
|
|
||||||
def test_available_set_for_name
|
def test_available_set_for_name
|
||||||
util_setup_gems
|
util_setup_gems
|
||||||
p1a, gem = util_gem 'a', '10.a'
|
p1a, = util_gem 'a', '10.a'
|
||||||
util_setup_spec_fetcher p1a, @a1, @a1_pre
|
util_setup_spec_fetcher p1a, @a1, @a1_pre
|
||||||
|
|
||||||
inst = Gem::DependencyInstaller.new
|
inst = Gem::DependencyInstaller.new
|
||||||
|
@ -49,7 +49,7 @@ class TestGemDependencyInstaller < Gem::TestCase
|
||||||
|
|
||||||
def test_available_set_for_name_prerelease
|
def test_available_set_for_name_prerelease
|
||||||
util_setup_gems
|
util_setup_gems
|
||||||
p1a, gem = util_gem 'a', '10.a'
|
p1a, = util_gem 'a', '10.a'
|
||||||
util_setup_spec_fetcher p1a, @a1, @a1_pre
|
util_setup_spec_fetcher p1a, @a1, @a1_pre
|
||||||
|
|
||||||
inst = Gem::DependencyInstaller.new :prerelease => true
|
inst = Gem::DependencyInstaller.new :prerelease => true
|
||||||
|
@ -62,7 +62,7 @@ class TestGemDependencyInstaller < Gem::TestCase
|
||||||
|
|
||||||
def test_available_set_for_dep
|
def test_available_set_for_dep
|
||||||
util_setup_gems
|
util_setup_gems
|
||||||
p1a, gem = util_gem 'a', '10.a'
|
p1a, = util_gem 'a', '10.a'
|
||||||
util_setup_spec_fetcher p1a, @a1, @a1_pre
|
util_setup_spec_fetcher p1a, @a1, @a1_pre
|
||||||
|
|
||||||
inst = Gem::DependencyInstaller.new
|
inst = Gem::DependencyInstaller.new
|
||||||
|
@ -76,7 +76,7 @@ class TestGemDependencyInstaller < Gem::TestCase
|
||||||
|
|
||||||
def test_available_set_for_dep_prerelease
|
def test_available_set_for_dep_prerelease
|
||||||
util_setup_gems
|
util_setup_gems
|
||||||
p1a, gem = util_gem 'a', '10.a'
|
p1a, = util_gem 'a', '10.a'
|
||||||
util_setup_spec_fetcher p1a, @a1, @a1_pre
|
util_setup_spec_fetcher p1a, @a1, @a1_pre
|
||||||
|
|
||||||
inst = Gem::DependencyInstaller.new :prerelease => true
|
inst = Gem::DependencyInstaller.new :prerelease => true
|
||||||
|
|
|
@ -1060,6 +1060,7 @@ gem 'other', version
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_install_extension_flat
|
def test_install_extension_flat
|
||||||
|
skip '1.8 mkmf.rb does not create TOUCH' if RUBY_VERSION < '1.9'
|
||||||
@spec.require_paths = ["."]
|
@spec.require_paths = ["."]
|
||||||
|
|
||||||
@spec.extensions << "extconf.rb"
|
@spec.extensions << "extconf.rb"
|
||||||
|
@ -1089,6 +1090,13 @@ gem 'other', version
|
||||||
@installer.install
|
@installer.install
|
||||||
end
|
end
|
||||||
assert File.exist?(so)
|
assert File.exist?(so)
|
||||||
|
rescue
|
||||||
|
puts '-' * 78
|
||||||
|
puts File.read File.join(@gemhome, 'gems', 'a-2', 'Makefile')
|
||||||
|
puts '-' * 78
|
||||||
|
puts File.read File.join(@gemhome, 'gems', 'a-2', 'gem_make.out')
|
||||||
|
puts '-' * 78
|
||||||
|
raise
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_installation_satisfies_dependency_eh
|
def test_installation_satisfies_dependency_eh
|
||||||
|
|
Loading…
Add table
Reference in a new issue