ruby-changes:32207
From: drbrain <ko1@a...>
Date: Thu, 19 Dec 2013 12:05:55 +0900 (JST)
Subject: [ruby-changes:32207] drbrain:r44286 (trunk): * lib/rubygems: Update to RubyGems master af60443. Changes include:
drbrain 2013-12-19 12:05:37 +0900 (Thu, 19 Dec 2013) New Revision: 44286 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44286 Log: * lib/rubygems: Update to RubyGems master af60443. Changes include: * Improved speed of `gem install --ignore-dependencies`. * Open read-write for exclusive flock. [ruby-trunk - Bug #9257] * Remove specification before install to prevent infinite loop. Modified files: trunk/ChangeLog trunk/lib/rubygems/commands/install_command.rb trunk/lib/rubygems/installer.rb trunk/lib/rubygems.rb trunk/test/rubygems/test_gem_installer.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 44285) +++ ChangeLog (revision 44286) @@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Dec 19 12:05:17 2013 Eric Hodel <drbrain@s...> + + * lib/rubygems: Update to RubyGems master af60443. Changes include: + + * Improved speed of `gem install --ignore-dependencies`. + + * Open read-write for exclusive flock. [ruby-trunk - Bug #9257] + + * Remove specification before install to prevent infinite loop. + Thu Dec 19 11:23:49 2013 Aman Gupta <ruby@t...> * vm_insnhelper.c (vm_call_iseq_setup_normal): simple for loop Index: lib/rubygems/commands/install_command.rb =================================================================== --- lib/rubygems/commands/install_command.rb (revision 44285) +++ lib/rubygems/commands/install_command.rb (revision 44286) @@ -200,25 +200,31 @@ to write the specification by hand. For https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/install_command.rb#L200 req = Gem::Requirement.create(version) - inst = Gem::DependencyInstaller.new options + if options[:ignore_dependencies] + inst = Gem::Installer.new name, options + inst.install + @installed_specs.push(inst.spec) + else + inst = Gem::DependencyInstaller.new options - if options[:explain] - request_set = inst.resolve_dependencies name, req + if options[:explain] + request_set = inst.resolve_dependencies name, req - puts "Gems to install:" + puts "Gems to install:" - request_set.specs.map { |s| s.full_name }.sort.each do |s| - puts " #{s}" - end + request_set.specs.map { |s| s.full_name }.sort.each do |s| + puts " #{s}" + end - return - else - inst.install name, req - end + return + else + inst.install name, req + end - @installed_specs.push(*inst.installed_gems) + @installed_specs.push(*inst.installed_gems) - show_install_errors inst.errors + show_install_errors inst.errors + end end def install_gems # :nodoc: Index: lib/rubygems/installer.rb =================================================================== --- lib/rubygems/installer.rb (revision 44285) +++ lib/rubygems/installer.rb (revision 44286) @@ -212,6 +212,8 @@ class Gem::Installer https://github.com/ruby/ruby/blob/trunk/lib/rubygems/installer.rb#L212 def install pre_install_checks + FileUtils.rm_f File.join gem_home, 'specifications', @spec.spec_name + run_pre_install_hooks # Completely remove any previous gem files Index: lib/rubygems.rb =================================================================== --- lib/rubygems.rb (revision 44285) +++ lib/rubygems.rb (revision 44286) @@ -764,7 +764,7 @@ module Gem https://github.com/ruby/ruby/blob/trunk/lib/rubygems.rb#L764 # Safely read a file in binary mode on all platforms. def self.read_binary(path) - File.open path, binary_mode do |f| + open path, 'rb+' do |f| f.flock(File::LOCK_EX) f.read end Index: test/rubygems/test_gem_installer.rb =================================================================== --- test/rubygems/test_gem_installer.rb (revision 44285) +++ test/rubygems/test_gem_installer.rb (revision 44286) @@ -645,9 +645,11 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L645 cache_file = File.join @gemhome, 'cache', @spec.file_name stub_exe = File.join @gemhome, 'bin', 'executable' rakefile = File.join gemdir, 'ext', 'a', 'Rakefile' + spec_file = File.join @gemhome, 'specifications', @spec.spec_name Gem.pre_install do |installer| refute_path_exists cache_file, 'cache file must not exist yet' + refute_path_exists spec_file, 'spec file must not exist yet' true end @@ -655,11 +657,13 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L657 assert_path_exists gemdir, 'gem install dir must exist' assert_path_exists rakefile, 'gem executable must exist' refute_path_exists stub_exe, 'gem executable must not exist' + refute_path_exists spec_file, 'spec file must not exist yet' true end Gem.post_install do |installer| assert_path_exists cache_file, 'cache file must exist' + assert_path_exists spec_file, 'spec file must exist' end @newspec = nil -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/