[ILUG] graphing redhat

From: Waider (waider at domain waider.ie)
Date: Tue 23 Jul 2002 - 16:24:25 IST


Vaguely in the tone of previously mentioned efforts, but without
anything remotely close to the diligence: this script will produce a
file called dep.graph in the current directory, which dot/dotty from the
graphviz package will render into a directed graph showing you package
dependencies on your redhat system. I'm sure someone can have fun with this.

Cheers,
Waider.

------------------------->8-----------------------------------------
#!/bin/sh

# Start of graph file
echo "digraph dep {" > dep.graph

for i in `rpm -qa --queryformat "%{NAME}\n"`
do
   # Get the package name + version
   name=`rpm -q $i`
   echo $name >&2
   if rpm -q --whatrequires $i > /dev/null 2>&1
   then
   for dep in `rpm -q --whatrequires $i --queryformat "%{NAME}\n"`
   do
     echo "\"$dep\" -> \"$i\";" >> dep.graph
   done
   fi
done

# End of graph file
echo "}" >> dep.graph
------------------------->8-----------------------------------------

-- 
waider at domain waider.ie / Yes, it /is/ very personal of me


This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:18:01 GMT