[mutt] 01/01: upstream/837372-do-not-color-gpgme-output.patch: to maintain the same behavior as pgp.c when it comes to (not) coloring the gpgme output (Closes: 837372).

Antonio Radici antonio at moszumanska.debian.org
Sun Sep 11 15:43:48 UTC 2016


This is an automated email from the git hooks/post-receive script.

antonio pushed a commit to branch master
in repository mutt.

commit 4bb1c45ab93b1653e0c274484f6f7a690257d5a4
Author: Antonio Radici <antonio at debian.org>
Date:   Sun Sep 11 16:26:01 2016 +0100

    upstream/837372-do-not-color-gpgme-output.patch: to maintain the same behavior as pgp.c when it comes to (not) coloring the gpgme output (Closes: 837372).
---
 debian/changelog                                   |  12 +-
 debian/patches/series                              |   1 +
 .../837372-do-not-color-gpgme-output.patch         | 394 +++++++++++++++++++++
 3 files changed, 403 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 1958bfb..8f50167 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,13 @@
 mutt (1.7.0-4) UNRELEASED; urgency=medium
 
-  * debian/patches/neomutt-devel:
-    + 837416-avoid-segfault-when-listing-mailboxes-on-startup.patch: to prevent
-      segfaulting when mutt -y is launched (Closes: 837416).
-    + fix-array-bounds-error.patch: fix a off-by-one in neomutt.
+  * debian/patches:
+    + neomutt-devel/837416-avoid-segfault-when-listing-mailboxes\
+      -on-startup.patch: to prevent segfaulting when mutt -y is launched
+      (Closes: 837416).
+    + neomutt-devel/fix-array-bounds-error.patch: fix a off-by-one in neomutt.
+    + upstream/837372-do-not-color-gpgme-output.patch: to maintain the same
+      behavior as pgp.c when it comes to use the body color for the gpg output
+      (Closes: 837372).
 
  -- Antonio Radici <antonio at debian.org>  Sun, 11 Sep 2016 14:38:40 +0100
 
diff --git a/debian/patches/series b/debian/patches/series
index 2d45bcf..db5883b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -25,4 +25,5 @@ upstream/749483-conststrings.patch
 upstream/833192-preserve-messageid-for-postponed-emails.patch
 upstream/644992-ipv6-literal.patch
 upstream/549204-clear-N-on-readonly-imap-folders.patch
+upstream/837372-do-not-color-gpgme-output.patch
 upstream/openssl-1.1-build.patch
