formula_auditor: allow pkg-config alias for pkgconf migration

This commit is contained in:
Michael Cho 2024-10-30 15:52:09 -04:00
parent 702bfe1281
commit 347e9460f4
No known key found for this signature in database
GPG Key ID: 55E85E28A7CD1E85

View File

@ -361,8 +361,10 @@ module Homebrew
EOS EOS
end end
# we want to allow uses_from_macos for aliases but not bare dependencies # we want to allow uses_from_macos for aliases but not bare dependencies.
if self.class.aliases.include?(dep.name) && !dep.uses_from_macos? # we also allow `pkg-config` for backwards compatibility in external taps.
# TODO: after migrating all `pkg-config` usage to `pkgconf`, do not allow `pkg-config` in core tap
if self.class.aliases.include?(dep.name) && !dep.uses_from_macos? && dep.name != "pkg-config"
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