Merge pull request #15987 from apainintheneck/audit-cmd-only-flush-formulary-cache-when-needed
cmd/audit: only flush formulary cache when needed
This commit is contained in:
commit
838cb3bef9
@ -187,6 +187,8 @@ module Homebrew
|
|||||||
spdx_license_data = SPDX.license_data
|
spdx_license_data = SPDX.license_data
|
||||||
spdx_exception_data = SPDX.exception_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|
|
formula_problems = audit_formulae.sort.each_with_object({}) do |f, problems|
|
||||||
path = f.path
|
path = f.path
|
||||||
|
|
||||||
@ -208,7 +210,7 @@ module Homebrew
|
|||||||
SimulateSystem.with os: os, arch: arch do
|
SimulateSystem.with os: os, arch: arch do
|
||||||
odebug "Auditing Formula #{f} on os #{os} and arch #{arch}"
|
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) }
|
audit_proc = proc { FormulaAuditor.new(Formulary.factory(path), **options).tap(&:audit) }
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user