From 6b06043289bc2907d95ff6dc2f2cc2bb4f280492 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Fri, 22 May 2020 23:26:23 +0100 Subject: [PATCH] formula_installer: fix pruning of test deps also marked as build --- Library/Homebrew/formula_installer.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index dbb22c9d558ee..c6b632ee79ecf 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -456,7 +456,7 @@ def expand_requirements keep_build_test = false keep_build_test ||= runtime_requirements.include?(req) keep_build_test ||= req.test? && include_test? && dependent == f - keep_build_test ||= req.build? && !install_bottle_for_dependent + keep_build_test ||= req.build? && !install_bottle_for_dependent && !dependent.latest_version_installed? if req.prune_from_option?(build) Requirement.prune @@ -491,14 +491,12 @@ def expand_dependencies(deps) keep_build_test = false keep_build_test ||= dep.test? && include_test? && Homebrew.args.include_formula_test_deps?(dependent) - keep_build_test ||= dep.build? && !install_bottle_for?(dependent, build) + keep_build_test ||= dep.build? && !install_bottle_for?(dependent, build) && !dependent.latest_version_installed? if dep.prune_from_option?(build) Dependency.prune elsif (dep.build? || dep.test?) && !keep_build_test Dependency.prune - elsif dep.prune_if_build_and_not_dependent?(dependent) - Dependency.prune elsif dep.satisfied?(inherited_options[dep.name]) Dependency.skip else