From b8ba083e12d51b9689ced835e094c3f418030b95 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Tue, 19 May 2020 19:14:40 +0100 Subject: [PATCH] dependencies: fix recursive_includes not handling deps of test deps --- Library/Homebrew/dependencies.rb | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb index 3ef90b2ed1..512a06a09b 100644 --- a/Library/Homebrew/dependencies.rb +++ b/Library/Homebrew/dependencies.rb @@ -100,16 +100,11 @@ module Homebrew klass.prune if ignores.include?("recommended?") || dependent.build.without?(dep) elsif dep.optional? klass.prune if !includes.include?("optional?") && !dependent.build.with?(dep) - elsif dep.test? - if includes.include?("test?") - Dependency.keep_but_prune_recursive_deps if type == :dependencies - elsif dep.build? - klass.prune unless includes.include?("build?") - else - klass.prune - end - elsif dep.build? - klass.prune unless includes.include?("build?") + elsif dep.build? || dep.test? + keep = false + keep ||= dep.test? && includes.include?("test?") && dependent == formula + keep ||= dep.build? && includes.include?("build?") + klass.prune unless keep end # If a tap isn't installed, we can't find the dependencies of one of