Merge pull request #8592 from reitermarkus/desc-cache-ignore-exceptions
Ignore `FormulaUnreadableError` in `Formula.each`.
This commit is contained in:
commit
2dbaaf35aa
@ -1460,16 +1460,14 @@ class Formula
|
|||||||
# @private
|
# @private
|
||||||
def self.each
|
def self.each
|
||||||
files.each do |file|
|
files.each do |file|
|
||||||
yield begin
|
yield Formulary.factory(file)
|
||||||
Formulary.factory(file)
|
rescue FormulaUnavailableError, FormulaUnreadableError => e
|
||||||
rescue FormulaUnavailableError => e
|
|
||||||
# Don't let one broken formula break commands. But do complain.
|
# Don't let one broken formula break commands. But do complain.
|
||||||
onoe "Failed to import: #{file}"
|
onoe "Failed to import: #{file}"
|
||||||
puts e
|
$stderr.puts e
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# Clear cache of .racks
|
# Clear cache of .racks
|
||||||
def self.clear_racks_cache
|
def self.clear_racks_cache
|
||||||
|
|||||||
@ -42,7 +42,7 @@ module Formulary
|
|||||||
# access them from within the formula's class scope.
|
# access them from within the formula's class scope.
|
||||||
mod.const_set(:BUILD_FLAGS, flags)
|
mod.const_set(:BUILD_FLAGS, flags)
|
||||||
mod.module_eval(contents, path)
|
mod.module_eval(contents, path)
|
||||||
rescue NameError, ArgumentError, ScriptError => e
|
rescue NameError, ArgumentError, ScriptError, MethodDeprecatedError => e
|
||||||
$stderr.puts e.backtrace if Homebrew::EnvConfig.developer?
|
$stderr.puts e.backtrace if Homebrew::EnvConfig.developer?
|
||||||
raise FormulaUnreadableError.new(name, e)
|
raise FormulaUnreadableError.new(name, e)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user