From 4cd95652ead8923331dd2f5ec0c28b45527cca52 Mon Sep 17 00:00:00 2001 From: Simon Sigurdhsson Date: Sun, 31 Mar 2013 12:35:11 +0200 Subject: [PATCH] brew-pin: Fix bug in `FormulaPin#pinned?` Since `pinned?` was using `File#exists?`, broken symlinks left by force-upgraded formulae made `pinned?` return false while `pin` returned with an error because it could not overwrite the broken link. This is fixed by using `File#symlink?` instead, which returns true for broken symlinks and false only when they do not exist. Closes Homebrew/homebrew#18858. Signed-off-by: Mike McQuaid --- Library/Homebrew/formula_pin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/formula_pin.rb b/Library/Homebrew/formula_pin.rb index cdffd7fc0a..bf5934b938 100644 --- a/Library/Homebrew/formula_pin.rb +++ b/Library/Homebrew/formula_pin.rb @@ -27,7 +27,7 @@ class FormulaPin end def pinned? - @path.exist? + @path.symlink? end def pinable?