brew depstree: shows a tree of dependencies for a formula
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
parent
7fa3208b02
commit
f523662ce5
21
Library/Contributions/examples/brew-depstree.rb
Executable file
21
Library/Contributions/examples/brew-depstree.rb
Executable 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
|
||||
Loading…
x
Reference in New Issue
Block a user