From 1678a3785e1e04a6976e723a9e176defd2ab41f4 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Tue, 20 Jul 2021 12:35:09 +0800 Subject: [PATCH] Fix logic in `check_binary_arches` --- Library/Homebrew/formula_cellar_checks.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb index 7ef33945b6..16f69fbbc0 100644 --- a/Library/Homebrew/formula_cellar_checks.rb +++ b/Library/Homebrew/formula_cellar_checks.rb @@ -323,14 +323,15 @@ module FormulaCellarChecks mismatches = keg.binary_executable_or_library_files.reject do |file| file.arch == Hardware::CPU.arch end + return if mismatches.empty? compatible_universal_binaries = mismatches.select do |file| file.arch == :universal && file.archs.include?(Hardware::CPU.arch) end mismatches -= compatible_universal_binaries - return if mismatches.empty? && compatible_universal_binaries.empty? - return if mismatches.empty? && tap_audit_exception(:universal_binary_allowlist, formula.name) + universal_binaries_expected = tap_audit_exception(:universal_binary_allowlist, formula.name) + return if mismatches.empty? && universal_binaries_expected s = "" @@ -342,7 +343,7 @@ module FormulaCellarChecks EOS end - unless compatible_universal_binaries.empty? + if !compatible_universal_binaries.empty? && !universal_binaries_expected s += <<~EOS Unexpected universal binaries were found. The offending files are: