From 862c3ba4a2fb76140e46fdf49a1ea6857f140a29 Mon Sep 17 00:00:00 2001 From: ilovezfs Date: Tue, 13 Dec 2016 11:15:00 -0800 Subject: [PATCH] Revert "formula: runtime deps of build deps aren't runtime" --- Library/Homebrew/formula.rb | 2 +- Library/Homebrew/test/formula_test.rb | 15 ++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index e1846424f5822..c80cd517f9d22 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1505,7 +1505,7 @@ def recursive_requirements(&block) # Returns a list of Dependency objects that are required at runtime. # @private def runtime_dependencies - recursive_dependencies { |_, dep| Dependency.prune if dep.build? } + recursive_dependencies.reject(&:build?) end # Returns a list of formulae depended on by this formula that aren't diff --git a/Library/Homebrew/test/formula_test.rb b/Library/Homebrew/test/formula_test.rb index 28d376b7c268e..a6db1b57f2666 100644 --- a/Library/Homebrew/test/formula_test.rb +++ b/Library/Homebrew/test/formula_test.rb @@ -651,19 +651,12 @@ def test_dependencies f4 = formula("f4") do url "f4-1.0" - depends_on "f1" + depends_on "f3" end - stub_formula_loader f4 - f5 = formula("f5") do - url "f5-1.0" - depends_on "f3" => :build - depends_on "f4" - end - - assert_equal %w[f3 f4], f5.deps.map(&:name) - assert_equal %w[f1 f2 f3 f4], f5.recursive_dependencies.map(&:name) - assert_equal %w[f1 f4], f5.runtime_dependencies.map(&:name) + assert_equal %w[f3], f4.deps.map(&:name) + assert_equal %w[f1 f2 f3], f4.recursive_dependencies.map(&:name) + assert_equal %w[f2 f3], f4.runtime_dependencies.map(&:name) end def test_to_hash