Merge pull request #20081 from Homebrew/ignore-intel-only

cask/audit: skip caveats check for Intel-only casks
This commit is contained in:
Eric Knibbe 2025-06-12 02:13:30 +00:00 committed by GitHub
commit bb0bb27591
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -653,11 +653,12 @@ module Cask
supports_arm = result.merged_output.include?("arm64") supports_arm = result.merged_output.include?("arm64")
mentions_rosetta = cask.caveats.include?("requires Rosetta 2") mentions_rosetta = cask.caveats.include?("requires Rosetta 2")
requires_intel = cask.depends_on.arch&.any? { |arch| arch[:type] == :intel }
if supports_arm && mentions_rosetta if supports_arm && mentions_rosetta
add_error "Artifacts do not require Rosetta 2 but the caveats say otherwise!", add_error "Artifacts do not require Rosetta 2 but the caveats say otherwise!",
location: url.location location: url.location
elsif !supports_arm && !mentions_rosetta elsif !supports_arm && !mentions_rosetta && !requires_intel
add_error "Artifacts require Rosetta 2 but this is not indicated by the caveats!", add_error "Artifacts require Rosetta 2 but this is not indicated by the caveats!",
location: url.location location: url.location
end end