From c7badb1e5413052def6fdade669fe6da55689222 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Tue, 21 Sep 2021 01:02:29 +0800 Subject: [PATCH] formula_cellar_checks: fix edge case handling in `check_binary_arches` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- Library/Homebrew/formula_cellar_checks.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb index 721baa0696..e9b7eea618 100644 --- a/Library/Homebrew/formula_cellar_checks.rb +++ b/Library/Homebrew/formula_cellar_checks.rb @@ -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