aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMartin Kuehl2010-02-16 15:35:37 +0100
committerAdam Vandenberg2010-02-20 22:59:24 -0800
commit74e78487d5faa2cb0c1ff1cd2fd8b0d10d9e8dd7 (patch)
treea84f695b98fe9f730fe485aeddff1cba902c8207 /Library
parent221877aa3a50c70de048dbb430876b36442c32f9 (diff)
downloadhomebrew-74e78487d5faa2cb0c1ff1cd2fd8b0d10d9e8dd7.tar.bz2
Fix `brew cleanup`: don't bail out early
Running `brew cleanup` (with no arguments or multiple arguments) raises an error and stops as soon as it finds any formula whose most recent version is not installed. With this change it will instead print a warning, then continue with the next formula. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew.h.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb
index 6a284b292..d4cea7596 100644
--- a/Library/Homebrew/brew.h.rb
+++ b/Library/Homebrew/brew.h.rb
@@ -250,10 +250,7 @@ def cleanup name
f = Formula.factory name
- # we can't tell which one to keep in this circumstance
- raise "The most recent version of #{name} is not installed" unless f.installed?
-
- if f.prefix.parent.directory?
+ if f.installed? and f.prefix.parent.directory?
kids = f.prefix.parent.children
kids.each do |keg|
next if f.prefix == keg
@@ -261,6 +258,9 @@ def cleanup name
FileUtils.rm_rf keg
puts
end
+ else
+ # we can't tell which one to keep in this circumstance
+ opoo "Skipping #{name}: most recent version #{f.version} not installed"
end
end