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.
This commit is contained in:
Misty De Meo 2012-07-06 10:11:19 -05:00
parent 54618074a1
commit 44ccd122c2

View File

@ -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)