[Pgp-tools-commit] r373 - in trunk: debian gpgsigs

myon at alioth.debian.org myon at alioth.debian.org
Sun Mar 16 19:44:18 UTC 2008


Author: myon
Date: 2008-03-16 19:44:17 +0000 (Sun, 16 Mar 2008)
New Revision: 373

Added:
   trunk/gpgsigs/gpgsigs-eps-helper
Modified:
   trunk/debian/changelog
   trunk/debian/install
   trunk/debian/rules
   trunk/gpgsigs/Makefile
   trunk/gpgsigs/gpgsigs
Log:
* gpgsigs: correctly handle keys with several photo ids via a helper script
  in /usr/share/signing-party/ (Closes: #453840).

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2008-03-16 18:41:31 UTC (rev 372)
+++ trunk/debian/changelog	2008-03-16 19:44:17 UTC (rev 373)
@@ -9,6 +9,8 @@
     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 @@
   * caff: always update the user's key from their GnuPG home, to adequately
     cope with changed keys (Closes: #462897).
 
- -- Christoph Berg <myon at debian.org>  Sun, 16 Mar 2008 19:39:54 +0100
+ -- Christoph Berg <myon at debian.org>  Sun, 16 Mar 2008 20:38:23 +0100
 
 signing-party (0.4.13-1) unstable; urgency=low
 

Modified: trunk/debian/install
===================================================================
--- trunk/debian/install	2008-03-16 18:41:31 UTC (rev 372)
+++ trunk/debian/install	2008-03-16 19:44:17 UTC (rev 373)
@@ -2,7 +2,6 @@
 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

Modified: trunk/debian/rules
===================================================================
--- trunk/debian/rules	2008-03-16 18:41:31 UTC (rev 372)
+++ trunk/debian/rules	2008-03-16 19:44:17 UTC (rev 373)
@@ -35,8 +35,6 @@
 		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
 

Modified: trunk/gpgsigs/Makefile
===================================================================
--- trunk/gpgsigs/Makefile	2008-03-16 18:41:31 UTC (rev 372)
+++ trunk/gpgsigs/Makefile	2008-03-16 19:44:17 UTC (rev 373)
@@ -4,6 +4,12 @@
 	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

Modified: trunk/gpgsigs/gpgsigs
===================================================================
--- trunk/gpgsigs/gpgsigs	2008-03-16 18:41:31 UTC (rev 372)
+++ trunk/gpgsigs/gpgsigs	2008-03-16 19:44:17 UTC (rev 373)
@@ -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 @@
 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 @@
 		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 @@
 		#	next;
 		#}
 		print WRITE;
+		undef $photocount;
 		next;
 	}
 
@@ -334,8 +340,9 @@
 			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 @@
 =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>
 

Added: trunk/gpgsigs/gpgsigs-eps-helper
===================================================================
--- trunk/gpgsigs/gpgsigs-eps-helper	                        (rev 0)
+++ trunk/gpgsigs/gpgsigs-eps-helper	2008-03-16 19:44:17 UTC (rev 373)
@@ -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


Property changes on: trunk/gpgsigs/gpgsigs-eps-helper
___________________________________________________________________
Name: svn:executable
   + *




More information about the Pgp-tools-commit mailing list