v3 of pre-gmime-3.0 cleanup

2017-05-27 Thread David Bremner
This obsoletes [1]. Since that series, a bit of the actual port to gmime-3.0 has crept in, in order to be able to mark tests as broken with respect a particular gmime version. The series in progress [2] has grown to 21 patches, and this is roughly the first half. Currently there about 7 failing

[Patch v3 09/11] test/multipart: reorganize creation of multipart message

2017-05-27 Thread David Bremner
We want to have the bodies of the multipart available in a file on their own for planned modifications to tests. --- test/T190-multipart.sh | 40 +--- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/test/T190-multipart.sh

[Patch v3 02/11] cli/reply: direct all output for text format to gmime stream

2017-05-27 Thread David Bremner
Interleaving printfs with writes to the gmime stream worked when the gmime stream was backed by the FILE *stdout, but that is no longer the case. Create one stream and pass it into the two functions where needed, as well well as replacing printfs with g_mime_stream_printf. --- notmuch-client.h |

[Patch v3 03/11] cli/show: use single stream for printf / gmime object output

2017-05-27 Thread David Bremner
This is again motivated by the need to transition away from GMimeStreamFile for output to stdout. format_part_mbox is left alone for now, as this cannot be mixed in with output using gmime object output. --- notmuch-client.h | 1 + notmuch-show.c | 70

[Patch v3 01/11] util: convenience function to create gmime stream for stdout

2017-05-27 Thread David Bremner
It turns out that our use of GMimeStreamPipe has only succeeded because gmime has been ignoring some seek failures; this will no longer be the case in gmime 3.0, so we use a GMimeStreamPipe, which does not assume seekability, wrapped in a buffering stream. --- util/Makefile.local | 2 +-

[Patch v3 08/11] test: define GMime version dependant breakage

2017-05-27 Thread David Bremner
We have some tests where the gmime 3 behaviour seems like a bug fix, others where it's less clear, so we allow both possibilities. --- configure| 5 + test/test-lib.sh | 16 2 files changed, 21 insertions(+) diff --git a/configure b/configure index

[Patch v3 11/11] test: mark test as broken in gmime 3.0

2017-05-27 Thread David Bremner
Currently I'm not sure what the intent of this test is, so it's not clear if the new answer is better or worse than the old one. --- test/T310-emacs.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh index ef599849..2ef43925 100755 ---

[Patch v3 10/11] test: mark inclusion of headers as broken in gmime-2.x

2017-05-27 Thread David Bremner
The output of headers here reflects an underlying bug / quirk of gmime-2.6. --- test/T190-multipart.sh | 28 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/test/T190-multipart.sh b/test/T190-multipart.sh index 91a632c6..94bb0570 100755 ---

[Patch v3 05/11] cli/reply: fix two memory leaks, document a third

2017-05-27 Thread David Bremner
internet_address_list_to_string returns an allocated string, which needs to be freed with g_free. g_free can handle a NULL argument, so we follow the usage elsewhere of calling it unconditionally. The third leak we leave as it would require restructuring of add_recipients_from_message, and is

[Patch v3 06/11] test/thread-naming: remove excess escaping from sender address.

2017-05-27 Thread David Bremner
This is another case where the behaviour of gmime-2.6 and gmime-3.0 seems to differ. It may be that we prefer the more lax parsing of the previous version, but that should be tested seperately. --- test/T200-thread-naming.sh | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff

[Patch v3 07/11] configure: add optional support for gmime-3.0

2017-05-27 Thread David Bremner
This is only the changes to make configure work; it won't compile with gmime-3.0 yet. --- configure | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/configure b/configure index ed7c2280..91aeba51 100755 --- a/configure +++ b/configure @@ -484,8 +484,13 @@ fi