From f27468507ce57689f1748fda355443564f745a45 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 11 Nov 2014 17:41:19 -0600 Subject: [PATCH] Don't warn about config scripts that originate in the cellar Fixes Homebrew/homebrew-php#1389. --- Library/Homebrew/cmd/doctor.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index dcc5c70618..a72ce689f5 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -666,9 +666,10 @@ def check_for_config_scripts ].map(&:downcase) paths.each do |p| - next if whitelist.include?(p.downcase) || - p.start_with?(real_cellar.to_s, HOMEBREW_CELLAR.to_s) || - !File.directory?(p) + next if whitelist.include?(p.downcase) || !File.directory?(p) + + realpath = Pathname.new(p).realpath.to_s + next if realpath.start_with?(real_cellar.to_s, HOMEBREW_CELLAR.to_s) scripts += Dir.chdir(p) { Dir["*-config"] }.map { |c| File.join(p, c) } end