On 2013-08-17 18:34:59, Micah Anderson wrote:
> I noticed that monkeysign will happily do a sign and mail of a
> signature on a key that you already have a signature on. This is
> suboptimal because then the person will get all those mails and import
> that signature and then send it to the keyring, when they have already
> done that.
>
> Monkeysign should determine that the key has already been signed and
> not go ahead and tell you that you already did that one

Please try the following patch:

commit 67cf1ca78f72be4fdc62b4744c725fc3e5e9d721
Author: Antoine Beaupré <[email protected]>
Date:   Mon Aug 19 10:30:37 2013 -0400

    try to handle cases where the key is already signed, see #720055

diff --git a/monkeysign/gpg.py b/monkeysign/gpg.py
index 913fb5c..77b78a2 100644
--- a/monkeysign/gpg.py
+++ b/monkeysign/gpg.py
@@ -457,8 +457,11 @@ class Keyring():
                 # confirm signature
                 try:
                     self.context.expect(proc.stderr, 'GET_BOOL sign_uid.okay')
-                except GpgProtocolError:
-                    raise GpgRuntimeError(self.context.returncode, _('unable 
to open key for editing: %s') % self.context.stderr.decode('utf-8'))
+                except GpgProtocolError as e:
+                    if 'sign_uid.dupe_okay' in str(e):
+                        raise GpgRuntimeError(self.context.returncode, _('you 
already signed that key'))
+                    else:
+                        raise GpgRuntimeError(self.context.returncode, 
_('unable to open key for editing: %s') % self.context.stderr.decode('utf-8'))
                 print >>proc.stdin, 'y'
                 self.context.expect(proc.stderr, 'GOT_IT')
                 # expect the passphrase confirmation

now in git.

a.
-- 
Le Québec ne rêve plus de devenir une société modèle: voilà son
problème d'environnement.
                        - Pierre Dansereau (1911 - 2011)

Attachment: pgp8VqOoDtERS.pgp
Description: PGP signature

Reply via email to