diff options
| author | Jack Nagel | 2013-01-27 23:57:34 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-01-28 10:35:15 -0600 |
| commit | 01dca28dcad216032764a79a471c70b9e234e641 (patch) | |
| tree | 2bd1ecf321fa5963dc801765c8f8a54cffb84a2b /Library | |
| parent | f745129d816ac1fe247e1857f981fbf196e5b705 (diff) | |
| download | homebrew-01dca28dcad216032764a79a471c70b9e234e641.tar.bz2 | |
Filter optional and reccommended requirements
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index adafbc11d..623d2b930 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -104,15 +104,23 @@ class FormulaInstaller end def check_requirements - needed_reqs = ARGV.filter_for_dependencies do - f.recursive_requirements.reject(&:satisfied?) + unsatisfied = ARGV.filter_for_dependencies do + f.recursive_requirements.select do |req| + if req.satisfied? + false + elsif req.build? + not pour_bottle? + elsif req.optional? || req.recommended? + f.recursive_dependencies.map(&:to_formula).any? do |dep| + dep.build.with?(req.name) + end || f.build.with?(req.name) + end + end end - needed_reqs.reject!(&:build?) if pour_bottle? - - unless needed_reqs.empty? - puts needed_reqs.map(&:message) * "\n" - fatals = needed_reqs.select(&:fatal?) + unless unsatisfied.empty? + puts unsatisfied.map(&:message) * "\n" + fatals = unsatisfied.select(&:fatal?) raise UnsatisfiedRequirements.new(f, fatals) unless fatals.empty? end end |
