diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb index 144e4683dc..d8c64b6fa5 100644 --- a/Library/Homebrew/brew.h.rb +++ b/Library/Homebrew/brew.h.rb @@ -262,45 +262,37 @@ def diy end end - -def warn_about_macports_or_fink +def macports_or_fink_installed? # See these issues for some history: # http://github.com/mxcl/homebrew/issues/#issue/13 # http://github.com/mxcl/homebrew/issues/#issue/41 # http://github.com/mxcl/homebrew/issues/#issue/48 - + %w[port fink].each do |ponk| path = `/usr/bin/which -s #{ponk}` - unless path.empty? - opoo "It appears you have Macports or Fink in your PATH" - puts "If formula fail to build try renaming or uninstalling these tools." - end + return ponk unless path.empty? end - + # we do the above check because macports can be relocated and fink may be # able to be relocated in the future. This following check is because if # fink and macports are not in the PATH but are still installed it can # *still* break the build -- because some build scripts hardcode these paths: %w[/sw/bin/fink /opt/local/bin/port].each do |ponk| - if File.exist? ponk - opoo "It appears you have MacPorts or Fink installed" - puts "If formula fail to build, consider renaming: %s" % Pathname.new(ponk).dirname.parent - end + return ponk if File.exist? ponk end - - # finally sometimes people make their MacPorts or Fink read-only so they + + # finally, sometimes people make their MacPorts or Fink read-only so they # can quickly test Homebrew out, but still in theory obey the README's # advise to rename the root directory. This doesn't work, many build scripts # error out when they try to read from these now unreadable directories. %w[/sw /opt/local].each do |path| - if File.exist? path and not File.readable? path - opoo "It appears you have MacPorts or Fink installed" - puts "This has been known to cause build fails and other more subtle problems." - end + path = Pathname.new(path) + return path if path.exist? and not path.readable? end + + false end - def versions_of(keg_name) `ls #{HOMEBREW_CELLAR}/#{keg_name}`.collect { |version| version.strip }.reverse end diff --git a/bin/brew b/bin/brew index c6ca6c3ef0..fc114514a0 100755 --- a/bin/brew +++ b/bin/brew @@ -296,7 +296,8 @@ rescue Exception => e puts "Please report this bug at: #{HOMEBREW_WWW}" puts "Please include the following information:" ohai "Environment" - puts "Mac OS X: "+`sw_vers -productVersion` + puts "Mac OS X #{MACOS_VERSION}" + puts "Macports or Fink? #{macports_or_fink_installed?}" ohai e.inspect puts e.backtrace exit 1