Merge pull request #13840 from carlocab/audit_gcc_dependency

formula_auditor: fix false positive in `audit_gcc_dependency`.
This commit is contained in:
Carlo Cabrera 2022-09-11 02:23:51 +08:00 committed by GitHub
commit 65ab951b80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -881,11 +881,14 @@ module Homebrew
bottle_tag = Utils::Bottles::Tag.new(system: macos_version, arch: arch) bottle_tag = Utils::Bottles::Tag.new(system: macos_version, arch: arch)
next unless bottle_tag.valid_combination? next unless bottle_tag.valid_combination?
variation = variations[bottle_tag.to_sym] variation_dependencies = variations.dig(bottle_tag.to_sym, "dependencies")
# This variation does not exist, so it must match Linux. # This variation either:
return false if variation.blank? # 1. does not exist
# 2. has no variation-specific dependencies
# In either case, it matches Linux.
return false if variation_dependencies.blank?
# We found a non-Linux variation that depends on GCC. # We found a non-Linux variation that depends on GCC.
return false if variation["dependencies"]&.include?("gcc") return false if variation_dependencies.include?("gcc")
end end
end end