aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorilovezfs2016-06-02 02:09:35 -0700
committerilovezfs2016-06-02 02:19:58 -0700
commitb2c9625d780277f021c63e21cac4a7c954170784 (patch)
tree375836f014dadd88b1aef117879b22dcaff00acf
parent5b1372e7587e5b1ea34301111d05685d773de728 (diff)
downloadbrew-b2c9625d780277f021c63e21cac4a7c954170784.tar.bz2
formula_installer: accumulate inherited options
When a given dependency appears multiple times in a formula's dependency tree, the inherited options for that dependency should accumulate rather than being overwritten each time that dependency is considered by expand_dependencies. In particular, this impacts "universal" since the dependency should be built with universal unless all of its instances in the dependency tree don't have "universal" as opposed to only if the last instance considered has "universal." Closes Homebrew/homebrew-core#1604. Closes #308. Signed-off-by: ilovezfs <ilovezfs@icloud.com>
-rw-r--r--Library/Homebrew/formula_installer.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index c9d1f42d6..ab0e36029 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -341,10 +341,10 @@ class FormulaInstaller
end
def expand_dependencies(deps)
- inherited_options = {}
+ inherited_options = Hash.new { |hash, key| hash[key] = Options.new }
expanded_deps = Dependency.expand(formula, deps) do |dependent, dep|
- options = inherited_options[dep.name] = inherited_options_for(dep)
+ inherited_options[dep.name] |= inherited_options_for(dep)
build = effective_build_options_for(
dependent,
inherited_options.fetch(dependent.name, [])
@@ -354,7 +354,7 @@ class FormulaInstaller
Dependency.prune
elsif dep.build? && install_bottle_for?(dependent, build)
Dependency.prune
- elsif dep.satisfied?(options)
+ elsif dep.satisfied?(inherited_options[dep.name])
Dependency.skip
end
end