aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-10-29 00:28:29 -0500
committerJack Nagel2014-10-29 00:36:25 -0500
commit27f2aa5f2c0a9ee5679fcbd5cd6f0d31a6b0bd29 (patch)
tree27406ad430e0daf64ef6f71b6dc9af5fcd2b1d1f /Library
parentad4edb94d753029fd7acef87733e2078c1fd644d (diff)
downloadbrew-27f2aa5f2c0a9ee5679fcbd5cd6f0d31a6b0bd29.tar.bz2
Reduce explicit branches in dependency expansion
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula_installer.rb11
1 files changed, 4 insertions, 7 deletions
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