cscvs to tla changeset 1
[onak.git] / gpgstats-0.0.2 / gpgpre
1 #!/usr/bin/perl -Tw
2 # Written by Jonathan McDowell <noodles@earth.li>
3 # Copyright 2000 Project Purple.
4 # Dedicated to linguists called Simon everywhere.
5 #
6 # Processes the output of gpg -v --list-keys to a format gpgstats likes.
7 #
8 # Try:
9 # gpg -v --list-keys | ./gpgpre | uniq > keyfile
10 #
11 # I should really include the uniq in the code.
12
13 use strict;
14
15 my ($curline);
16
17 while ($curline = <>) {
18         chomp $curline;
19
20         if ($curline =~ /^pub.*\/([0-9a-fA-F]{8}) [0-9-\/]{10} (.*)/) {
21                 print "P$1\n";
22                 print "N$2\n";
23         } elsif ($curline =~ /^sig *([0-9a-fA-F]{8})/) {
24                 print "S$1\n";
25         }
26 }