From b42129b3270c76bf0c9a90bc29ec46f1e2d2a233 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= <anarcat@koumbit.org>
Date: Sun, 14 Sep 2014 00:48:12 -0400
Subject: [PATCH] try to skip weird out of place gnupg message to sign zack's
 key

---
 monkeysign/gpg.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/monkeysign/gpg.py b/monkeysign/gpg.py
index e589222..8507a4c 100644
--- a/monkeysign/gpg.py
+++ b/monkeysign/gpg.py
@@ -460,6 +460,15 @@ class Keyring():
         except GpgProtocolError as e:
             if 'sign_uid.okay' in str(e):
                 multiuid = False
+            elif '[GNUPG:]' not in str(e):
+                # this is not a protocol message, try again but skipping now
+                # this was necessary in order to sign Zack's key, as it was spewing:
+                # gpg: moving a key signature to the correct place
+                # instead of a [GNUGPG:] message
+                try:
+                    multiuid = self.context.seek(proc.stderr, 'GET_BOOL keyedit.sign_all.okay')
+                except GpgProtocolError as e:
+                    raise GpgRuntimeError(self.context.returncode, _('cannot sign: %s') % re.sub(r'^.*found "(.*)', r'\1', str(e)).decode('utf-8'))
             else:
                 raise GpgRuntimeError(self.context.returncode, _('cannot sign: %s') % re.sub(r'^.*found "(.*)', r'\1', str(e)).decode('utf-8'))
         if multiuid:
-- 
GitLab