diff options
| author | Jack Nagel | 2013-12-09 14:36:10 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-12-09 14:36:10 -0600 |
| commit | 901902b53b7b47ed9e941f585738e17b034c98c2 (patch) | |
| tree | 42313b2c6251c66ba0535e983ab1b0d029ed2bd4 /Library/Homebrew | |
| parent | 293bde278a28fb4dcfb43069a24abfbbefcbe464 (diff) | |
| download | brew-901902b53b7b47ed9e941f585738e17b034c98c2.tar.bz2 | |
Compute recursive deps for default_formula deps
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index bdc25c6de..b838f2d54 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -17,7 +17,6 @@ class FormulaInstaller attr_reader :f attr_accessor :tab, :options, :ignore_deps attr_accessor :show_summary_heading, :show_header - attr_reader :unsatisfied_deps attr_reader :requirement_deps def initialize ff @@ -26,7 +25,6 @@ class FormulaInstaller @ignore_deps = ARGV.ignore_deps? || ARGV.interactive? @options = Options.new @tab = Tab.dummy_tab(ff) - @unsatisfied_deps = [] @requirement_deps = [] @@attempted ||= Set.new @@ -172,13 +170,11 @@ class FormulaInstaller perform_readline_hack check_requirements - unsatisfied_deps.concat(requirement_deps) - unsatisfied_deps.concat(expand_dependencies) + deps = [].concat(f.deps).concat(requirement_deps) - install_dependencies(unsatisfied_deps) + install_dependencies expand_dependencies(deps) ensure requirement_deps.clear - unsatisfied_deps.clear end def check_requirements @@ -203,21 +199,13 @@ class FormulaInstaller raise UnsatisfiedRequirements.new(f, fatals) unless fatals.empty? end - # Dependencies of f that were also explicitly requested on the command line. - # These honor options like --HEAD and --devel. - def requested_deps - f.recursive_dependencies.select { |dep| dep.requested? && !dep.installed? } - end - - # All dependencies that we must install before installing f. - # These do not honor flags like --HEAD and --devel. - def necessary_deps + def expand_dependencies(deps) # FIXME: can't check this inside the block for the top-level dependent # because it depends on the contents of ARGV. pour_bottle = pour_bottle? ARGV.filter_for_dependencies do - f.recursive_dependencies do |dependent, dep| + Dependency.expand(f, deps) do |dependent, dep| dep.universal! if f.build.universal? && !dep.build? if (dep.optional? || dep.recommended?) && dependent.build.without?(dep.name) @@ -235,12 +223,6 @@ class FormulaInstaller end end - # Combine requested_deps and necessary deps. - def expand_dependencies - deps = Set.new.merge(requested_deps).merge(necessary_deps) - f.recursive_dependencies.select { |d| deps.include? d } - end - def install_dependencies(deps) if deps.length > 1 oh1 "Installing dependencies for #{f}: #{Tty.green}#{deps*", "}#{Tty.reset}" |
