Show tap/path for non-core formulae on build failure

Closes Homebrew/homebrew#16373.
Closes Homebrew/homebrew#20725.
This commit is contained in:
Adam Vandenberg 2013-06-23 16:15:11 -07:00
parent 1aabba7b9e
commit b9b1dfb9a6
2 changed files with 11 additions and 0 deletions

View File

@ -173,6 +173,12 @@ class BuildError < Homebrew::InstallationError
else else
require 'cmd/--config' require 'cmd/--config'
require 'cmd/--env' require 'cmd/--env'
unless formula.core_formula?
ohai "Formula"
puts "Tap: #{formula.tap}" unless formula.tap == "mxcl/master" # tap lies about non-tap externals
puts "Path: #{formula.path.realpath}"
end
ohai "Configuration" ohai "Configuration"
Homebrew.dump_build_config Homebrew.dump_build_config
ohai "ENV" ohai "ENV"

View File

@ -495,6 +495,11 @@ class Formula
end end
end end
# True if this formula is provided by Homebrew itself
def core_formula?
path.realpath.to_s == Formula.path(name).to_s
end
def self.path name def self.path name
Pathname.new("#{HOMEBREW_REPOSITORY}/Library/Formula/#{name.downcase}.rb") Pathname.new("#{HOMEBREW_REPOSITORY}/Library/Formula/#{name.downcase}.rb")
end end