From: tokkee Date: Fri, 19 Aug 2011 10:02:51 +0000 (+0000) Subject: gpgsigs: In LaTeX mode, use the samepage env to not split entries at pagebreaks. X-Git-Url: https://git.sthu.org/?a=commitdiff_plain;h=66c2228f897a924e7d19a6bb4eb4e8e460c6e13d;p=pgp-tools.git gpgsigs: In LaTeX mode, use the samepage env to not split entries at pagebreaks. git-svn-id: svn://svn.debian.org/pgp-tools/trunk@482 b513b33f-fedd-0310-b452-c3deb5f4c849 --- diff --git a/gpgsigs/gpgsigs b/gpgsigs/gpgsigs index cc7bad0..50505d2 100755 --- a/gpgsigs/gpgsigs +++ b/gpgsigs/gpgsigs @@ -297,6 +297,7 @@ sub print_tag $key = undef; $uid = undef; my $line = 0; +my $keys = 0; print STDERR "Annotating $keytxt, writing into $outfile\n"; open (TXT, $keytxt) or die ("Cannot open $keytxt\n"); open (WRITE, '>'.$outfile) or die ("Cannot open $outfile for writing\n"); @@ -328,6 +329,19 @@ while () { if (/^RIPEMD160 Checksum:/ && defined $RIPEMD160) { s/[_[:xdigit:]][_ [:xdigit:]]+_/$RIPEMD160/; } + + if ( m/^[0-9]+\s+\[ \] Fingerprint OK/ ){ + if ($latex) { + if ($keys > 0) { + print WRITE "\\end{samepage}\n"; + } + print WRITE "\\begin{samepage}\n"; + ++$keys; + } + print WRITE; + next; + } + if ( m/^pub +(?:\d+)[DR]\/([0-9A-F]{8}) [0-9]{4}-[0-9]{2}-[0-9]{2} *(.*)/ ) { $key = $1; $uid = $2; @@ -377,6 +391,10 @@ while () { print WRITE; } +if ($latex && ($keys > 0)) { + print WRITE "\\end{samepage}\n"; +} + print WRITE "Legend:\n"; my $num_myuids = 0; foreach my $i (0 .. @mykeys - 1) {