3 # sig2dot v0.8 (c) Darxus@ChaosReigns.com, released under the GPL
4 # Download from: http://www.chaosreigns.com/debian-keyring
6 # Parses the (gpg) debian-keyring
7 # (http://www.debian.org/Packages/unstable/misc/debian-keyring.html) to a format
8 # suitable for use by dot or neato (package name graphviz,
9 # http://www.research.att.com/sw/tools/graphviz/) like so:
11 # gpg --list-sigs --keyring /usr/share/keyrings/debian-keyring.gpg | ./sig2dot.pl > debian-keyring.dot
12 # neato -Tps debian-keyring.dot > debian-keyring.neato.dot.ps
13 # dot -Tps debian-keyring.dot > debian-keyring.dot.dot.ps
15 while ($line = <STDIN>)
18 if ($line =~ m#([^ ]+) +[^ ]+ +[^ ]+ +([^<]+)#)
23 #print "type:$type:name:$name:\n";
30 if ($type eq "sig" and $name ne $owner and $name ne '[User id not found')
32 push (@{$sigs{$owner}},$name);
33 push (@names,$name,$owner);
36 print STDERR "Couldn't parse: $line\n";
40 print "digraph \"debian-keyring\" {\n";
47 for $owner (sort {$sigs{$a} <=> $sigs{$b}} keys %sigs)
50 @saw{@{$sigs{$owner}}} = ();
51 @{$sigs{$owner}} = keys %saw;
54 #print STDERR scalar(@{$sigs{$owner}})," $owner\n";
55 $count{$owner} = scalar(@{$sigs{$owner}});
58 open (STATS,">stats.html");
59 print STATS "<html><body><table border=1>\n";
61 for $owner (sort {$count{$b} <=> $count{$a}} keys %sigs)
63 print STATS "<tr><td>$owner<td>$count{$owner}<td><img src=\"/images/pipe0.jpg\" height=15 width=",$count{$owner} * 20,">\n";
66 print STATS "</table></body></html>\n";
69 print "node [style=filled]\n";
72 if ($count{$name} > 20)
74 print "\"$name\" [color=red]\n";
75 } elsif ($count{$name} > 8)
77 print "\"$name\" [color=blue]\n";
80 print "node [style=solid]\n";
82 for $owner (sort keys %sigs)
84 for $name (@{$sigs{$owner}})
86 print "\"$name\" -> \"$owner\" [len=5]\n";