brew doctor - X11 check

Tweak wording in X11 check and use the same X11 detection function
as ENV.x11; also move that function into utils.
This commit is contained in:
Adam Vandenberg 2010-06-29 10:21:40 -07:00
parent 664e2aebd9
commit 6c23f9b324
3 changed files with 7 additions and 6 deletions

View File

@ -619,7 +619,3 @@ def llvm_build
$1.to_i
end
end
def x11_installed?
Pathname.new('/usr/X11/lib/libpng.dylib').exist?
end

View File

@ -54,10 +54,11 @@ def check_for_stray_dylibs
end
def check_for_x11
unless File.exists? '/usr/X11/lib/libpng.dylib'
unless x11_installed?
opoo "X11 not installed."
puts <<-EOS.undent
You don't have X11 installed as part of your Xcode installation.
This isn't required for all formula, but is expected by some.
This isn't required for all formulae, but is expected by some.
EOS
end

View File

@ -277,3 +277,7 @@ def dump_build_env env
puts "#{k}: #{value}" if value
end
end
def x11_installed?
Pathname.new('/usr/X11/lib/libpng.dylib').exist?
end