mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Merge pull request #20081 from Homebrew/ignore-intel-only
cask/audit: skip caveats check for Intel-only casks
This commit is contained in:
commit
bb0bb27591
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user