brew depstree: shows a tree of dependencies for a formula

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Ferdinand Niedermann authored and Adam Vandenberg committed 2011-03-29 10:43:12 -07:00
1 parent 9d7d056c2d
commit 4e16c6026b
1 file changed
+21
+21
View File
@@ -0,0 +1,21 @@
require 'formula'
module Homebrew extend self
def depstree
ARGV.formulae.each do |f|
puts f
recursive_deps_tree(f, 1)
puts
end
end
private
def recursive_deps_tree(formula, level)
formula.deps.each do |dep|
puts "> "*level+dep
recursive_deps_tree(Formula.factory(dep), level+1)
end
end
end
Homebrew.depstree