Don't attempt to walk nonexistent directories

Fixes Homebrew/homebrew#11298.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-04-17 17:08:36 -05:00
parent 2e2a492045
commit 472322af24
2 changed files with 2 additions and 0 deletions

View File

@ -183,6 +183,7 @@ def check_for_broken_symlinks
broken_symlinks = []
%w[lib include sbin bin etc share].each do |d|
d = HOMEBREW_PREFIX/d
next unless d.directory?
d.find do |pn|
broken_symlinks << pn if pn.symlink? and pn.readlink.expand_path.to_s =~ /^#{HOMEBREW_PREFIX}/ and not pn.exist?
end

View File

@ -10,6 +10,7 @@ module Homebrew extend self
dirs = []
%w[bin sbin etc lib include share Library/LinkedKegs].map{ |d| HOMEBREW_PREFIX+d }.each do |path|
next unless path.directory?
path.find do |path|
path.extend ObserverPathnameExtension
if path.symlink?