install: handle FormulaClassUnavailableError

Don't search for alternatives if formula was found, but has issues, as
this will create confusing output, particularly for contributors working
on a formula file.
This commit is contained in:
Martin Afanasjew 2016-04-16 21:07:07 +02:00
parent c3076f0b69
commit 94a627d7aa

View File

@ -139,6 +139,11 @@ module Homebrew
perform_preinstall_checks perform_preinstall_checks
formulae.each { |f| install_formula(f) } formulae.each { |f| install_formula(f) }
rescue FormulaClassUnavailableError => e
# Need to rescue before `FormulaUnavailableError` (superclass of this)
# is handled, as searching for a formula doesn't make sense here (the
# formula was found, but there's a problem with its implementation).
ofail e.message
rescue FormulaUnavailableError => e rescue FormulaUnavailableError => e
if (blacklist = blacklisted?(e.name)) if (blacklist = blacklisted?(e.name))
ofail "#{e.message}\n#{blacklist}" ofail "#{e.message}\n#{blacklist}"