diff options
| author | Adam Vandenberg | 2009-11-16 23:12:24 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2009-11-19 14:03:07 -0800 |
| commit | b6ca4dcf81476ede2b63ca86e12d01de57e826f0 (patch) | |
| tree | c737b1010447a4ffbd162e6a8cfa5a72af633e83 /bin | |
| parent | 107ff021c194023b60592e09e77364c7f3e1f3d9 (diff) | |
| download | homebrew-b6ca4dcf81476ede2b63ca86e12d01de57e826f0.tar.bz2 | |
New command 'brew deps [formula]'
Where brew info will show the next-level-down dependencies, brew deps
will show all of the formulae that a given formula depends on.
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/brew | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -246,6 +246,35 @@ begin puts "#{name} is a dependency for #{our_deps.join(', ')}." end end + + when 'deps' + require 'formula' + + ARGV.formulae.each do |f| + name = f.name + + our_deps = [] + checked = {} + to_check = [name] + + while ! to_check.empty? + item = to_check.pop + checked[item] = true + + formula = Formulary.read item + next if formula == nil || formula.deps == nil || formula.deps.empty? + + our_deps.push(*formula.deps) + to_check.push(*formula.deps.select{|g| !checked[g]}) + end + + if our_deps.empty? + puts "#{name} has no dependencies." + else + our_deps.sort! + puts "#{name} depends on #{our_deps.join(", ")}" + end + end when 'pull', 'push', 'checkout', 'branch' onoe "Unknown command: #{arg} (did you mean 'git #{arg}'?)" |
