aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMisty De Meo2012-04-08 15:28:16 -0500
committerMisty De Meo2012-04-08 15:50:16 -0500
commitc9fd1b9bf013f631656518d5b1f44cb12fa61543 (patch)
tree2d60f813aee584aa0eaa29cae56075f7a6d3ebea /Library
parent25a148d6a1509f69539a639cd9de65ca7c70d37d (diff)
downloadbrew-c9fd1b9bf013f631656518d5b1f44cb12fa61543.tar.bz2
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).
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/doctor.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 4f2ffed6f..340d3ab3c 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