diff --git a/debian/patches/upstream/837372-do-not-color-gpgme-output.patch b/debian/patches/upstream/837372-do-not-color-gpgme-output.patch
new file mode 100644
index 0000000..9639618
--- /dev/null
+++ b/debian/patches/upstream/837372-do-not-color-gpgme-output.patch
@@ -0,0 +1,394 @@
+Use body color for gpgme output.
+
+When switching from pgp_* commands to crypt_use_gpgme=yes, Peter Colberg noticed
+that the output was colored 'brightyellow'.
+
+The issue is taht crypt-gpgme.c uses state_attach_puts in various places where
+it should use state_puts to maintain compatibility with the previous behavior in
+pgp.c.
+
+Debian bug: http://bugs.debian.org/837372
+Upstream issue: http://bugs.mutt.org/3872
+
+--- a/crypt-gpgme.c
++++ b/crypt-gpgme.c
+@@ -876,7 +876,7 @@
+   strftime (p, sizeof (p), "%c", localtime (&t));
+ #endif
+   setlocale (LC_TIME, "C");
+-  state_attach_puts (p, s);
++  state_puts (p, s);
+ }
+ 
+ /* 
+@@ -1141,7 +1141,7 @@
+ 
+   if ((sum & GPGME_SIGSUM_KEY_REVOKED))
+     {
+-      state_attach_puts (_("Warning: One of the keys has been revoked\n"),s);
++      state_puts (_("Warning: One of the keys has been revoked\n"),s);
+       severe = 1;
+     }
+ 
+@@ -1150,13 +1150,13 @@
+       time_t at = key->subkeys->expires ? key->subkeys->expires : 0;
+       if (at)
+         {
+-          state_attach_puts (_("Warning: The key used to create the "
++          state_puts (_("Warning: The key used to create the "
+                                "signature expired at: "), s);
+           print_time (at , s);
+-          state_attach_puts ("\n", s);
++          state_puts ("\n", s);
+         }
+       else
+-        state_attach_puts (_("Warning: At least one certification key "
++        state_puts (_("Warning: At least one certification key "
+                              "has expired\n"), s);
+     }
+ 
+@@ -1172,29 +1172,29 @@
+            sig = sig->next, i++)
+         ;
+       
+-      state_attach_puts (_("Warning: The signature expired at: "), s);
++      state_puts (_("Warning: The signature expired at: "), s);
+       print_time (sig ? sig->exp_timestamp : 0, s);
+-      state_attach_puts ("\n", s);
++      state_puts ("\n", s);
+     }
+ 
+   if ((sum & GPGME_SIGSUM_KEY_MISSING))
+-    state_attach_puts (_("Can't verify due to a missing "
++    state_puts (_("Can't verify due to a missing "
+                          "key or certificate\n"), s);
+ 
+   if ((sum & GPGME_SIGSUM_CRL_MISSING))
+     {
+-      state_attach_puts (_("The CRL is not available\n"), s);
++      state_puts (_("The CRL is not available\n"), s);
+       severe = 1;
+     }
+ 
+   if ((sum & GPGME_SIGSUM_CRL_TOO_OLD))
+     {
+-      state_attach_puts (_("Available CRL is too old\n"), s);
++      state_puts (_("Available CRL is too old\n"), s);
+       severe = 1;
+     }
+ 
+   if ((sum & GPGME_SIGSUM_BAD_POLICY))
+-    state_attach_puts (_("A policy requirement was not met\n"), s);
++    state_puts (_("A policy requirement was not met\n"), s);
+ 
+   if ((sum & GPGME_SIGSUM_SYS_ERROR))
+     {
+@@ -1203,7 +1203,7 @@
+       gpgme_signature_t sig;
+       unsigned int i;
+ 
+-      state_attach_puts (_("A system error occurred"), s );
++      state_puts (_("A system error occurred"), s );
+ 
+       /* Try to figure out some more detailed system error information. */
+       result = gpgme_op_verify_result (ctx);
+@@ -1218,17 +1218,17 @@
+ 
+       if (t0 || t1)
+         {
+-          state_attach_puts (": ", s);
++          state_puts (": ", s);
+           if (t0)
+-              state_attach_puts (t0, s);
++              state_puts (t0, s);
+           if (t1 && !(t0 && !strcmp (t0, t1)))
+             {
+               if (t0)
+-                state_attach_puts (",", s);
+-              state_attach_puts (t1, s);
++                state_puts (",", s);
++              state_puts (t1, s);
+             }
+         }
+-      state_attach_puts ("\n", s);
++      state_puts ("\n", s);
+     }
+ 
+ #ifdef HAVE_GPGME_PKA_TRUST
+@@ -1237,16 +1237,16 @@
+     {
+       if (sig->pka_trust == 1 && sig->pka_address)
+ 	{
+-	  state_attach_puts (_("WARNING: PKA entry does not match "
++	  state_puts (_("WARNING: PKA entry does not match "
+ 			       "signer's address: "), s);
+-	  state_attach_puts (sig->pka_address, s);
+-	  state_attach_puts ("\n", s);
++	  state_puts (sig->pka_address, s);
++	  state_puts ("\n", s);
+ 	}
+       else if (sig->pka_trust == 2 && sig->pka_address)
+ 	{
+-	  state_attach_puts (_("PKA verified signer's address is: "), s);
+-	  state_attach_puts (sig->pka_address, s);
+-	  state_attach_puts ("\n", s);
++	  state_puts (_("PKA verified signer's address is: "), s);
++	  state_puts (sig->pka_address, s);
++	  state_puts ("\n", s);
+ 	}
+     }
+ 
+@@ -1303,7 +1303,7 @@
+     *p++ = *s;
+   *p++ = '\n';
+   *p = 0;
+-  state_attach_puts (buf, state);
++  state_puts (buf, state);
+   FREE (&buf);
+ }
+ 
+@@ -1341,7 +1341,7 @@
+ 	break;
+       }
+   if (txt)
+-    state_attach_puts (txt, s);
++    state_puts (txt, s);
+ }
+ 
+ static void print_smime_keyinfo (const char* msg, gpgme_signature_t sig,
+@@ -1351,8 +1351,8 @@
+   gpgme_user_id_t uids = NULL;
+   int i, aka = 0;
+ 
+-  state_attach_puts (msg, s);
+-  state_attach_puts (" ", s);
++  state_puts (msg, s);
++  state_puts (" ", s);
+   /* key is NULL when not present in the user's keyring */
+   if (key)
+   {
+@@ -1366,30 +1366,30 @@
+          * and "aka" translation length */
+ 	msglen = mutt_strlen (msg) - 4;
+ 	for (i = 0; i < msglen; i++)
+-	  state_attach_puts(" ", s);
+-	state_attach_puts(_("aka: "), s);
++	  state_puts(" ", s);
++	state_puts(_("aka: "), s);
+       }
+-      state_attach_puts (uids->uid, s);
+-      state_attach_puts ("\n", s);
++      state_puts (uids->uid, s);
++      state_puts ("\n", s);
+ 
+       aka = 1;
+     }
+   }
+   else
+   {
+-    state_attach_puts (_("KeyID "), s);
+-    state_attach_puts (sig->fpr, s);
+-    state_attach_puts ("\n", s);
++    state_puts (_("KeyID "), s);
++    state_puts (sig->fpr, s);
++    state_puts ("\n", s);
+   }
+ 
+   msglen = mutt_strlen (msg) - 8;
+   /* TODO: need to account for msg wide characters
+    * and "created" translation length */
+   for (i = 0; i < msglen; i++)
+-    state_attach_puts(" ", s);
+-  state_attach_puts (_("created: "), s);
++    state_puts(" ", s);
++  state_puts (_("created: "), s);
+   print_time (sig->timestamp, s);
+-  state_attach_puts ("\n", s);  
++  state_puts ("\n", s);
+ }
+ 
+ /* Show information about one signature.  This function is called with
+@@ -1461,7 +1461,7 @@
+           snprintf (buf, sizeof (buf),
+               _("Error getting key information for KeyID %s: %s\n"),
+               fpr, gpgme_strerror (err));
+-          state_attach_puts (buf, s);
++          state_puts (buf, s);
+           anybad = 1;
+ 	}
+       else if ((sum & GPGME_SIGSUM_GREEN))
+@@ -1496,9 +1496,9 @@
+           /* L10N:
+              This is trying to match the width of the
+              "Problem signature from:" translation just above. */
+-	  state_attach_puts (_("               expires: "), s);
++	  state_puts (_("               expires: "), s);
+ 	  print_time (sig->exp_timestamp, s);
+-	  state_attach_puts ("\n", s);
++	  state_puts ("\n", s);
+ 	}
+ 	show_sig_summary (sum, ctx, key, idx, s, sig);
+         anywarn = 1;
+@@ -1557,7 +1557,7 @@
+       snprintf (buf, sizeof(buf)-1, 
+                 _("Error: verification failed: %s\n"),
+                 gpgme_strerror (err));
+-      state_attach_puts (buf, s);
++      state_puts (buf, s);
+     }
+   else
+     { /* Verification succeeded, see what the result is. */
+@@ -1606,7 +1606,7 @@
+ 	    snprintf (buf, sizeof (buf),
+ 		      _("*** Begin Notation (signature by: %s) ***\n"),
+ 		      signature->fpr);
+-	    state_attach_puts (buf, s);
++	    state_puts (buf, s);
+ 	    for (notation = signature->notations; notation;
+                  notation = notation->next)
+ 	    {
+@@ -1615,18 +1615,18 @@
+ 
+ 	      if (notation->name)
+ 	      {
+-		state_attach_puts (notation->name, s);
+-		state_attach_puts ("=", s);
++		state_puts (notation->name, s);
++		state_puts ("=", s);
+ 	      }
+ 	      if (notation->value)
+ 	      {
+-		state_attach_puts (notation->value, s);
++		state_puts (notation->value, s);
+ 		if (!(*notation->value
+                       && (notation->value[strlen (notation->value)-1]=='\n')))
+-		  state_attach_puts ("\n", s);
++		  state_puts ("\n", s);
+ 	      }
+ 	    }
+-	    state_attach_puts (_("*** End Notation ***\n"), s);
++	    state_puts (_("*** End Notation ***\n"), s);
+ 	  }
+ 	}
+       }
+@@ -2440,7 +2440,7 @@
+                   snprintf (errbuf, sizeof(errbuf)-1, 
+                             _("Error: decryption/verification failed: %s\n"),
+                             gpgme_strerror (err));
+-                  state_attach_puts (errbuf, s);
++                  state_puts (errbuf, s);
+                 }
+               else
+                 { /* Decryption/Verification succeeded */
+@@ -2462,7 +2462,7 @@
+                       int res, idx;
+                       int anybad = 0;
+ 
+-                      state_attach_puts (_("[-- Begin signature "
++                      state_puts (_("[-- Begin signature "
+                                            "information --]\n"), s);
+                       have_any_sigs = 1;
+                       for(idx=0;
+@@ -2475,7 +2475,7 @@
+                       if (!anybad && idx)
+                         maybe_goodsig = 1;
+                       
+-                      state_attach_puts (_("[-- End signature "
++                      state_puts (_("[-- End signature "
+                                            "information --]\n\n"), s);
+                     }
+ 
+@@ -2483,7 +2483,7 @@
+                   if (!tmpfname)
+                     {
+                       pgpout = NULL;
+-                      state_attach_puts (_("Error: copy data failed\n"), s);
++                      state_puts (_("Error: copy data failed\n"), s);
+                     }
+                   else
+                     {
+@@ -2504,12 +2504,12 @@
+           if(s->flags & MUTT_DISPLAY)
+             {
+               if (needpass)
+-            state_attach_puts (_("[-- BEGIN PGP MESSAGE --]\n\n"), s);
++            state_puts (_("[-- BEGIN PGP MESSAGE --]\n\n"), s);
+               else if (pgp_keyblock)
+-                state_attach_puts (_("[-- BEGIN PGP PUBLIC KEY BLOCK --]\n"),
++                state_puts (_("[-- BEGIN PGP PUBLIC KEY BLOCK --]\n"),
+                                    s);
+               else
+-                state_attach_puts (_("[-- BEGIN PGP SIGNED MESSAGE --]\n\n"),
++                state_puts (_("[-- BEGIN PGP SIGNED MESSAGE --]\n\n"),
+                                    s);
+             }
+           
+@@ -2536,11 +2536,11 @@
+             {
+               state_putc ('\n', s);
+               if (needpass)
+-                state_attach_puts (_("[-- END PGP MESSAGE --]\n"), s);
++                state_puts (_("[-- END PGP MESSAGE --]\n"), s);
+               else if (pgp_keyblock)
+-                state_attach_puts (_("[-- END PGP PUBLIC KEY BLOCK --]\n"), s);
++                state_puts (_("[-- END PGP PUBLIC KEY BLOCK --]\n"), s);
+               else
+-                state_attach_puts (_("[-- END PGP SIGNED MESSAGE --]\n"), s);
++                state_puts (_("[-- END PGP SIGNED MESSAGE --]\n"), s);
+             }
+           
+           gpgme_data_release (armored_data);
+@@ -2563,7 +2563,7 @@
+   
+   if (needpass == -1)
+     {
+-      state_attach_puts (_("[-- Error: could not find beginning"
++      state_puts (_("[-- Error: could not find beginning"
+                            " of PGP message! --]\n\n"), s);
+       return 1;
+     }
+@@ -2594,7 +2594,7 @@
+   if (!(fpout = safe_fopen (tempfile, "w+")))
+     {
+       if (s->flags & MUTT_DISPLAY)
+-        state_attach_puts (_("[-- Error: could not create temporary file! "
++        state_puts (_("[-- Error: could not create temporary file! "
+                              "--]\n"), s);
+       return -1;
+     }
+@@ -2605,7 +2605,7 @@
+       tattach->goodsig = is_signed > 0;
+ 
+       if (s->flags & MUTT_DISPLAY)
+-        state_attach_puts (is_signed?
++        state_puts (is_signed?
+           _("[-- The following data is PGP/MIME signed and encrypted --]\n\n"):
+           _("[-- The following data is PGP/MIME encrypted --]\n\n"),
+                            s);
+@@ -2628,7 +2628,7 @@
+       if (s->flags & MUTT_DISPLAY)
+         {
+           state_puts ("\n", s);
+-          state_attach_puts (is_signed?
++          state_puts (is_signed?
+              _("[-- End of PGP/MIME signed and encrypted data --]\n"):
+              _("[-- End of PGP/MIME encrypted data --]\n"),
+                              s);
+@@ -2667,7 +2667,7 @@
+   if (!(fpout = safe_fopen (tempfile, "w+")))
+     {
+       if (s->flags & MUTT_DISPLAY)
+-        state_attach_puts (_("[-- Error: could not create temporary file! "
++        state_puts (_("[-- Error: could not create temporary file! "
+                              "--]\n"), s);
+       return -1;
+     }
+@@ -2678,7 +2678,7 @@
+       tattach->goodsig = is_signed > 0;
+ 
+       if (s->flags & MUTT_DISPLAY)
+-        state_attach_puts (is_signed?
++        state_puts (is_signed?
+           _("[-- The following data is S/MIME signed --]\n\n"):
+           _("[-- The following data is S/MIME encrypted --]\n\n"),
+                            s);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mutt/mutt.git



More information about the pkg-mutt-commits mailing list