aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/install.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb
index 5aa198f31..4260eaac9 100644
--- a/Library/Homebrew/cmd/install.rb
+++ b/Library/Homebrew/cmd/install.rb
@@ -103,6 +103,10 @@ module Homebrew extend self
begin
fi = FormulaInstaller.new(f)
fi.install
+ # Due to the nature of Keg#unlink, this will remove symlinks from an
+ # older keg, which may still be present if an uninstallation was done
+ # via `rm -rf <keg>`; this is desired.
+ Keg.new("#{f.rack}/#{f.version}").unlink
fi.caveats
fi.finish
rescue FormulaAlreadyInstalledError => e