Further tweak :test dependency handling
- ensure that cases where `:build` and `:test` both apply to a dependency that we handle it appropriately - fix reintroduced regression (https://github.com/Homebrew/brew/pull/6471#issuecomment-533414923). Fixes #6470.
This commit is contained in:
parent
731c723c4a
commit
8b98ed1f47
@ -52,6 +52,8 @@ class Build
|
||||
Requirement.prune
|
||||
elsif req.prune_if_build_and_not_dependent?(dependent, formula)
|
||||
Requirement.prune
|
||||
elsif req.test?
|
||||
Requirement.prune
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -65,6 +67,8 @@ class Build
|
||||
Dependency.prune
|
||||
elsif dep.build?
|
||||
Dependency.keep_but_prune_recursive_deps
|
||||
elsif dep.test?
|
||||
Dependency.prune
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -488,10 +488,11 @@ class FormulaInstaller
|
||||
|
||||
if dep.prune_from_option?(build)
|
||||
Dependency.prune
|
||||
elsif dep.test? && !dep.build? && !include_test?
|
||||
Dependency.prune
|
||||
elsif dep.build? && !dep.test? && install_bottle_for?(dependent, build)
|
||||
Dependency.prune
|
||||
elsif dep.test? || (dep.build? && install_bottle_for?(dependent, build))
|
||||
keep = false
|
||||
keep ||= dep.test? && include_test? && dependent == formula
|
||||
keep ||= dep.build? && !install_bottle_for?(dependent, build)
|
||||
Dependency.prune unless keep
|
||||
elsif dep.prune_if_build_and_not_dependent?(dependent)
|
||||
Dependency.prune
|
||||
elsif dep.satisfied?(inherited_options[dep.name])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user