#!/usr/bin/perl

$cmd = "gpg --option $ARGV[0]/options --list-keys";

print "Non-reciprocating signers\n";
print "\n";
print `cat $ARGV[0]/non-recip.in`;
print "
 Name Key ID Slackness Excuse
\n";

while (<STDIN>) {
	s/Key //;
	($key,$number) = split(/ has not signed /, $_, 2);
	$name = `$cmd $key |head -1`;
	chomp $name;
	$name =~ s#.*-[0-9][0-9] ##;
	$name =~ s/&/&/;
	$name =~ s/</</;
	$name =~ s/>/>/;
	$name =~ s/\([^)]*\)//;

	$number =~ s/://;
	chomp $number;

	$excuse = `grep -s $key $ARGV[0]/excuses`;
	chomp $excuse;
	$excuse =~ s/$key //;

	print "<tr><td>$name</td><td>$key</td><td>$number</td><td>$excuse</td></tr>\n";
}

print "
";
