formula_installer: don't output caveats for dependencies.

If a formula is installed as a dependency (or not on request) then don't
output its caveats.

Inspired by conversation in https://github.com/Homebrew/brew/pull/11367.
Closes https://github.com/Homebrew/brew/pull/11367
This commit is contained in:
Mike McQuaid 2021-05-19 12:11:01 +01:00
parent ec2271cea7
commit 6764329684
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -760,6 +760,8 @@ class FormulaInstaller
audit_installed if Homebrew::EnvConfig.developer? audit_installed if Homebrew::EnvConfig.developer?
return if !installed_on_request? || installed_as_dependency?
caveats = Caveats.new(formula) caveats = Caveats.new(formula)
return if caveats.empty? return if caveats.empty?