From 4e16c6026b708c9837c84569283f0a15372fafbc Mon Sep 17 00:00:00 2001 From: Ferdinand Niedermann Date: Mon, 28 Mar 2011 13:10:46 +0200 Subject: brew depstree: shows a tree of dependencies for a formula Signed-off-by: Adam Vandenberg --- Library/Contributions/examples/brew-depstree.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 Library/Contributions/examples/brew-depstree.rb (limited to 'Library') 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 -- cgit v1.2.3