formula_cellar_checks: fix edge case handling in check_binary_arches

Currently, if formula `foo` ships both universal and non-native
binaries and `foo` is on both allowlists, then `brew audit --strict`
errors out with an empty error message:

    ❯ brew audit --strict foo
    foo:
      *
    Error: 1 problem in 1 formula detected

Let's fix this (admittedly obscure) corner case by returning early when
a formula is present on both allowlists.
This commit is contained in:
Carlo Cabrera 2021-09-21 01:02:29 +08:00
parent befaeba6c5
commit c7badb1e54
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -341,6 +341,8 @@ module FormulaCellarChecks
mismatches_expected = formula.tap.blank? || tap_audit_exception(:mismatched_binary_allowlist, formula.name)
return if compatible_universal_binaries.empty? && mismatches_expected
return if universal_binaries_expected && mismatches_expected
s = ""
if mismatches.present? && !mismatches_expected