aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorSimon Sigurdhsson2013-03-31 12:35:11 +0200
committerMike McQuaid2013-03-31 19:27:17 +0100
commit4cd95652ead8923331dd2f5ec0c28b45527cca52 (patch)
tree980e2ffd7d696300e1df4ad082b1772e35eed4a2 /Library
parent040138164bf3f8e17ba05be4b135455c03bb0cf5 (diff)
downloadbrew-4cd95652ead8923331dd2f5ec0c28b45527cca52.tar.bz2
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>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula_pin.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/Homebrew/formula_pin.rb b/Library/Homebrew/formula_pin.rb
index cdffd7fc0..bf5934b93 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?