From dd77bb890d04f9a012be54c1e2257d802aefbc04 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Fri, 6 Jul 2012 10:11:19 -0500 Subject: 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. --- Library/Homebrew/keg.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'Library') 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) -- cgit v1.2.3