From 69dc421ab3355930f23ec6aa47e7e936cbfafb97 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 4 Dec 2011 15:20:39 -0400 Subject: lib: call g_type_init from notmuch_database_open We want to make sure g_type_init is called before any GObject functionality is used. --- lib/database.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/database.cc b/lib/database.cc index e4ef14e0..98f101e6 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -26,6 +26,7 @@ #include #include /* g_free, GPtrArray, GHashTable */ +#include /* g_type_init */ using namespace std; @@ -600,6 +601,9 @@ notmuch_database_open (const char *path, goto DONE; } + /* Initialize the GLib type system and threads */ + g_type_init (); + notmuch = talloc (NULL, notmuch_database_t); notmuch->exception_reported = FALSE; notmuch->path = talloc_strdup (notmuch, path); -- cgit v1.2.3 From 6cca3a5c16dac539db135920bc9ef9c5d237a1d5 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 4 Dec 2011 21:50:08 -0400 Subject: test: add tests for python bindings We start modestly, with a (slightly modified) test case from Kazuo Teramoto. Originally it just made sure the bindings didn't crash; here we check that by comparing the output with that of notmuch search. --- test/notmuch-test | 1 + test/python | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 test/python diff --git a/test/notmuch-test b/test/notmuch-test index 5aced5ce..113ea7cf 100755 --- a/test/notmuch-test +++ b/test/notmuch-test @@ -47,6 +47,7 @@ TESTS=" symbol-hiding search-folder-coherence atomicity + python " TESTS=${NOTMUCH_TESTS:=$TESTS} diff --git a/test/python b/test/python new file mode 100755 index 00000000..179427b8 --- /dev/null +++ b/test/python @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +test_description="python bindings" +. ./test-lib.sh + +add_email_corpus + +test_begin_subtest "compare thread ids" +python < OUTPUT +import notmuch +db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE) +q_new = notmuch.Query(db, 'tag:inbox') +for t in q_new.search_threads(): + print t.get_thread_id() +EOF +notmuch search --output=threads tag:inbox | sed s/^thread:// | sort > EXPECTED +test_expect_equal_file OUTPUT EXPECTED +test_done -- cgit v1.2.3 From d7276c6241eeb0d4565ece3da6a1403ae3f386c8 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 4 Dec 2011 22:03:04 -0400 Subject: version: bump for bugfix release 0.10.2 --- bindings/python/notmuch/version.py | 2 +- notmuch.1 | 2 +- version | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/python/notmuch/version.py b/bindings/python/notmuch/version.py index a6a872eb..fd414b0a 100644 --- a/bindings/python/notmuch/version.py +++ b/bindings/python/notmuch/version.py @@ -1,2 +1,2 @@ # this file should be kept in sync with ../../../version -__VERSION__ = '0.10.1' +__VERSION__ = '0.10.2' diff --git a/notmuch.1 b/notmuch.1 index 92931d73..147319e5 100644 --- a/notmuch.1 +++ b/notmuch.1 @@ -16,7 +16,7 @@ .\" along with this program. If not, see http://www.gnu.org/licenses/ . .\" .\" Author: Carl Worth -.TH NOTMUCH 1 2011-11-25 "Notmuch 0.10.1" +.TH NOTMUCH 1 2011-12-04 "Notmuch 0.10.2" .SH NAME notmuch \- thread-based email index, search, and tagging .SH SYNOPSIS diff --git a/version b/version index 57121573..5eef0f10 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.10.1 +0.10.2 -- cgit v1.2.3 From bb99251f0f1b3b183d61343e53c9a94d802e4780 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 4 Dec 2011 22:08:40 -0400 Subject: debian/changelog: add new changelog stanza for 0.10.2 --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index ac5c3314..b026c68d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +notmuch (0.10.1-2) unstable; urgency=low + + * Upstream bug fix release + - Fix segfault in python bindings due to missing g_type_init call. + + -- David Bremner Sun, 04 Dec 2011 22:06:46 -0400 + notmuch (0.10.1-1) unstable; urgency=low * Upstream bug fix release. -- cgit v1.2.3 From dbd273d434f549f132343e2b30e64e7aad76d910 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Mon, 5 Dec 2011 22:03:38 -0400 Subject: fixup for changelog --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b026c68d..0bcade10 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -notmuch (0.10.1-2) unstable; urgency=low +notmuch (0.10.2-1) unstable; urgency=low * Upstream bug fix release - Fix segfault in python bindings due to missing g_type_init call. -- cgit v1.2.3 From bcd8d139f445df9e21ccadb45a6cb94511e435e7 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 4 Dec 2011 22:14:12 -0400 Subject: NEWS: add news for 0.10.2 --- NEWS | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/NEWS b/NEWS index 384f5a02..3f577e42 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,14 @@ +Notmuch 0.10.2 (2011-12-04) +=========================== + +Bug-fix release. +---------------- + +Fix crash in python bindings. + + The python bindings did not call g_type_init, which caused crashes + for some, but not all users. + Notmuch 0.10.1 (2011-11-25) =========================== -- cgit v1.2.3 From 8e3879b68968ab985b903868427791e7c1bb516d Mon Sep 17 00:00:00 2001 From: David Bremner Date: Mon, 5 Dec 2011 22:27:08 -0400 Subject: build system: allow decreasing debian versions for debian-snapshot This allows the debian-snapshot to continue working between when debian/changelog is updated and when the release is tagged. --- Makefile.local | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.local b/Makefile.local index 8b42136a..d97fa618 100644 --- a/Makefile.local +++ b/Makefile.local @@ -135,7 +135,7 @@ debian-snapshot: TMPFILE := $(shell mktemp) debian-snapshot: make VERSION=$(VERSION) clean cp debian/changelog $(TMPFILE) - EDITOR=/bin/true dch -v $(VERSION)+1 -D UNRELEASED 'test build, not for upload' + EDITOR=/bin/true dch -b -v $(VERSION)+1 -D UNRELEASED 'test build, not for upload' echo '3.0 (native)' > debian/source/format debuild -us -uc mv -f $(TMPFILE) debian/changelog -- cgit v1.2.3 From 07bb8b9e895541006eca88430925f1c6524c4708 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Mon, 5 Dec 2011 23:06:50 -0400 Subject: test/python: set LD_LIBRARY_PATH and PYTHONPATH to use local notmuch Possibly this should be factored out into some kind of "run_python" function. --- test/python | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/python b/test/python index 179427b8..f737749f 100755 --- a/test/python +++ b/test/python @@ -5,6 +5,8 @@ test_description="python bindings" add_email_corpus test_begin_subtest "compare thread ids" +LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib \ +PYTHONPATH=$TEST_DIRECTORY/../bindings/python \ python < OUTPUT import notmuch db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE) -- cgit v1.2.3