Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Meet your dependency graph up close!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Floe
n00b
n00b


Joined: 20 Sep 2005
Posts: 19
Location: Munich, Germany

PostPosted: Thu Nov 22, 2007 4:48 pm    Post subject: Meet your dependency graph up close! Reply with quote

I have always wanted a more visual representation of the portage dependency graph, so I put together a little script:

Code:

#!/bin/bash

cd /var/db/pkg
pkglist=$(find . -maxdepth 2 -type d | cut -c3- | grep /)

{
        echo "// gentoo package dependency graph"
        echo "// machine: $(hostname)"
        echo "// started at: $(date)"
        echo 'digraph depgraph {'
        echo '  ranksep=1'
        echo '  nodesep=1'
        echo '  overlap=false'

        for pkg in ${pkglist} ; do
                equery depends =${pkg} | cut -d'(' -f1 | sed -e 's%\(.*\)%  "\0" -> "'${pkg}'"%g'
        done

        echo '}'

}
#| tee depgraph.dot | twopi -Tps


Just pipe the output of this script into depgraph.dot and feed that into twopi (media-gfx/graphviz).
The only problem left now is finding an image viewer that can actually handle such a huge graph.. :D

Yours, Florian

P.S. I know very well that this is entirely unelegant and slow. So please improve it!
_________________
CU Floe
Back to top
View user's profile Send private message
Kasumi_Ninja
Veteran
Veteran


Joined: 18 Feb 2006
Posts: 1825
Location: The Netherlands

PostPosted: Thu Nov 22, 2007 7:25 pm    Post subject: Reply with quote

Kewl idea :)
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Back to top
View user's profile Send private message
dantrell
n00b
n00b


Joined: 01 Jun 2007
Posts: 30
Location: United States

PostPosted: Mon Apr 14, 2008 10:09 am    Post subject: Re: Meet your dependency graph up close! Reply with quote

Floe wrote:
[...]
The only problem left now is finding an image viewer that can actually handle such a huge graph.. :D
[...]

Did you find an image viewer for the dot file?
_________________
Dantrell B.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum