From 239fd06728131c0b82e0788970d6481d23ed2af0 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Tue, 20 Jul 2021 18:40:19 +0800 Subject: [PATCH] Enforce universal binary check only for Homebrew/core Also, prefer `if` to `unless`. --- Library/Homebrew/formula_cellar_checks.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb index 080adbbe5..f7f20f493 100644 --- a/Library/Homebrew/formula_cellar_checks.rb +++ b/Library/Homebrew/formula_cellar_checks.rb @@ -330,13 +330,15 @@ module FormulaCellarChecks end mismatches -= compatible_universal_binaries - universal_binaries_expected = - formula.tap.present? && tap_audit_exception(:universal_binary_allowlist, formula.name) + universal_binaries_expected = true + universal_binaries_expected = if formula.tap.present? && formula.tap.core_tap? + tap_audit_exception(:universal_binary_allowlist, formula.name) + end return if mismatches.empty? && universal_binaries_expected s = "" - unless mismatches.empty? + if mismatches.any? s += <<~EOS Binaries built for an incompatible architecture were installed into #{formula}'s prefix. The offending files are: @@ -344,7 +346,7 @@ module FormulaCellarChecks EOS end - if !compatible_universal_binaries.empty? && !universal_binaries_expected + if compatible_universal_binaries.any? && !universal_binaries_expected s += <<~EOS Unexpected universal binaries were found. The offending files are: