aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-08-20 08:53:38 -0700
committerAdam Vandenberg2010-08-20 08:57:22 -0700
commite93395eb507023d48a3669dbab3652e598eb2297 (patch)
tree3b8898edbb32026b7210ba92d6f2a3bc839d34a4 /Library
parentfbb93d909235d7695f2147ca7e84d4bf496e5055 (diff)
downloadhomebrew-e93395eb507023d48a3669dbab3652e598eb2297.tar.bz2
'brew cleanup' no longer complains about single versions
Previously "brew cleanup" would complain if the most recent version of a brew wasn't installed. We now suppress this message if only one (outdated) formula is present.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew.h.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb
index 5865427ca..8c71ca8dc 100644
--- a/Library/Homebrew/brew.h.rb
+++ b/Library/Homebrew/brew.h.rb
@@ -239,8 +239,9 @@ def cleanup name
require 'formula'
f = Formula.factory name
+ formula_cellar = f.prefix.parent
- if f.installed? and f.prefix.parent.directory?
+ if f.installed? and formula_cellar.directory?
kids = f.prefix.parent.children
kids.each do |keg|
next if f.prefix == keg
@@ -249,8 +250,11 @@ def cleanup name
puts
end
else
- # we can't tell which one to keep in this circumstance
- opoo "Skipping #{name}: most recent version #{f.version} not installed"
+ # If the cellar only has one version installed, don't complain
+ # that we can't tell which one to keep.
+ if formula_cellar.children.length > 1
+ opoo "Skipping #{name}: most recent version #{f.version} not installed"
+ end
end
end