aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorFerdinand Niedermann2011-03-28 13:10:46 +0200
committerAdam Vandenberg2011-03-29 10:43:12 -0700
commitf523662ce594f97a1b69d1aec478f9c3c206d6fc (patch)
treee26681f31a1faf1a6dc1cd4efd92d53245b53cc3 /Library
parent7fa3208b026fcdcba6c5566af3bf6a99bf71a187 (diff)
downloadbrew-f523662ce594f97a1b69d1aec478f9c3c206d6fc.tar.bz2
brew depstree: shows a tree of dependencies for a formula
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/examples/brew-depstree.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/Library/Contributions/examples/brew-depstree.rb b/Library/Contributions/examples/brew-depstree.rb
new file mode 100755
index 000000000..f8d6989b1
--- /dev/null
+++ b/Library/Contributions/examples/brew-depstree.rb
@@ -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