From 27f2aa5f2c0a9ee5679fcbd5cd6f0d31a6b0bd29 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 29 Oct 2014 00:28:29 -0500 Subject: Reduce explicit branches in dependency expansion --- Library/Homebrew/formula_installer.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 4da17b1c1..179f05ea3 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -69,7 +69,8 @@ class FormulaInstaller true end - def install_bottle_for_dep?(dep, build) + def install_bottle_for?(dep, build) + return pour_bottle? if dep == f return false if build_from_source? return false unless dep.bottle && dep.pour_bottle? return false unless build.used_options.empty? @@ -253,9 +254,7 @@ class FormulaInstaller if (req.optional? || req.recommended?) && build.without?(req) Requirement.prune - elsif req.build? && dependent == self.f && pour_bottle? - Requirement.prune - elsif req.build? && dependent != self.f && install_bottle_for_dep?(dependent, build) + elsif req.build? && install_bottle_for?(dependent, build) Requirement.prune elsif install_requirement_default_formula?(req, build) dep = req.to_dependency @@ -285,9 +284,7 @@ class FormulaInstaller if (dep.optional? || dep.recommended?) && build.without?(dep) Dependency.prune - elsif dep.build? && dependent == f && pour_bottle? - Dependency.prune - elsif dep.build? && dependent != f && install_bottle_for_dep?(dependent, build) + elsif dep.build? && install_bottle_for?(dependent, build) Dependency.prune elsif dep.satisfied?(options) Dependency.skip -- cgit v1.2.3