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
commit5ff48066f1093001f38b850a260b8c2bbb553a06 (patch)
tree70b50fe006ec6365a9404837efcd1ea80490294a /Library
parent115ffb226d020d291653ec0b96699a2dca8e301c (diff)
downloadbrew-5ff48066f1093001f38b850a260b8c2bbb553a06.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