dependencies_helpers: fix pruning of build/test deps
We need to check that a dependency is a build or test dependency before checking that it is satisfied in order to prune dependencies as requested correctly. Before: ``` ❯ brew deps esptool ca-certificates cmake mpdecimal openssl@1.1 openssl@3 pkg-config python@3.11 readline rust six sqlite xz ``` After: ``` ❯ brew deps esptool ca-certificates cffi mpdecimal openssl@1.1 pycparser python@3.11 readline six sqlite xz ``` Note: You will need build dependencies installed to reproduce the "before" behaviour. See #15445.
This commit is contained in:
parent
9d0b7361d1
commit
7962b3072b
@ -45,13 +45,13 @@ module DependenciesHelpers
|
||||
klass.prune if ignores.include?("recommended?") || dependent.build.without?(dep)
|
||||
elsif dep.optional?
|
||||
klass.prune if includes.exclude?("optional?") && !dependent.build.with?(dep)
|
||||
elsif dep.satisfied?
|
||||
klass.prune if ignores.include?("satisfied?")
|
||||
elsif dep.build? || dep.test?
|
||||
keep = false
|
||||
keep ||= dep.test? && includes.include?("test?") && dependent == root_dependent
|
||||
keep ||= dep.build? && includes.include?("build?")
|
||||
klass.prune unless keep
|
||||
elsif dep.satisfied?
|
||||
klass.prune if ignores.include?("satisfied?")
|
||||
end
|
||||
|
||||
# If a tap isn't installed, we can't find the dependencies of one of
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user