diff options
| author | Jack Nagel | 2014-08-24 14:46:34 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-08-24 14:46:34 -0500 |
| commit | 6091ca79a0ae536a455b6577c54606dfab20dc4c (patch) | |
| tree | ba078e62ab921f08f48c58980d2e9cbfedbae0e8 /Library | |
| parent | 7b294c1e9134b077efdd6c348fd7f32086fe4960 (diff) | |
| download | homebrew-6091ca79a0ae536a455b6577c54606dfab20dc4c.tar.bz2 | |
Consider on-disk state when computing dependencies
Fixes #28754.
Fixes #29846.
Fixes #30920.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/build.rb | 12 | ||||
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index d3adf80de..a24c968f1 100644 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -79,9 +79,16 @@ class Build end end + def effective_build_options_for(dependent) + args = dependent.build.used_options + args |= Tab.for_formula(dependent).used_options + BuildOptions.new(args, dependent.options) + end + def expand_reqs f.recursive_requirements do |dependent, req| - if (req.optional? || req.recommended?) && dependent.build.without?(req) + build = effective_build_options_for(dependent) + if (req.optional? || req.recommended?) && build.without?(req) Requirement.prune elsif req.build? && dependent != f Requirement.prune @@ -94,7 +101,8 @@ class Build def expand_deps f.recursive_dependencies do |dependent, dep| - if (dep.optional? || dep.recommended?) && dependent.build.without?(dep) + build = effective_build_options_for(dependent) + if (dep.optional? || dep.recommended?) && build.without?(dep) Dependency.prune elsif dep.build? && dependent != f Dependency.prune diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 870bdba08..dea717eda 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -301,6 +301,7 @@ class FormulaInstaller def effective_build_options_for(dependent, inherited_options=[]) args = dependent.build.used_options args |= dependent == f ? options : inherited_options + args |= Tab.for_formula(dependent).used_options BuildOptions.new(args, dependent.options) end |
