aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMax Howell2010-01-18 08:26:25 +0000
committerMax Howell2010-01-18 08:34:11 +0000
commitf88fbf1882b1d4e74a0f36e561f5f4955af424f0 (patch)
tree8aa17f4acf69a3eaef68c33e8d3f4c076cee586a /Library/Homebrew
parent16132cab6b6ad516f9758fe7c268f5096d0c2931 (diff)
downloadbrew-f88fbf1882b1d4e74a0f36e561f5f4955af424f0.tar.bz2
Don't cleanup if we can't tell which formula is for keeps
If the formula was updated and not yet installed, then cleanup would delete all kegs. Which is most likely not what the user wanted. Ideally we'd do a version check to figure out which keg is newest. But we don't yet have a function that can determine with accuracy version order.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/brew.h.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb
index 55a416c09..6a284b292 100644
--- a/Library/Homebrew/brew.h.rb
+++ b/Library/Homebrew/brew.h.rb
@@ -250,6 +250,9 @@ 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?
kids = f.prefix.parent.children
kids.each do |keg|