aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMisty De Meo2012-07-06 10:11:19 -0500
committerMisty De Meo2012-07-06 10:32:56 -0500
commitdd77bb890d04f9a012be54c1e2257d802aefbc04 (patch)
treed1538e815cbc2c0a6fbcc61d0ded82c7b33179d1 /Library/Homebrew
parent399125a43eaf2d3278dfb86fb5cd7941aba6c903 (diff)
downloadhomebrew-dd77bb890d04f9a012be54c1e2257d802aefbc04.tar.bz2
Keg#unlink: skip find for non-extant files
In 1.8, Pathname.find would work (and do nothing) if the source path didn't exist. In 1.9 this throws an exception instead, so check whether the file exists before trying.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/keg.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index b0f6f0e7b..f9aba2e0e 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -30,6 +30,7 @@ class Keg < Pathname
def unlink
n=0
%w[bin etc lib include sbin share var].map{ |d| self/d }.each do |src|
+ next unless src.exist?
src.find do |src|
next if src == self
dst=HOMEBREW_PREFIX+src.relative_path_from(self)