You are not logged in.
I've been toying around with scheme and wrote a little package dependency graph generator. It doesn't do much, but it does it fairly fast. It's written in chicken scheme.
The usage is fairly simple, you invoke it with pkg-depgraph <pkg1> ... <pkgN> and it will spit out the dependency graph to stdout. This can (and should) be piped to graphviz's dot to render it into a picture.
It's a bit faster than pactree.
It's now available in AUR.
You can change the default settings by adding this to ~/.config/pkg-depgraph.conf:
; incase you happen to have your database in a non-standard location
(define *db-path* "/var/lib/pacman/local")
; the style applied to the packages queried
(define *style* "[color=black]")
;the style applied to the entire graph. It is a list of strings.
(define *graph-style* '("node [shape=box]"))
This is the dependency graph of pkg-depgraph, generated by pkg-depgraph:
As an comparison between pkg-depgraph and pactree.sh, I picked moonlight, which has a fairly large dependency graph, as a benchmark.
time pkg-depgraph moonlight | dot -Tpng -opkg-dep-moonlight.png
pkg-depgraph moonlight 0.04s user 0.02s system 65% cpu 0.086 total
dot -Tpng -opkg-dep-moonlight.png 1.44s user 0.07s system 81% cpu 1.861 total
pkg-depgraph moonlight 0.04s user 0.01s system 55% cpu 0.096 total
dot -Tpng -opkg-dep-moonlight.png 1.41s user 0.07s system 89% cpu 1.651 total
pkg-depgraph moonlight 0.05s user 0.00s system 38% cpu 0.139 total
dot -Tpng -opkg-dep-moonlight.png 1.41s user 0.09s system 85% cpu 1.755 total
time ./pactree.sh -g moonlight
./pactree.sh -g moonlight 5.39s user 2.04s system 79% cpu 9.338 total
./pactree.sh -g moonlight 5.34s user 2.09s system 90% cpu 8.201 total
./pactree.sh -g moonlight 5.29s user 2.12s system 90% cpu 8.181 total
Since chicken is a scheme-to-c compiler, pkg-depgraph can also be compiled as a static binary.
Last edited by scj (2009-03-07 19:44:38)
Offline
We accept any patches to pactree to make it faster...
Offline
wow, that was pretty sweet. also, where is pactree.sh?
KISS = "It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience." - Albert Einstein
Offline
also, where is pactree.sh?
pactree is part of pacman-contrib.
Offline
pacman-contrib. neever heard about that one before pactree seemed to work fine and doens't need all these deps(sorry for saying that in this thread scj, but you kind of brought it on.)?
KISS = "It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience." - Albert Einstein
Offline
pacman-contrib. neever heard about that one before
pactree seemed to work fine and doens't need all these deps(sorry for saying that in this thread scj, but you kind of brought it on.)?
As for "all these deps", it is possible to build it as a static binary, making chicken a makedepends instead. But in any case, use it or don't, I don't really care. If you ever find yourself looking at alot of dependency graphs, pkg-depgraph might save you a few milliseconds at a time.
Offline