aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2012-04-17 17:08:36 -0500
committerJack Nagel2012-04-17 17:10:47 -0500
commit472322af24e87e60bcdb341383bf8915d222079d (patch)
tree24f8bcb01cfb2ec29e0435b96d2d0634e38f0eee
parent2e2a4920451e52891e8318e54f8bfbf975da5be7 (diff)
downloadbrew-472322af24e87e60bcdb341383bf8915d222079d.tar.bz2
Don't attempt to walk nonexistent directories
Fixes Homebrew/homebrew#11298. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
-rw-r--r--Library/Homebrew/cmd/doctor.rb1
-rw-r--r--Library/Homebrew/cmd/prune.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index bef15afff..a529f7402 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -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
diff --git a/Library/Homebrew/cmd/prune.rb b/Library/Homebrew/cmd/prune.rb
index 6c6f51549..75e6026df 100644
--- a/Library/Homebrew/cmd/prune.rb
+++ b/Library/Homebrew/cmd/prune.rb
@@ -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?