diff options
| author | Max Howell | 2010-02-27 17:29:23 +0000 |
|---|---|---|
| committer | Adam Vandenberg | 2010-04-06 08:22:27 -0700 |
| commit | 60796b75cb3b021b04b70d5cfea7c4182094214d (patch) | |
| tree | 767984e74e264d21a72045ba3c14b4dc8dea363e /Library | |
| parent | c5b4ccee013e4aa5c902908b567208ec130a436c (diff) | |
| download | homebrew-60796b75cb3b021b04b70d5cfea7c4182094214d.tar.bz2 | |
`brew doctor`
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/brew.h.rb | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb index 78f84119f..8ac1162c8 100644 --- a/Library/Homebrew/brew.h.rb +++ b/Library/Homebrew/brew.h.rb @@ -1,5 +1,6 @@ FORMULA_META_FILES = %w[README README.md ChangeLog COPYING LICENSE LICENCE COPYRIGHT AUTHORS] PLEASE_REPORT_BUG = "#{Tty.white}Please report this bug at #{Tty.em}http://github.com/mxcl/homebrew/issues#{Tty.reset}" +HOMEBREW_RECOMMENDED_GCC = 5577 def check_for_blacklisted_formula names return if ARGV.force? @@ -24,6 +25,55 @@ Mercurial can be install thusly: end end +def brew_doctor + read, write = IO.pipe + + if fork == nil + read.close + $stdout.reopen write + + bad_dylibs = Dir['/usr/local/lib/*.dylib'].select { |f| File.file? f and not File.symlink? f } + if bad_dylibs.count > 0 + puts "You have unbrewed dylibs in /usr/local/lib. These could cause build problems" + puts "when building Homebrew formula. If you no longer need them, delete them:" + puts + puts *bad_dylibs.collect { |f| " #{f}" } + puts + end + + if gcc_build < HOMEBREW_RECOMMENDED_GCC + puts "Your GCC version is older than the recommended version. It may be advisable" + puts "to upgrade to the latest release of Xcode." + puts + end + + if macports_or_fink_installed? + puts "You have Macports or Fink installed. This can cause trouble." + puts "You don't have to uninstall them, but you may like to try temporarily" + puts "moving them away, eg." + puts + puts " sudo mv /opt/local ~/macports" + puts + end + + unless File.exists? '/usr/X11/lib/libpng.dylib' + puts "You don't have X11 installed as part of your Xcode installation." + puts "This isn't required for all formula. But it is expected by some." + end + + exit! 0 + else + write.close + + unless (out = read.read).chomp.empty? + puts out + else + puts "Your OS X is ripe for brewing. Any troubles you may be experiencing are" + puts "likely purely psychosomatic." + end + end +end + def __make url, name require 'formula' require 'digest' |
