diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index ee11cb649e..2bfe5419a9 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -187,6 +187,8 @@ module Homebrew spdx_license_data = SPDX.license_data spdx_exception_data = SPDX.exception_data + clear_formulary_cache = [args.os, args.arch].any? + formula_problems = audit_formulae.sort.each_with_object({}) do |f, problems| path = f.path @@ -208,7 +210,7 @@ module Homebrew SimulateSystem.with os: os, arch: arch do odebug "Auditing Formula #{f} on os #{os} and arch #{arch}" - Formulary.clear_cache + Formulary.clear_cache if clear_formulary_cache audit_proc = proc { FormulaAuditor.new(Formulary.factory(path), **options).tap(&:audit) }