From cdd52e28f16069259e106719baaf972b2d1b70fa Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Fri, 10 Feb 2012 23:40:21 -0600 Subject: Remove LinkedKegs entry if we're writing the same one If a keg has been uninstalled via `rm -rf `, and a user tries to reinstall it without `brew unlink`ing it first, it will fail to link as the LinkedKegs entry still exists. This isn't desirable, and the user should be able to reinstall the same formula on top of the old, dead symlinks without problems, so let's just remove the LinkedKegs entry if it matches the one we are installing anyway. Signed-off-by: Jack Nagel --- Library/Homebrew/cmd/install.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'Library') diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 4a20dc7cb..caefbcb40 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -104,6 +104,7 @@ module Homebrew extend self fi = FormulaInstaller.new(f) fi.install fi.caveats + f.linked_keg.unlink if f.linked_keg.directory? and f.linked_keg.realpath == f.prefix fi.finish rescue FormulaAlreadyInstalledError => e opoo e.message -- cgit v1.2.3