formula_installer: check if dependencies have already been fetched.

Given a `pkg_a` that depends on `pkg_b`, it is redundant to list
`pkg_b` as a dependency when running the following commands:

- `brew install pkg_b pkg_a`
- `brew upgrade` (when both `pkg_a` and `pkg_b` are outdated)
This commit is contained in:
fn ⌃ ⌥ 2023-01-02 14:10:17 -08:00
parent 2e0b18f762
commit e234fb7542

View File

@ -1156,7 +1156,10 @@ class FormulaInstaller
def fetch_dependencies
return if ignore_deps?
deps = compute_dependencies
deps = compute_dependencies.reject do |dep, _options|
self.class.fetched.include?(dep.to_formula)
end
return if deps.empty?
oh1 "Fetching dependencies for #{formula.full_name}: " \