diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 06:52:18 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 06:52:18 +0000 |
commit | 9694bb8cac12969300692dac5a1cf7aa4e3a46cd (patch) | |
tree | c3cb423d701f7049ba9382de052e2a937cd1302d /lib/rubygems/commands/cleanup_command.rb | |
parent | 3f606b7063fc7a8b191556365ad343a314719a8d (diff) |
* lib/rubygems*: Updated to RubyGems 2.0
* test/rubygems*: ditto.
* common.mk (prelude): Updated for RubyGems 2.0 source rearrangement.
* tool/change_maker.rb: Allow invalid UTF-8 characters in source
files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands/cleanup_command.rb')
-rw-r--r-- | lib/rubygems/commands/cleanup_command.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/rubygems/commands/cleanup_command.rb b/lib/rubygems/commands/cleanup_command.rb index 124c4c203a..dc919e5570 100644 --- a/lib/rubygems/commands/cleanup_command.rb +++ b/lib/rubygems/commands/cleanup_command.rb @@ -26,6 +26,9 @@ class Gem::Commands::CleanupCommand < Gem::Command <<-EOF The cleanup command removes old gems from GEM_HOME. If an older version is installed elsewhere in GEM_PATH the cleanup command won't touch it. + +Older gems that are required to satisify the dependencies of gems +are not removed. EOF end @@ -56,6 +59,8 @@ installed elsewhere in GEM_PATH the cleanup command won't touch it. primary_gems[spec.name].version != spec.version } + full = Gem::DependencyList.from_specs + deplist = Gem::DependencyList.new gems_to_cleanup.uniq.each do |spec| deplist.add spec end @@ -64,6 +69,8 @@ installed elsewhere in GEM_PATH the cleanup command won't touch it. original_path = Gem.path deps.each do |spec| + next unless full.ok_to_remove?(spec.full_name) + if options[:dryrun] then say "Dry Run Mode: Would uninstall #{spec.full_name}" else |