Monday, November 8, 2010

XBPS: creating dot(1) graphs for metadata properties on installed pkgs

For the past days (well, only Sunday to be exact) I've been coding an application to automate the generation of dot(1) graphs for installed packages with XBPS, exactly for package's metadata properties; those such as dependencies, reverse dependencies, configuration files, etc. The code is 500 LOC and generates customized dot files through properties set in a configuration plist file. I'm sorry if you don't like XML, I don't care :-)

Basically the steps you have to do are the following:


$ xbps-dgraph -g [to generate the config file]
$ xbps-dgraph pkgname [to generate the .dot file]
$ dot -Tpng pkgname -o pkgname.png [to generate the png image]

 You can also add/change/remove properties for graph, edges and nodes through the configuration file (xbps-dgraph.conf by default).

The following are some graphs from packages installed on my system, please note that some packages will genererate a really LARGE image if it contains many nodes. I hope you enjoy the graphs as I do; xbps-dgraph will appear in the next upcoming XBPS release... perhaps in a few days :-)