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
commit4e16c6026b708c9837c84569283f0a15372fafbc (patch)
treecab54b8d1494d6e4e12180e5e329d48b3abec484 /Library
parent9d7d056c2d61f3b934580aab94dca05c78e19665 (diff)
downloadhomebrew-4e16c6026b708c9837c84569283f0a15372fafbc.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