fix for failing tests with gmime 2.6.19

Tomi Ollila tomi.ollila at iki.fi
Mon Nov 11 06:59:18 PST 2013


On Mon, Nov 11 2013, David Bremner <david at tethera.net> wrote:

> Daniel Kahn Gillmor <dkg at fifthhorseman.net> writes:
>
>>
>> Please don't introduce this cruft into the notmuch codebase.  It should
>> be fixed in gmime, not worked-around notmuch.
>>
>> I've just uploaded gmime 2.6.19-2 to unstable to address this issue.
>>
>
> Hi Daniel;
>
> Thanks a lot for that. 
>
> What I (still) wonder about is all the people not running Debian, in the
> interval between the release of notmuch 0.17 and the next upstream
> release of gmime (and propagation to various distros).  Even on Debian,
> building on testing and backports complicates things a bit.

Something like this could also be used...

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 9d6f843..2ab0f6e 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -26,6 +26,7 @@
 static void
 show_reply_headers (GMimeMessage *message)
 {
+#if ! GMIME_CHECK_VERSION(2,6,19)
     GMimeStream *stream_stdout = NULL;
 
     stream_stdout = g_mime_stream_file_new (stdout);
@@ -35,6 +36,17 @@ show_reply_headers (GMimeMessage *message)
 	g_mime_object_write_to_stream (GMIME_OBJECT(message), stream_stdout);
 	g_object_unref(stream_stdout);
     }
+#else
+    char * msg = g_mime_object_to_string (GMIME_OBJECT(message));
+    char * rp = strstr (msg, "References:  ");
+    if (rp) {
+	fwrite (msg, 1, rp - msg + 12, stdout); // Up to 'References: '
+	fputs (rp + 13, stdout);
+    }
+    else {
+	fputs (msg, stdout);
+    }
+#endif
 }
 
 static void


>
> d

Tomi


More information about the notmuch mailing list