Merge pull request #7604 from MikeMcQuaid/more_test_dependency_tweaks

Further tweak :test dependency handling
This commit is contained in:
Mike McQuaid 2020-05-19 15:58:21 +01:00 committed by GitHub
commit 98ad4fe826
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -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

View File

@ -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])