From c9fd1b9bf013f631656518d5b1f44cb12fa61543 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Sun, 8 Apr 2012 15:28:16 -0500 Subject: [PATCH] doctor: skip Cellar checks if Cellar doesn't exist Attempting to call certain methods on the Cellar before it exists, such as realpath, would cause brew doctor to throw unnecessary "file does not exist" errors. This was fixed once before, but new tests have been added since without the appropriate checks. cf. 0d28bc78d71590c8e8a5961d8d10e3d7d9b8822d Fixes Homebrew/homebrew#5188 (again). --- Library/Homebrew/cmd/doctor.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 4f2ffed6f7..340d3ab3c1 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -515,7 +515,8 @@ def check_for_iconv end def check_for_config_scripts - real_cellar = HOMEBREW_CELLAR.exist? && HOMEBREW_CELLAR.realpath + return unless HOMEBREW_CELLAR.exist? + real_cellar = HOMEBREW_CELLAR.realpath config_scripts = [] @@ -835,6 +836,7 @@ def check_for_outdated_homebrew end def check_for_unlinked_but_not_keg_only + return unless HOMEBREW_CELLAR.exist? unlinked = HOMEBREW_CELLAR.children.reject do |rack| if not rack.directory? true