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 <mike@mikemcquaid.com>
This commit is contained in:
Simon Sigurdhsson 2013-03-31 12:35:11 +02:00 committed by Mike McQuaid
parent 040138164b
commit 4cd95652ea

View File

@ -27,7 +27,7 @@ class FormulaPin
end
def pinned?
@path.exist?
@path.symlink?
end
def pinable?