formula_auditor: allow uses_from_macos for aliases.

This will enable https://github.com/Homebrew/homebrew-core/pull/84910 which will
enable https://github.com/Homebrew/brew/pull/12008.
This commit is contained in:
Mike McQuaid 2021-09-09 10:24:35 +01:00
parent 40a7a01196
commit c6aea445a3
No known key found for this signature in database
GPG Key ID: 3338A31AFDB1D829

View File

@ -263,7 +263,9 @@ module Homebrew
next unless @core_tap next unless @core_tap
if self.class.aliases.include?(dep.name) # we want to allow uses_from_macos for aliases but not bare dependencies
if self.class.aliases.include?(dep.name) &&
(spec.uses_from_macos_elements.blank? || spec.uses_from_macos_elements.exclude?(dep.name))
problem "Dependency '#{dep.name}' is an alias; use the canonical name '#{dep.to_formula.full_name}'." problem "Dependency '#{dep.name}' is an alias; use the canonical name '#{dep.to_formula.full_name}'."
end end