* gpgsigs: correctly handle keys with several photo ids via a helper script
authormyon <myon@b513b33f-fedd-0310-b452-c3deb5f4c849>
Sun, 16 Mar 2008 19:44:17 +0000 (19:44 +0000)
committermyon <myon@b513b33f-fedd-0310-b452-c3deb5f4c849>
Sun, 16 Mar 2008 19:44:17 +0000 (19:44 +0000)
  in /usr/share/signing-party/ (Closes: #453840).

git-svn-id: svn://svn.debian.org/pgp-tools/trunk@373 b513b33f-fedd-0310-b452-c3deb5f4c849

debian/changelog
debian/install
debian/rules
gpgsigs/Makefile
gpgsigs/gpgsigs
gpgsigs/gpgsigs-eps-helper [new file with mode: 0755]

index 55de015c250e538387a4069315b528bd20ceac60..236c8c88e4d768e31f6b040580d9d013be79e2b9 100644 (file)
@@ -9,6 +9,8 @@ signing-party (1.0-1) unreleased; urgency=low
     as separate packages. We shamelessly bump our version number to something
     greater, and build transitional packages.
   * gpg-key2ps: also handle revoked subkeys (Closes: #467001).
+  * gpgsigs: correctly handle keys with several photo ids via a helper script
+    in /usr/share/signing-party/ (Closes: #453840).
   * Start moving the installation machinery from debian/* to Makefiles.
 
   [ Thijs Kinkhorst ]
@@ -22,7 +24,7 @@ signing-party (1.0-1) unreleased; urgency=low
   * caff: always update the user's key from their GnuPG home, to adequately
     cope with changed keys (Closes: #462897).
 
- -- Christoph Berg <myon@debian.org>  Sun, 16 Mar 2008 19:39:54 +0100
+ -- Christoph Berg <myon@debian.org>  Sun, 16 Mar 2008 20:38:23 +0100
 
 signing-party (0.4.13-1) unstable; urgency=low
 
index 82bae7b76c69c0de801d4d3a3127952df7e61581..82ffc8725989c8b17e948f0b5a1b89c307b618a3 100644 (file)
@@ -2,7 +2,6 @@ caff/caff usr/bin
 caff/pgp-clean usr/bin
 caff/pgp-fixkey usr/bin
 gpglist/gpglist usr/bin
-gpgsigs/gpgsigs usr/bin
 gpg-key2ps/gpg-key2ps usr/bin
 gpg-mailkeys/gpg-mailkeys usr/bin
 gpgparticipants/gpgparticipants usr/bin
index 64b089221ecd2520bbf83ff39f57ce5557804a8a..ac2a8f59128a8e8728fe41027c132f34d2f2cf60 100755 (executable)
@@ -35,8 +35,6 @@ install: build
                caff/README.v3-keys \
                caff/caffrc.sample \
                        $(CURDIR)/debian/signing-party/usr/share/doc/signing-party/caff
-       install -d $(CURDIR)/debian/signing-party/usr/share/doc/signing-party/gpgsigs/examples
-       install -m 644 gpgsigs/gpgsigs-lt2k5*.txt $(CURDIR)/debian/signing-party/usr/share/doc/signing-party/gpgsigs/examples
        install -d $(CURDIR)/debian/signing-party/usr/share/lintian/overrides
        install -m 644 debian/overrides/signing-party $(CURDIR)/debian/signing-party/usr/share/lintian/overrides
 
index 760d54cbe9ef8ca2c512cc5fa3011d56f837d3e5..7c611776a90c331324addc122cc8b0558c9f98f7 100644 (file)
@@ -4,6 +4,12 @@ gpgsigs.1: gpgsigs
        pod2man $< > $@
 
 install:
+       install -D gpgsigs $(DESTDIR)/usr/bin/gpgsigs
+       install -D gpgsigs-eps-helper \
+               $(DESTDIR)/usr/share/signing-party/gpgsigs-eps-helper
+       install -d $(DESTDIR)/usr/share/doc/signing-party/gpgsigs/examples
+       install -m644 gpgsigs-lt2k5*.txt \
+               $(DESTDIR)/usr/share/doc/signing-party/gpgsigs/examples
 
 clean:
        rm -f gpgsigs.1
index 2c4da429ac0290e5ea9ac7a82122f354bedfc503..e27b33691561e3c40d7b305d87258feb6e11ec6f 100755 (executable)
@@ -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;
@@ -152,11 +153,12 @@ 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);
+my ($key, $uid, $sigs, $photocount);
 while (<SIGS>) {
        if ( m/^pub:(?:.*?:){3,3}([0-9A-F]{16,16}):/ ) {
                $key = $1;
                print STDERR ".";
+               undef $photocount;
                next;
        }
        if ( m/^uid:(.):(?:.*?:){7,7}(.*):/s ) {
@@ -177,8 +179,11 @@ while (<SIGS>) {
                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) {
-                       system "gpg --photo-viewer 'convert - %k.eps' --list-options show-photos --list-key $key > /dev/null";
+               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;
@@ -318,6 +323,7 @@ while (<TXT>) {
                #       next;
                #}
                print WRITE;
+               undef $photocount;
                next;
        }
 
@@ -334,8 +340,9 @@ while (<TXT>) {
                        foreach $uid (@{$uids{$key}}) {
                                print WRITE print_tag($key, $uid) . " $uid\n";
                                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";
                                }
                        }
@@ -425,6 +432,7 @@ since the input text was generated.
 =item B<--latex>
 
 Generate LaTeX output, including photo IDs. Implies B<--refresh>.
+B<Note:> This writes eps files to the current directory.
 
 =item I<keyid>
 
diff --git a/gpgsigs/gpgsigs-eps-helper b/gpgsigs/gpgsigs-eps-helper
new file mode 100755 (executable)
index 0000000..544eae3
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+ID="$1"
+NUM=1
+
+while test -e $ID.$NUM.eps ; do
+       NUM=`expr $NUM + 1`
+done
+
+convert - $ID.$NUM.eps