X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=gpgsigs%2Fgpgsigs;h=e27b33691561e3c40d7b305d87258feb6e11ec6f;hb=8b16f5d3cdfc8dd2886d86fabd7467c65b687c86;hp=af1a379530429fe8c09d3280ab71cdeb1b9b8db4;hpb=f09cfb5ddbcfaf4ba0247f86fadac60dc3a5e1b1;p=pgp-tools.git diff --git a/gpgsigs/gpgsigs b/gpgsigs/gpgsigs index af1a379..e27b336 100755 --- a/gpgsigs/gpgsigs +++ b/gpgsigs/gpgsigs @@ -20,6 +20,7 @@ # see the Debian changelog for further changes. my $VERSION = qq$Rev$; +$ENV{PATH} .= ":/usr/share/signing-party"; use strict; use warnings; @@ -54,6 +55,8 @@ separate multiple keyids with ',' -r call gpg --recv-keys before proceeding -f convert from charset -t convert UIDs to charset in output +--refresh regenerate UID lists on keys +--latex generate LaTeX output including photo IDs EOF exit $error; } @@ -150,32 +153,38 @@ print STDERR "Running --list-sigs, this will take a while "; open SIGS, "gpg --fixed-list-mode --with-colons --list-sigs @mykeys @keys 2>/dev/null |" or die "can't get gpg listing"; -my ($key, $uid, $sigs, $uidstatus); +my ($key, $uid, $sigs, $photocount); while () { if ( m/^pub:(?:.*?:){3,3}([0-9A-F]{16,16}):/ ) { $key = $1; print STDERR "."; + undef $photocount; next; } if ( m/^uid:(.):(?:.*?:){7,7}(.*):/s ) { - $uidstatus = $1; + my $uidstatus = $1; $uid = $2; $uid =~ s/\\x([0-9a-f][0-9a-f])/ chr(hex($1)) /gie; $uid = myrecode($uid, "UTF-8", $charset); my ($shortkey) = substr $key, -8; # Remember non-revoked uids - if ($uidstatus ne "r") { - push @{$uids{$shortkey}}, $uid; - } - + next if $uidstatus eq "r"; + push @{$uids{$shortkey}}, $uid; next; } - if ( m/^uat:(.):/ ) { # uat:-::::2006-08-03::27BAEAF742BD253C2F3F03B043DC1536880193C4::1 7993: - $uidstatus = $1; - next if $uidstatus ne "-"; - system "gpg --photo-viewer 'convert - %k.eps' --list-options show-photos --list-key $key"; - $uid = "Photo ID"; + if ( m/^uat:(.)::::[^:]+::([0-9A-F]+)::\d+ (\d+)/ ) { # uat:-::::2006-08-03::27BAEAF742BD253C2F3F03B043DC1536880193C4::1 7993: + my $uidstatus = $1; + # $2 is hash of attribute data + my $size = $3 - 19; # FIXME: find a nicer way to find out picture size + $uid = "[jpeg image of size $size]"; + next if $uidstatus eq "r"; + if ($latex and not $photocount) { # call once per key + my ($shortkey) = substr $key, -8; + system "rm $shortkey.[1-9]*.eps"; + system "gpg --photo-viewer 'gpgsigs-eps-helper $shortkey' --list-options show-photos --list-key $key > /dev/null"; + $photocount = 1; + } my ($shortkey) = substr $key, -8; push @{$uids{$shortkey}}, $uid; next; @@ -314,6 +323,7 @@ while () { # next; #} print WRITE; + undef $photocount; next; } @@ -329,9 +339,10 @@ while () { if ($refresh or $latex) { foreach $uid (@{$uids{$key}}) { print WRITE print_tag($key, $uid) . " $uid\n"; - if ($latex and ($uid eq "Photo ID")) { + if ($latex and ($uid =~ /^\[jpeg image/)) { + $photocount++; print WRITE "\\begin{flushright}\n"; - print WRITE "\\includegraphics[height=3cm]{$key.eps}\n"; + print WRITE "\\includegraphics[height=3cm]{$key.$photocount.eps}\n"; print WRITE "\\end{flushright}\n"; } } @@ -386,7 +397,7 @@ B - annotate list of GnuPG keys with already done signatures =head1 SYNOPSIS -B [-r] [-f I] [-t I] II<[>B<,>IB<,>I<...>I<]>>I<]> F [F] +B [I] II<[>B<,>IB<,>I<...>I<]>>I<]> F [F] =head1 DESCRIPTION @@ -400,19 +411,29 @@ and placeholders (C<__ __>), the checksum is inserted. =over -=item -r +=item B<-r> Call I before creating the output. -=item -f I +=item B<-f> I Convert F from I. The default is ISO-8859-1. -=item -t I +=item B<-t> I Convert UIDs to I. The default is derived from LC_ALL, LC_CTYPE, and LANG, and if all these are unset, the default is ISO-8859-1. +=item B<--refresh> + +Refresh the UID lists per key from gpg. Useful when UIDs were added or revoked +since the input text was generated. + +=item B<--latex> + +Generate LaTeX output, including photo IDs. Implies B<--refresh>. +B This writes eps files to the current directory. + =item I Use this keyid (8 or 16 byte) for annotation. Multiple keyids can be separated