Your message dated Sun, 25 Nov 2007 19:17:03 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#452641: fixed in jetring 0.10
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: jetring
Version: 0.09
Severity: important
Tags: patch

It seems that jetring-diff doesn't take account of the fact that each
signature packet is associated with a specific other PGP packet; as a
result displaying a diff results in all the new sigs being shown at the
end rather than displaying which uid/subkey etc they are for. This
strikes me as fairly important - when diffing keys you care about
whether a self sig is just another one on the uid or actually updating a
subkey binding, which currently it's hard to tell.

I think the attached patch solves the problem, though there's probably a
cleaner way to do it.

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (750, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.23-toshacpi (PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages jetring depends on:
ii  gnupg                         1.4.6-2    GNU privacy guard - a free PGP rep

jetring recommends no packages.

-- no debconf information
--- jetring-diff        2007-11-24 09:22:45.000000000 +0000
+++ jetring-diff.new    2007-11-24 09:25:54.000000000 +0000
@@ -27,23 +27,30 @@
        else {
                my $diff=0;
                my @out;
-               my %lseen=map { comparable($_) => 1 } @{$l->{$id}};
-               my %rseen=map { comparable($_) => 1 } @{$r->{$id}};
-               foreach my $record (@{$l->{$id}}) {
-                       if ($rseen{comparable($record)}) {
-                               push @out, " ".outformat($record) if 
$record->[0] ne 'sig';
-                       }
-                       else {
-                               push @out, "-".outformat($record);
-                               $diff=1;
+
+               my %rpackets = map { comparable($_->{'details'}) => $_ }
+                               @{$r->{$id}};
+               my %lpackets = map { comparable($_->{'details'}) => 1 }
+                               @{$l->{$id}};
+
+               foreach my $packet (@{$l->{$id}}) {
+                       if 
(defined($rpackets{comparable($packet->{'details'})})) {
+                               push @out, " ".outformat($packet->{'details'});
+                               push @out, comparesigs(\$diff, 
$packet->{'sigs'},
+                                               
$rpackets{comparable($packet->{'details'})}->{'sigs'});
+                       } else {
+                               push @out, "-".outformat($packet->{'details'});
+                               $diff = 1;
                        }
                }
-               foreach my $record (@{$r->{$id}}) {
-                       if (! $lseen{comparable($record)}) {
-                               push @out, "+".outformat($record);
-                               $diff=1;
+
+               foreach my $packet (@{$r->{$id}}) {
+                       if (! $lpackets{comparable($packet->{'details'})}) {
+                               push @out, "+".outformat($packet->{'details'});
+                               $diff = 1;
                        }
                }
+
                print @out if $diff;
        }
 }
@@ -72,12 +79,13 @@
                open(DUMP, "gpg --options /dev/null --no-default-keyring 
--no-auto-check-trustdb --keyring $k --list-sigs --fixed-list-mode 
--with-colons |") 
                        or die "couldn't dump keyring $k: $!";
                if (! open(CACHE, ">$cache")) {
-                       print STDERR "watning: cannot write cache $cache\n";
+                       print STDERR "warning: cannot write cache $cache\n";
                        $cache=undef;
                }
        }
        my %keys;
        my $id;
+       my $packet;
        while (<DUMP>) {
                if (! $cached && defined $cache) {
                        print CACHE $_;
@@ -90,12 +98,21 @@
                if ($fields[0] eq 'pub') {
                        $id=$fields[4];
                }
-               if (! defined $id) {
-                       die "parse error: $_";
-                       next;
+               if ($fields[0] ne 'sig' && $fields[0] ne 'rev') {
+                       if (defined($packet)) {
+                               push @{$keys{$id}}, $packet;
+                               undef $packet;
+                       }
+                       $packet->{'details'} = [EMAIL PROTECTED];
+               } else {
+                       if (! defined $id or !defined($packet)) {
+                               die "parse error: $_";
+                               next;
+                       }
+                       push @{$packet->{'sigs'}}, [EMAIL PROTECTED];
                }
-               push @{$keys{$id}}, [EMAIL PROTECTED];
        }
+       push @{$keys{$id}}, $packet;
        close DUMP;
 
        if (defined $cache) {
@@ -130,3 +147,27 @@
        }
        return join(":", @record);
 }
+
+sub comparesigs {
+       my $diff = shift;
+       my $l = shift;
+       my $r = shift;
+       my %lseen = map { comparable($_) => 1 } @{$l};
+       my %rseen = map { comparable($_) => 1 } @{$r};
+       my @out;
+
+       foreach my $record (@{$l}) {
+               if (! $rseen{comparable($record)}) {
+                       push @out, "-".outformat($record);
+                       ${$diff} = 1;
+               }
+       }
+       foreach my $record (@{$r}) {
+               if (! $lseen{comparable($record)}) {
+                       push @out, "+".outformat($record);
+                       ${$diff} = 1;
+               }
+       }
+
+       return @out;
+}

--- End Message ---
--- Begin Message ---
Source: jetring
Source-Version: 0.10

We believe that the bug you reported is fixed in the latest version of
jetring, which is due to be installed in the Debian FTP archive:

jetring_0.10.dsc
  to pool/main/j/jetring/jetring_0.10.dsc
jetring_0.10.tar.gz
  to pool/main/j/jetring/jetring_0.10.tar.gz
jetring_0.10_all.deb
  to pool/main/j/jetring/jetring_0.10_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Joey Hess <[EMAIL PROTECTED]> (supplier of updated jetring package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sun, 25 Nov 2007 14:02:00 -0500
Source: jetring
Binary: jetring
Architecture: source all
Version: 0.10
Distribution: unstable
Urgency: low
Maintainer: Joey Hess <[EMAIL PROTECTED]>
Changed-By: Joey Hess <[EMAIL PROTECTED]>
Description: 
 jetring    - gpg keyring mantainance using changesets
Closes: 452641
Changes: 
 jetring (0.10) unstable; urgency=low
 .
   * jetring-diff: Order lines in the diff to make clear if a signature
     is added/removed from a subkey, or from the main uid. Previously,
     signatures were always shown at the end.
     Patch from Jonathan McDowell. Closes: #452641
Files: 
 09e04271a083721afc86dba1a6b76625 589 utils optional jetring_0.10.dsc
 233b467b5c6674fd78ee27552a6e6e83 190239 utils optional jetring_0.10.tar.gz
 521e39133542a5964933d3c6541a131a 187482 utils optional jetring_0.10_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHSca/2tp5zXiKP0wRAvloAKCs1IKfrByfBSHsh37qt/moVPCjnACg0bmx
ShauAPf8ybhjxARml8FOTss=
=B2U4
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to