From ed7ca948ae31ac0e1d3633a2f58fb3e4aecd03de Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 9 Dec 2020 21:55:38 -0400 Subject: [PATCH 01/29] build/docs: move docstring prereq to file targets Under a sufficiently high level of parallelism [1] there seems to be a a race condition that allows sphinx-build to start running before the docstrings are extracted. This change moves the docstring stamp from the phony targets sphinx-html and sphinx-info to the file targets that they depend on. I'm not sure why this makes things better, but I am fairly confident it does not make things worse, and experimentally it seems to eliminate the race condition. [1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=976934 --- doc/Makefile.local | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Makefile.local b/doc/Makefile.local index 60bd7184..f476d1da 100644 --- a/doc/Makefile.local +++ b/doc/Makefile.local @@ -43,7 +43,7 @@ INFO_INFO_FILES := $(INFO_TEXI_FILES:.texi=.info) rm -f $@ && gzip --no-name --stdout $^ > $@ ifeq ($(WITH_EMACS),1) -$(DOCBUILDDIR)/.roff.stamp sphinx-html sphinx-texinfo: docstring.stamp +$(DOCBUILDDIR)/.roff.stamp $(DOCBUILDDIR)/.html.stamp $(DOCBUILDDIR)/.texi.stamp : docstring.stamp endif sphinx-html: $(DOCBUILDDIR)/.html.stamp From 55e2dbe0d0d2d7ed760a62744a347a5b55feacb7 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Thu, 10 Dec 2020 21:03:35 -0400 Subject: [PATCH 02/29] debian: changelog for 0.31.2-4 --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index ed76f7f8..a8943124 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +notmuch (0.31.2-4) unstable; urgency=medium + + * Move prerequisite to file targets from phony ones. Thanks to + Lucas Nussbaum for the report. (Closes: #976934). + + -- David Bremner Thu, 10 Dec 2020 21:02:20 -0400 + notmuch (0.31.2-3) unstable; urgency=medium * Switch to debhelper compat level 13 From c7e1910235d06dcb2e7931b187483fc2528ab714 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Thu, 10 Dec 2020 21:07:10 -0400 Subject: [PATCH 03/29] Commit Debian 3.0 (quilt) metadata [dgit (9.12) quilt-fixup] --- debian/patches/debian-changes | 16 ++++++++++++++++ debian/patches/series | 1 + 2 files changed, 17 insertions(+) create mode 100644 debian/patches/debian-changes create mode 100644 debian/patches/series diff --git a/debian/patches/debian-changes b/debian/patches/debian-changes new file mode 100644 index 00000000..40ee7d00 --- /dev/null +++ b/debian/patches/debian-changes @@ -0,0 +1,16 @@ +This is an autogenerated patch header for a single-debian-patch file. The +delta against upstream is either kept as a single patch, or maintained +in some VCS, and exported as a single patch instead of more manageable +atomic patches. + +--- notmuch-0.31.2.orig/doc/Makefile.local ++++ notmuch-0.31.2/doc/Makefile.local +@@ -43,7 +43,7 @@ INFO_INFO_FILES := $(INFO_TEXI_FILES:.te + rm -f $@ && gzip --no-name --stdout $^ > $@ + + ifeq ($(WITH_EMACS),1) +-$(DOCBUILDDIR)/.roff.stamp sphinx-html sphinx-texinfo: docstring.stamp ++$(DOCBUILDDIR)/.roff.stamp $(DOCBUILDDIR)/.html.stamp $(DOCBUILDDIR)/.texi.stamp : docstring.stamp + endif + + sphinx-html: $(DOCBUILDDIR)/.html.stamp diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 00000000..7bb82529 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +debian-changes From 82faa059b8c98a3af016778734be329557d4217d Mon Sep 17 00:00:00 2001 From: David Bremner Date: Fri, 11 Dec 2020 13:06:44 -0400 Subject: [PATCH 04/29] test/T360-symbol-hiding: use readelf in place of nm It turns out that using nm -P isn't as portable as hoped. In particular with some ELF ABIs (e.g. ppc64 ELFv1), the desired symbols end up in the data section instead of text. The test is currently only functional on ELF based architectures, so I think it's legit to depend on readelf instead of nm. The switch to readelf has the advantage that we can explicitely ask for all of the symbols with global visibility, rather than grepping for notmuch. That seems a more robust approach since it will catch any strangely named global symbols. --- test/T360-symbol-hiding.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/T360-symbol-hiding.sh b/test/T360-symbol-hiding.sh index b34f1e54..3f00dd38 100755 --- a/test/T360-symbol-hiding.sh +++ b/test/T360-symbol-hiding.sh @@ -26,8 +26,9 @@ test_begin_subtest 'checking output' test_expect_equal "$result" "$output" test_begin_subtest 'comparing existing to exported symbols' -nm -P $NOTMUCH_BUILDDIR/lib/libnotmuch.so | awk '$2 == "T" && $1 ~ "^notmuch" {print $1}' | sort | uniq > ACTUAL -sed -n 's/^\(notmuch_[a-zA-Z0-9_]*\)[[:blank:]]*(.*/\1/p' $NOTMUCH_SRCDIR/lib/notmuch.h | sort | uniq > EXPORTED +readelf -Ws $NOTMUCH_BUILDDIR/lib/libnotmuch.so | \ + awk '$4 == "FUNC" && $5 == "GLOBAL" && $7 != "UND" {print $8}' | sort -u > ACTUAL +sed -n 's/^\(notmuch_[a-zA-Z0-9_]*\)[[:blank:]]*(.*/\1/p' $NOTMUCH_SRCDIR/lib/notmuch.h | sort -u > EXPORTED test_expect_equal_file EXPORTED ACTUAL test_done From 9ebfe9d6ca8b1528c788c715deb5cf43ad1f289f Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 13 Dec 2020 08:25:29 -0400 Subject: [PATCH 05/29] debian: changelog for 0.31.2-5 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index a8943124..8c157bc0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +notmuch (0.31.2-5) unstable; urgency=medium + + * Use readelf instead of nm in T360, hopefully build in ppc64 + + -- David Bremner Sun, 13 Dec 2020 08:24:23 -0400 + notmuch (0.31.2-4) unstable; urgency=medium * Move prerequisite to file targets from phony ones. Thanks to From 17540b73e812d51777fd63709beb8e9be22e26b8 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 13 Dec 2020 08:25:39 -0400 Subject: [PATCH 06/29] Commit Debian 3.0 (quilt) metadata [dgit (9.12) quilt-fixup] --- debian/patches/debian-changes | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/debian/patches/debian-changes b/debian/patches/debian-changes index 40ee7d00..3e6eefca 100644 --- a/debian/patches/debian-changes +++ b/debian/patches/debian-changes @@ -14,3 +14,17 @@ atomic patches. endif sphinx-html: $(DOCBUILDDIR)/.html.stamp +--- notmuch-0.31.2.orig/test/T360-symbol-hiding.sh ++++ notmuch-0.31.2/test/T360-symbol-hiding.sh +@@ -26,8 +26,9 @@ test_begin_subtest 'checking output' + test_expect_equal "$result" "$output" + + test_begin_subtest 'comparing existing to exported symbols' +-nm -P $NOTMUCH_BUILDDIR/lib/libnotmuch.so | awk '$2 == "T" && $1 ~ "^notmuch" {print $1}' | sort | uniq > ACTUAL +-sed -n 's/^\(notmuch_[a-zA-Z0-9_]*\)[[:blank:]]*(.*/\1/p' $NOTMUCH_SRCDIR/lib/notmuch.h | sort | uniq > EXPORTED ++readelf -Ws $NOTMUCH_BUILDDIR/lib/libnotmuch.so | \ ++ awk '$4 == "FUNC" && $5 == "GLOBAL" && $7 != "UND" {print $8}' | sort -u > ACTUAL ++sed -n 's/^\(notmuch_[a-zA-Z0-9_]*\)[[:blank:]]*(.*/\1/p' $NOTMUCH_SRCDIR/lib/notmuch.h | sort -u > EXPORTED + test_expect_equal_file EXPORTED ACTUAL + + test_done From 27020503402af546d9d3017bb4a6346497c85d09 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sat, 8 Aug 2020 11:16:47 -0300 Subject: [PATCH 07/29] lib/config: delay setting talloc destructor If Xapian has thrown an exception, it is not safe to invoke the destructor when freeing the list struct. (cherry picked from commit 43ba5ed7eca6e9f6433b8c2c2a9d834d4101b92a) --- lib/config.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/config.cc b/lib/config.cc index efab01e4..0b760dbc 100644 --- a/lib/config.cc +++ b/lib/config.cc @@ -133,8 +133,15 @@ notmuch_database_get_config_list (notmuch_database_t *notmuch, *out = list; DONE: - if (status && list) - talloc_free (list); + if (status) { + if (list) { + talloc_free (list); + if (status != NOTMUCH_STATUS_XAPIAN_EXCEPTION) + _notmuch_config_list_destroy (list); + } + } else { + talloc_set_destructor (list, _notmuch_config_list_destroy); + } return status; } From f01f6405c962e27de52eb777ac3f19ee655b71ba Mon Sep 17 00:00:00 2001 From: Johannes Larsen Date: Fri, 25 Dec 2020 11:21:45 -0400 Subject: [PATCH 08/29] python/notmuch2: fix exclude tag handling A typo in Database._create_query lost the exclude_tag names during the string to utf-8 conversion. Amended by DB: fixed patch format and updated commit message. --- bindings/python-cffi/notmuch2/_database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python-cffi/notmuch2/_database.py b/bindings/python-cffi/notmuch2/_database.py index 5ab0f20a..868f4408 100644 --- a/bindings/python-cffi/notmuch2/_database.py +++ b/bindings/python-cffi/notmuch2/_database.py @@ -578,7 +578,7 @@ class Database(base.NotmuchObject): if exclude_tags is not None: for tag in exclude_tags: if isinstance(tag, str): - tag = str.encode('utf-8') + tag = tag.encode('utf-8') capi.lib.notmuch_query_add_tag_exclude(query_p, tag) return querymod.Query(self, query_p) From 6d5d28c593a6f0e935bd039ade450e23d7b08ac8 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Tue, 15 Dec 2020 16:45:09 -0400 Subject: [PATCH 09/29] test/T360-symbol-hiding.sh: trim extra output from readelf readelf on (at least) ppc64le sometimes generates some extension to the Ndx name inside '[]'. Remove this output to allow our simple column based parsing to work. --- test/T360-symbol-hiding.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/T360-symbol-hiding.sh b/test/T360-symbol-hiding.sh index 3f00dd38..729b9d72 100755 --- a/test/T360-symbol-hiding.sh +++ b/test/T360-symbol-hiding.sh @@ -26,7 +26,7 @@ test_begin_subtest 'checking output' test_expect_equal "$result" "$output" test_begin_subtest 'comparing existing to exported symbols' -readelf -Ws $NOTMUCH_BUILDDIR/lib/libnotmuch.so | \ +readelf -Ws $NOTMUCH_BUILDDIR/lib/libnotmuch.so | sed -e 's/\[[^]]*\]//' |\ awk '$4 == "FUNC" && $5 == "GLOBAL" && $7 != "UND" {print $8}' | sort -u > ACTUAL sed -n 's/^\(notmuch_[a-zA-Z0-9_]*\)[[:blank:]]*(.*/\1/p' $NOTMUCH_SRCDIR/lib/notmuch.h | sort -u > EXPORTED test_expect_equal_file EXPORTED ACTUAL From c7596d0e7d611fa0bc6a5539ae16744cee0e6925 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Fri, 25 Dec 2020 11:42:12 -0400 Subject: [PATCH 10/29] version: bump 0.31.3 --- bindings/python-cffi/version.txt | 2 +- bindings/python/notmuch/version.py | 2 +- version.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/python-cffi/version.txt b/bindings/python-cffi/version.txt index c415e1c6..8239f42d 100644 --- a/bindings/python-cffi/version.txt +++ b/bindings/python-cffi/version.txt @@ -1 +1 @@ -0.31.2 +0.31.3 diff --git a/bindings/python/notmuch/version.py b/bindings/python/notmuch/version.py index 0d8fdd04..0be316c2 100644 --- a/bindings/python/notmuch/version.py +++ b/bindings/python/notmuch/version.py @@ -1,3 +1,3 @@ # this file should be kept in sync with ../../../version -__VERSION__ = '0.31.2' +__VERSION__ = '0.31.3' SOVERSION = '5' diff --git a/version.txt b/version.txt index c415e1c6..8239f42d 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.31.2 +0.31.3 From 784e5f42428335d6dbaed2d1c339efbcbab8cf9f Mon Sep 17 00:00:00 2001 From: David Bremner Date: Fri, 25 Dec 2020 11:49:32 -0400 Subject: [PATCH 11/29] debian: changelog for 0.31.3-1 --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 8c157bc0..0ddee4df 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +notmuch (0.31.3-1) unstable; urgency=medium + + * New upstream bugfix release + * Second fix for T360, fix regression on ppc64el + * Fix for exclude tags in notmuch2 python bindings + * Fix for memory error in notmuch_database_get_config_list + + -- David Bremner Fri, 25 Dec 2020 11:48:37 -0400 + notmuch (0.31.2-5) unstable; urgency=medium * Use readelf instead of nm in T360, hopefully build in ppc64 From a103c15986f587c909a3de3fc571d2f54c65c94d Mon Sep 17 00:00:00 2001 From: David Bremner Date: Fri, 25 Dec 2020 11:52:29 -0400 Subject: [PATCH 12/29] NEWS: add news for 0.31.3 --- NEWS | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/NEWS b/NEWS index 677c507d..6484567e 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,21 @@ +Notmuch 0.31.3 (2020-12-25) +=========================== + +Bindings +-------- + +Fix for exclude tags in notmuch2 bindings. + +Build +----- + +Portability update for T360-symbol-hiding + +Library +------- + +Fix for memory error in notmuch_database_get_config_list + Notmuch 0.31.2 (2020-11-08) =========================== From d812256aeb91646b5b1c644fa67f07c483cca651 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Fri, 25 Dec 2020 12:26:35 -0400 Subject: [PATCH 13/29] debian: don't tag debian tag at release is made. This reflects a change in the debian workflow to use dgit, which does the tagging for us. It also leaves room for debian specific fixups. --- Makefile.global | 1 - Makefile.local | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Makefile.global b/Makefile.global index 8477468d..fe79121d 100644 --- a/Makefile.global +++ b/Makefile.global @@ -36,7 +36,6 @@ endif endif UPSTREAM_TAG=$(subst ~,_,$(VERSION)) -DEB_TAG=debian/$(UPSTREAM_TAG)-1 RELEASE_HOST=notmuchmail.org RELEASE_DIR=/srv/notmuchmail.org/www/releases diff --git a/Makefile.local b/Makefile.local index fb126294..bbb8f0b6 100644 --- a/Makefile.local +++ b/Makefile.local @@ -73,12 +73,11 @@ release: verify-source-tree-and-version $(MAKE) VERSION=$(VERSION) $(SHA256_FILE) $(DETACHED_SIG_FILE) ln -sf $(TAR_FILE) $(DEB_TAR_FILE) pristine-tar commit $(DEB_TAR_FILE) $(UPSTREAM_TAG) - git tag -s -m "$(PACKAGE) Debian $(VERSION)-1 upload (same as $(VERSION))" $(DEB_TAG) mkdir -p releases mv $(TAR_FILE) $(SHA256_FILE) $(DETACHED_SIG_FILE) releases $(MAKE) VERSION=$(VERSION) release-message > $(PACKAGE)-$(VERSION).announce ifeq ($(REALLY_UPLOAD),yes) - git push origin $(VERSION) $(DEB_TAG) release pristine-tar + git push origin $(VERSION) release pristine-tar cd releases && scp $(TAR_FILE) $(SHA256_FILE) $(DETACHED_SIG_FILE) $(RELEASE_HOST):$(RELEASE_DIR) ssh $(RELEASE_HOST) "rm -f $(RELEASE_DIR)/LATEST-$(PACKAGE)-* ; ln -s $(TAR_FILE) $(RELEASE_DIR)/LATEST-$(TAR_FILE)" rsync --verbose --delete --recursive doc/_build/html/ $(RELEASE_HOST):$(DOC_DIR) @@ -90,7 +89,6 @@ pre-release: $(MAKE) VERSION=$(VERSION) clean $(MAKE) VERSION=$(VERSION) test git tag -s -m "$(PACKAGE) $(VERSION) release" $(UPSTREAM_TAG) - git tag -s -m "$(PACKAGE) Debian $(VERSION)-1 upload (same as $(VERSION))" $(DEB_TAG) $(MAKE) VERSION=$(VERSION) $(SHA256_FILE) $(DETACHED_SIG_FILE) ln -sf $(TAR_FILE) $(DEB_TAR_FILE) pristine-tar commit $(DEB_TAR_FILE) $(UPSTREAM_TAG) From aee34fdca3cf80a6eed1e107eb1cdf6879a9ad7c Mon Sep 17 00:00:00 2001 From: David Bremner Date: Fri, 25 Dec 2020 12:37:18 -0400 Subject: [PATCH 14/29] debian: drop debian/patches These were originally committed by git-debrebase. Unfortunately git debrebase does not seem to like the notmuch git workflow, so giving up on it for now. --- debian/patches/debian-changes | 30 ------------------------------ debian/patches/series | 1 - 2 files changed, 31 deletions(-) delete mode 100644 debian/patches/debian-changes delete mode 100644 debian/patches/series diff --git a/debian/patches/debian-changes b/debian/patches/debian-changes deleted file mode 100644 index 3e6eefca..00000000 --- a/debian/patches/debian-changes +++ /dev/null @@ -1,30 +0,0 @@ -This is an autogenerated patch header for a single-debian-patch file. The -delta against upstream is either kept as a single patch, or maintained -in some VCS, and exported as a single patch instead of more manageable -atomic patches. - ---- notmuch-0.31.2.orig/doc/Makefile.local -+++ notmuch-0.31.2/doc/Makefile.local -@@ -43,7 +43,7 @@ INFO_INFO_FILES := $(INFO_TEXI_FILES:.te - rm -f $@ && gzip --no-name --stdout $^ > $@ - - ifeq ($(WITH_EMACS),1) --$(DOCBUILDDIR)/.roff.stamp sphinx-html sphinx-texinfo: docstring.stamp -+$(DOCBUILDDIR)/.roff.stamp $(DOCBUILDDIR)/.html.stamp $(DOCBUILDDIR)/.texi.stamp : docstring.stamp - endif - - sphinx-html: $(DOCBUILDDIR)/.html.stamp ---- notmuch-0.31.2.orig/test/T360-symbol-hiding.sh -+++ notmuch-0.31.2/test/T360-symbol-hiding.sh -@@ -26,8 +26,9 @@ test_begin_subtest 'checking output' - test_expect_equal "$result" "$output" - - test_begin_subtest 'comparing existing to exported symbols' --nm -P $NOTMUCH_BUILDDIR/lib/libnotmuch.so | awk '$2 == "T" && $1 ~ "^notmuch" {print $1}' | sort | uniq > ACTUAL --sed -n 's/^\(notmuch_[a-zA-Z0-9_]*\)[[:blank:]]*(.*/\1/p' $NOTMUCH_SRCDIR/lib/notmuch.h | sort | uniq > EXPORTED -+readelf -Ws $NOTMUCH_BUILDDIR/lib/libnotmuch.so | \ -+ awk '$4 == "FUNC" && $5 == "GLOBAL" && $7 != "UND" {print $8}' | sort -u > ACTUAL -+sed -n 's/^\(notmuch_[a-zA-Z0-9_]*\)[[:blank:]]*(.*/\1/p' $NOTMUCH_SRCDIR/lib/notmuch.h | sort -u > EXPORTED - test_expect_equal_file EXPORTED ACTUAL - - test_done diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index 7bb82529..00000000 --- a/debian/patches/series +++ /dev/null @@ -1 +0,0 @@ -debian-changes From 0cd4ec8a3bb28b8c2973f5a30bff5505f5aac8c6 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Fri, 25 Dec 2020 12:39:26 -0400 Subject: [PATCH 15/29] Commit Debian 3.0 (quilt) metadata [dgit (9.12) quilt-fixup] --- debian/patches/debian-changes | 47 +++++++++++++++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 48 insertions(+) create mode 100644 debian/patches/debian-changes create mode 100644 debian/patches/series diff --git a/debian/patches/debian-changes b/debian/patches/debian-changes new file mode 100644 index 00000000..55aa7de9 --- /dev/null +++ b/debian/patches/debian-changes @@ -0,0 +1,47 @@ +This is an autogenerated patch header for a single-debian-patch file. The +delta against upstream is either kept as a single patch, or maintained +in some VCS, and exported as a single patch instead of more manageable +atomic patches. + +--- notmuch-0.31.3.orig/Makefile.global ++++ notmuch-0.31.3/Makefile.global +@@ -36,7 +36,6 @@ endif + endif + + UPSTREAM_TAG=$(subst ~,_,$(VERSION)) +-DEB_TAG=debian/$(UPSTREAM_TAG)-1 + + RELEASE_HOST=notmuchmail.org + RELEASE_DIR=/srv/notmuchmail.org/www/releases +--- notmuch-0.31.3.orig/Makefile.local ++++ notmuch-0.31.3/Makefile.local +@@ -73,12 +73,11 @@ release: verify-source-tree-and-version + $(MAKE) VERSION=$(VERSION) $(SHA256_FILE) $(DETACHED_SIG_FILE) + ln -sf $(TAR_FILE) $(DEB_TAR_FILE) + pristine-tar commit $(DEB_TAR_FILE) $(UPSTREAM_TAG) +- git tag -s -m "$(PACKAGE) Debian $(VERSION)-1 upload (same as $(VERSION))" $(DEB_TAG) + mkdir -p releases + mv $(TAR_FILE) $(SHA256_FILE) $(DETACHED_SIG_FILE) releases + $(MAKE) VERSION=$(VERSION) release-message > $(PACKAGE)-$(VERSION).announce + ifeq ($(REALLY_UPLOAD),yes) +- git push origin $(VERSION) $(DEB_TAG) release pristine-tar ++ git push origin $(VERSION) release pristine-tar + cd releases && scp $(TAR_FILE) $(SHA256_FILE) $(DETACHED_SIG_FILE) $(RELEASE_HOST):$(RELEASE_DIR) + ssh $(RELEASE_HOST) "rm -f $(RELEASE_DIR)/LATEST-$(PACKAGE)-* ; ln -s $(TAR_FILE) $(RELEASE_DIR)/LATEST-$(TAR_FILE)" + rsync --verbose --delete --recursive doc/_build/html/ $(RELEASE_HOST):$(DOC_DIR) +@@ -90,7 +89,6 @@ pre-release: + $(MAKE) VERSION=$(VERSION) clean + $(MAKE) VERSION=$(VERSION) test + git tag -s -m "$(PACKAGE) $(VERSION) release" $(UPSTREAM_TAG) +- git tag -s -m "$(PACKAGE) Debian $(VERSION)-1 upload (same as $(VERSION))" $(DEB_TAG) + $(MAKE) VERSION=$(VERSION) $(SHA256_FILE) $(DETACHED_SIG_FILE) + ln -sf $(TAR_FILE) $(DEB_TAR_FILE) + pristine-tar commit $(DEB_TAR_FILE) $(UPSTREAM_TAG) +--- notmuch-0.31.3.orig/NEWS ++++ notmuch-0.31.3/NEWS +@@ -1,4 +1,5 @@ + Notmuch 0.31.3 (2020-12-25) ++=========================== + + Bindings + -------- diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 00000000..7bb82529 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +debian-changes From 1692fe7aa8b137d02817bb11f248d204d6ab4048 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sat, 26 Dec 2020 15:14:27 -0400 Subject: [PATCH 16/29] debian: skip gdb based tests on hppa --- debian/changelog | 6 ++++++ debian/control | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0ddee4df..222b06f4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +notmuch (0.31.3-2) unstable; urgency=medium + + * Don't install gdb on hppa (skip gdb based tests) + + -- David Bremner Sat, 26 Dec 2020 15:14:07 -0400 + notmuch (0.31.3-1) unstable; urgency=medium * New upstream bugfix release diff --git a/debian/control b/debian/control index 585ff778..8b34d9ed 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Uploaders: Jameson Graef Rollins , David Bremner , Build-Conflicts: - gdb [ia64 mips mips64el], + gdb [ia64 mips mips64el hppa], gdb-minimal, ruby1.8, Build-Depends: @@ -19,7 +19,7 @@ Build-Depends: dpkg-dev (>= 1.17.14), dtach (>= 0.8) , emacs-nox | emacs-gtk | emacs-lucid | emacs25-nox | emacs25 (>=25~) | emacs25-lucid (>=25~) | emacs24-nox | emacs24 (>=24~) | emacs24-lucid (>=24~), - gdb [!ia64 !mips !mips64el !kfreebsd-any !alpha] , + gdb [!ia64 !mips !mips64el !kfreebsd-any !alpha !hppa] , gnupg , gpgsm , libgmime-3.0-dev (>= 3.0.3~), From 6db8b422d91a75b7c16f013f10f41d1109ce5866 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Mon, 15 Feb 2021 16:43:50 -0400 Subject: [PATCH 17/29] fix build failure with glib 2.67 Based on a patch from Michael J Gruber [1]. As of glib 2.67 (more specifically [2]), including "gmime-extra.h" inside an extern "C" block causes build failures, because glib is using C++ features. Observing that "gmime-extra.h" is no longer needed in notmuch-private.h, which can simply delete that include, but we have to correspondingly move the includes which might include it (in particular crypto.h) out of the extern "C" block also. This seems less fragile than only moving gmime-extra, and relying on preprocessor sentinels to keep the deeper includes from happening. Move to the include to the outside of the extern block. [1]: id:aee618a3d41f7889a7449aa16893e992325a909a.1613055071.git.git@grubix.eu [2]: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1715 --- lib/notmuch-private.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h index 57ec7f72..41aff342 100644 --- a/lib/notmuch-private.h +++ b/lib/notmuch-private.h @@ -31,6 +31,12 @@ #include "notmuch.h" +#include "xutil.h" +#include "error_util.h" +#include "string-util.h" +#include "crypto.h" +#include "repair.h" + NOTMUCH_BEGIN_DECLS #include @@ -47,14 +53,6 @@ NOTMUCH_BEGIN_DECLS #include -#include "gmime-extra.h" - -#include "xutil.h" -#include "error_util.h" -#include "string-util.h" -#include "crypto.h" -#include "repair.h" - #ifdef DEBUG # define DEBUG_DATABASE_SANITY 1 # define DEBUG_THREADING 1 From a37d5f5976de07b36141aa6b4a98cf913a3cf2fe Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 14 Feb 2021 20:55:55 -0400 Subject: [PATCH 18/29] test: Fix race condition in T568-lib-thread.sh The assignment of thread-ids is (apparently) non-deterministic in a way that mostly seems to show up on multicore machines. In my tests the number is different from that previously assumed by this test about 15% of the time on a 50 thread (25 core) Xeon. Since message id's are fixed, use a message known to be in the thread of interest to pick out the correct thread-id. --- test/T568-lib-thread.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/T568-lib-thread.sh b/test/T568-lib-thread.sh index ac13d986..088e66dd 100755 --- a/test/T568-lib-thread.sh +++ b/test/T568-lib-thread.sh @@ -8,6 +8,11 @@ add_email_corpus test_begin_subtest "building database" test_expect_success "NOTMUCH_NEW" +test_begin_subtest "finding thread" +THREAD=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu) +count=$(notmuch count $THREAD) +test_expect_equal "$count" "7" + cat <<'EOF' > c_tail if (stat) { const char *stat_str = notmuch_database_status_string (db); @@ -30,7 +35,7 @@ int main (int argc, char** argv) notmuch_thread_t *thread = NULL; notmuch_threads_t *threads = NULL; notmuch_query_t *query = NULL; - const char *id = "thread:0000000000000009"; + const char *id = "${THREAD}"; stat = notmuch_database_open_verbose (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db, &msg); if (stat != NOTMUCH_STATUS_SUCCESS) { @@ -52,10 +57,11 @@ cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} printf("%d\n%s\n", thread != NULL, id2); } EOF +thread_num=${THREAD#thread:} cat < EXPECTED == stdout == 1 -0000000000000009 +${thread_num} == stderr == EOF test_expect_equal_file EXPECTED OUTPUT From 2ab95d813c8a6bd7ed48600a354a98804a2f4d94 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Thu, 18 Feb 2021 07:17:22 -0400 Subject: [PATCH 19/29] version: update to 0.31.4 --- bindings/python-cffi/version.txt | 2 +- bindings/python/notmuch/version.py | 2 +- version.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/python-cffi/version.txt b/bindings/python-cffi/version.txt index 8239f42d..a8a02172 100644 --- a/bindings/python-cffi/version.txt +++ b/bindings/python-cffi/version.txt @@ -1 +1 @@ -0.31.3 +0.31.4 diff --git a/bindings/python/notmuch/version.py b/bindings/python/notmuch/version.py index 0be316c2..6f6372ab 100644 --- a/bindings/python/notmuch/version.py +++ b/bindings/python/notmuch/version.py @@ -1,3 +1,3 @@ # this file should be kept in sync with ../../../version -__VERSION__ = '0.31.3' +__VERSION__ = '0.31.4' SOVERSION = '5' diff --git a/version.txt b/version.txt index 8239f42d..a8a02172 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.31.3 +0.31.4 From 42b2201c11f822999d8e2f6e0dd86088dfb1c87e Mon Sep 17 00:00:00 2001 From: David Bremner Date: Thu, 18 Feb 2021 07:21:48 -0400 Subject: [PATCH 20/29] NEWS: news for 0.31.4 --- NEWS | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/NEWS b/NEWS index 6484567e..6e88ebd9 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,16 @@ +Notmuch 0.31.4 (2021-02-18) +=========================== + +Library +------- + +Fix include bug triggered by glib 2.67. + +Test +---- + +Fix race condition in T568-lib-thread. + Notmuch 0.31.3 (2020-12-25) =========================== From 9f2796438f92a3169d1be1b43a8a1354b3c71eb8 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Thu, 18 Feb 2021 07:23:24 -0400 Subject: [PATCH 21/29] debian: changelog for 0.31.4-1 --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 222b06f4..ec3de63d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +notmuch (0.31.4-1) unstable; urgency=medium + + * New upstream bugfix release + - Fix include bug triggered by glib 2.67 + - Fix race condition in T568-lib-thread + + -- David Bremner Thu, 18 Feb 2021 07:23:00 -0400 + notmuch (0.31.3-2) unstable; urgency=medium * Don't install gdb on hppa (skip gdb based tests) From 346b999ae6f1af6a8dbe7ef960c15adf18e6a15c Mon Sep 17 00:00:00 2001 From: David Bremner Date: Thu, 18 Feb 2021 07:52:39 -0400 Subject: [PATCH 22/29] doc: bump copyright year --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 11bed51d..1a5c217b 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -14,7 +14,7 @@ master_doc = 'index' # General information about the project. project = u'notmuch' -copyright = u'2009-2020, Carl Worth and many others' +copyright = u'2009-2021, Carl Worth and many others' location = os.path.dirname(__file__) From 3a3208bb7b8bfca1c0bcaa5b45b6ef71aa768612 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Thu, 18 Feb 2021 07:53:00 -0400 Subject: [PATCH 23/29] debian: drop patches we should by synced up with the tarball again --- debian/patches/debian-changes | 47 ----------------------------------- debian/patches/series | 1 - 2 files changed, 48 deletions(-) delete mode 100644 debian/patches/debian-changes delete mode 100644 debian/patches/series diff --git a/debian/patches/debian-changes b/debian/patches/debian-changes deleted file mode 100644 index 55aa7de9..00000000 --- a/debian/patches/debian-changes +++ /dev/null @@ -1,47 +0,0 @@ -This is an autogenerated patch header for a single-debian-patch file. The -delta against upstream is either kept as a single patch, or maintained -in some VCS, and exported as a single patch instead of more manageable -atomic patches. - ---- notmuch-0.31.3.orig/Makefile.global -+++ notmuch-0.31.3/Makefile.global -@@ -36,7 +36,6 @@ endif - endif - - UPSTREAM_TAG=$(subst ~,_,$(VERSION)) --DEB_TAG=debian/$(UPSTREAM_TAG)-1 - - RELEASE_HOST=notmuchmail.org - RELEASE_DIR=/srv/notmuchmail.org/www/releases ---- notmuch-0.31.3.orig/Makefile.local -+++ notmuch-0.31.3/Makefile.local -@@ -73,12 +73,11 @@ release: verify-source-tree-and-version - $(MAKE) VERSION=$(VERSION) $(SHA256_FILE) $(DETACHED_SIG_FILE) - ln -sf $(TAR_FILE) $(DEB_TAR_FILE) - pristine-tar commit $(DEB_TAR_FILE) $(UPSTREAM_TAG) -- git tag -s -m "$(PACKAGE) Debian $(VERSION)-1 upload (same as $(VERSION))" $(DEB_TAG) - mkdir -p releases - mv $(TAR_FILE) $(SHA256_FILE) $(DETACHED_SIG_FILE) releases - $(MAKE) VERSION=$(VERSION) release-message > $(PACKAGE)-$(VERSION).announce - ifeq ($(REALLY_UPLOAD),yes) -- git push origin $(VERSION) $(DEB_TAG) release pristine-tar -+ git push origin $(VERSION) release pristine-tar - cd releases && scp $(TAR_FILE) $(SHA256_FILE) $(DETACHED_SIG_FILE) $(RELEASE_HOST):$(RELEASE_DIR) - ssh $(RELEASE_HOST) "rm -f $(RELEASE_DIR)/LATEST-$(PACKAGE)-* ; ln -s $(TAR_FILE) $(RELEASE_DIR)/LATEST-$(TAR_FILE)" - rsync --verbose --delete --recursive doc/_build/html/ $(RELEASE_HOST):$(DOC_DIR) -@@ -90,7 +89,6 @@ pre-release: - $(MAKE) VERSION=$(VERSION) clean - $(MAKE) VERSION=$(VERSION) test - git tag -s -m "$(PACKAGE) $(VERSION) release" $(UPSTREAM_TAG) -- git tag -s -m "$(PACKAGE) Debian $(VERSION)-1 upload (same as $(VERSION))" $(DEB_TAG) - $(MAKE) VERSION=$(VERSION) $(SHA256_FILE) $(DETACHED_SIG_FILE) - ln -sf $(TAR_FILE) $(DEB_TAR_FILE) - pristine-tar commit $(DEB_TAR_FILE) $(UPSTREAM_TAG) ---- notmuch-0.31.3.orig/NEWS -+++ notmuch-0.31.3/NEWS -@@ -1,4 +1,5 @@ - Notmuch 0.31.3 (2020-12-25) -+=========================== - - Bindings - -------- diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index 7bb82529..00000000 --- a/debian/patches/series +++ /dev/null @@ -1 +0,0 @@ -debian-changes From dab32dc70c15789b188001b78b7225c61bed4784 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sat, 15 May 2021 15:40:22 -0300 Subject: [PATCH 24/29] lib/n_d_index_file: re-use thread-id of existing message This prevents the message document getting multiple thread-id terms when there are multiple files with the same message-id. This change shifts some thread ids, requiring adjustments to other tests. (cherry picked from commit 3f4de98e7c8c70f9a86a4f899147126f79907bd9) --- lib/add-message.cc | 9 ++++++--- test/T357-index-decryption.sh | 26 ++++++++++++-------------- test/T670-duplicate-mid.sh | 13 +++++++++++++ 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/lib/add-message.cc b/lib/add-message.cc index 485debad..b47aa501 100644 --- a/lib/add-message.cc +++ b/lib/add-message.cc @@ -407,14 +407,17 @@ static notmuch_status_t _notmuch_database_link_message (notmuch_database_t *notmuch, notmuch_message_t *message, notmuch_message_file_t *message_file, - bool is_ghost) + bool is_ghost, + bool is_new) { void *local = talloc_new (NULL); notmuch_status_t status; const char *thread_id = NULL; /* Check if the message already had a thread ID */ - if (notmuch->features & NOTMUCH_FEATURE_GHOSTS) { + if (! is_new) { + thread_id = notmuch_message_get_thread_id (message); + } else if (notmuch->features & NOTMUCH_FEATURE_GHOSTS) { if (is_ghost) thread_id = notmuch_message_get_thread_id (message); } else { @@ -539,7 +542,7 @@ notmuch_database_index_file (notmuch_database_t *notmuch, } ret = _notmuch_database_link_message (notmuch, message, - message_file, is_ghost); + message_file, is_ghost, is_new); if (ret) goto DONE; diff --git a/test/T357-index-decryption.sh b/test/T357-index-decryption.sh index 1ed5f28c..1951ef78 100755 --- a/test/T357-index-decryption.sh +++ b/test/T357-index-decryption.sh @@ -112,12 +112,10 @@ test_expect_equal \ "$expected" # try inserting it with decryption, should appear as a single copy -# (note: i think thread id skips 4 because of duplicate message-id -# insertion, above) test_begin_subtest "message cleartext is present with insert --decrypt=true" notmuch insert --folder=sent --decrypt=true <<<"$contents" -output=$(notmuch search wumpus) -expected='thread:0000000000000005 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (encrypted inbox unread)' +output=$(notmuch search wumpus | notmuch_search_sanitize) +expected='thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (encrypted inbox unread)' test_expect_equal \ "$output" \ "$expected" @@ -127,9 +125,9 @@ test_expect_equal \ test_begin_subtest 'tagging all messages' test_expect_success 'notmuch tag +blarney "encrypted message"' test_begin_subtest "verify that tags have not changed" -output=$(notmuch search tag:blarney) -expected='thread:0000000000000001 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 001 (blarney encrypted inbox) -thread:0000000000000005 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (blarney encrypted inbox unread)' +output=$(notmuch search tag:blarney | notmuch_search_sanitize) +expected='thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 001 (blarney encrypted inbox) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (blarney encrypted inbox unread)' test_expect_equal \ "$output" \ "$expected" @@ -138,14 +136,14 @@ test_expect_equal \ test_begin_subtest 'reindex old messages' test_expect_success 'notmuch reindex --decrypt=true tag:encrypted and not property:index.decryption=success' test_begin_subtest "reindexed encrypted message, including cleartext" -output=$(notmuch search wumpus) +output=$(notmuch search wumpus | notmuch_search_sanitize) test_expect_equal \ "$output" \ "$expected" # and the same search, but by property ($expected is untouched): test_begin_subtest "emacs search by property for both messages" -output=$(notmuch search property:index.decryption=success) +output=$(notmuch search property:index.decryption=success | notmuch_search_sanitize) test_expect_equal \ "$output" \ "$expected" @@ -154,7 +152,7 @@ test_expect_equal \ test_begin_subtest 'reindex in auto mode' test_expect_success 'notmuch reindex tag:encrypted and property:index.decryption=success' test_begin_subtest "reindexed encrypted messages, should not have changed" -output=$(notmuch search wumpus) +output=$(notmuch search wumpus | notmuch_search_sanitize) test_expect_equal \ "$output" \ "$expected" @@ -188,9 +186,9 @@ test_expect_equal \ # ensure that the tags remain even when we are dropping the cleartext. test_begin_subtest "verify that tags remain without cleartext" -output=$(notmuch search tag:blarney) -expected='thread:0000000000000001 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 001 (blarney encrypted inbox) -thread:0000000000000005 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (blarney encrypted inbox unread)' +output=$(notmuch search tag:blarney | notmuch_search_sanitize) +expected='thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 001 (blarney encrypted inbox) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (blarney encrypted inbox unread)' test_expect_equal \ "$output" \ "$expected" @@ -199,7 +197,7 @@ test_begin_subtest "index cleartext without keeping session keys" test_expect_success "notmuch reindex --decrypt=nostash tag:blarney" test_begin_subtest "Ensure that the indexed terms are present" -output=$(notmuch search wumpus) +output=$(notmuch search wumpus | notmuch_search_sanitize) test_expect_equal \ "$output" \ "$expected" diff --git a/test/T670-duplicate-mid.sh b/test/T670-duplicate-mid.sh index 4e5672ab..7ae60595 100755 --- a/test/T670-duplicate-mid.sh +++ b/test/T670-duplicate-mid.sh @@ -6,6 +6,19 @@ add_message '[id]="duplicate"' '[subject]="message 1" [filename]=copy1' add_message '[id]="duplicate"' '[subject]="message 2" [filename]=copy2' add_message '[id]="duplicate"' '[subject]="message 0" [filename]=copy0' + +test_begin_subtest 'at most 1 thread-id per xapian document' +db=${MAIL_DIR}/.notmuch/xapian +for doc in $(xapian-delve -1 -t '' "$db" | grep '^[1-9]'); do + xapian-delve -1 -r "$doc" "$db" | grep -c '^G' +done > OUTPUT.raw +sort -u < OUTPUT.raw > OUTPUT +cat < EXPECTED +0 +1 +EOF +test_expect_equal_file EXPECTED OUTPUT + test_begin_subtest 'search: first indexed subject preserved' cat < EXPECTED thread:XXX 2001-01-05 [1/1(3)] Notmuch Test Suite; message 1 (inbox unread) From dd5cd144766dffc8a36fa3b3f00f8e194c2e4d14 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sat, 26 Jun 2021 22:44:36 -0300 Subject: [PATCH 25/29] changelog for 0.31.4-2 --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index ec3de63d..382c8184 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +notmuch (0.31.4-2) unstable; urgency=medium + + * Cherry pick upstream commit 3f4de98e7c8, which fixes a bug where + duplicate message-ids can cause multiple thread-ids for some message + documents. + + -- David Bremner Sat, 26 Jun 2021 22:44:08 -0300 + notmuch (0.31.4-1) unstable; urgency=medium * New upstream bugfix release From 3f102654c6e51c68cbc26bfd2195d2a19b72de3c Mon Sep 17 00:00:00 2001 From: David Bremner Date: Mon, 28 Jun 2021 22:09:54 -0300 Subject: [PATCH 26/29] debian/changelog: refinalize for upload --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 382c8184..d767fb4b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,7 @@ notmuch (0.31.4-2) unstable; urgency=medium duplicate message-ids can cause multiple thread-ids for some message documents. - -- David Bremner Sat, 26 Jun 2021 22:44:08 -0300 + -- David Bremner Mon, 28 Jun 2021 22:09:09 -0300 notmuch (0.31.4-1) unstable; urgency=medium From fef433f30700445ce04ff702681e81e979cc307a Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sat, 24 Apr 2021 12:13:37 -0300 Subject: [PATCH 27/29] debian: add xapian-tools for tests xapian-metadata is used by some of the new tests. (cherry picked from commit 9f8458a998a0a20f435b5d47ac085acb9490ddae) --- debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/control b/debian/control index 8b34d9ed..633d0be8 100644 --- a/debian/control +++ b/debian/control @@ -37,6 +37,7 @@ Build-Depends: ruby, ruby-dev (>>1:1.9.3~), texinfo, + xapian-tools , Standards-Version: 4.4.1 Homepage: https://notmuchmail.org/ Vcs-Git: https://git.notmuchmail.org/git/notmuch -b release From 7b6f1b0f08230b51c8b90b169716aaa463402cd5 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Mon, 28 Jun 2021 22:44:24 -0300 Subject: [PATCH 28/29] Commit Debian 3.0 (quilt) metadata [dgit (9.13) quilt-fixup] --- debian/patches/debian-changes | 136 ++++++++++++++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 137 insertions(+) create mode 100644 debian/patches/debian-changes create mode 100644 debian/patches/series diff --git a/debian/patches/debian-changes b/debian/patches/debian-changes new file mode 100644 index 00000000..d6927fd0 --- /dev/null +++ b/debian/patches/debian-changes @@ -0,0 +1,136 @@ +This is an autogenerated patch header for a single-debian-patch file. The +delta against upstream is either kept as a single patch, or maintained +in some VCS, and exported as a single patch instead of more manageable +atomic patches. + +--- notmuch-0.31.4.orig/lib/add-message.cc ++++ notmuch-0.31.4/lib/add-message.cc +@@ -407,14 +407,17 @@ static notmuch_status_t + _notmuch_database_link_message (notmuch_database_t *notmuch, + notmuch_message_t *message, + notmuch_message_file_t *message_file, +- bool is_ghost) ++ bool is_ghost, ++ bool is_new) + { + void *local = talloc_new (NULL); + notmuch_status_t status; + const char *thread_id = NULL; + + /* Check if the message already had a thread ID */ +- if (notmuch->features & NOTMUCH_FEATURE_GHOSTS) { ++ if (! is_new) { ++ thread_id = notmuch_message_get_thread_id (message); ++ } else if (notmuch->features & NOTMUCH_FEATURE_GHOSTS) { + if (is_ghost) + thread_id = notmuch_message_get_thread_id (message); + } else { +@@ -539,7 +542,7 @@ notmuch_database_index_file (notmuch_dat + } + + ret = _notmuch_database_link_message (notmuch, message, +- message_file, is_ghost); ++ message_file, is_ghost, is_new); + if (ret) + goto DONE; + +--- notmuch-0.31.4.orig/test/T357-index-decryption.sh ++++ notmuch-0.31.4/test/T357-index-decryption.sh +@@ -112,12 +112,10 @@ test_expect_equal \ + "$expected" + + # try inserting it with decryption, should appear as a single copy +-# (note: i think thread id skips 4 because of duplicate message-id +-# insertion, above) + test_begin_subtest "message cleartext is present with insert --decrypt=true" + notmuch insert --folder=sent --decrypt=true <<<"$contents" +-output=$(notmuch search wumpus) +-expected='thread:0000000000000005 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (encrypted inbox unread)' ++output=$(notmuch search wumpus | notmuch_search_sanitize) ++expected='thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (encrypted inbox unread)' + test_expect_equal \ + "$output" \ + "$expected" +@@ -127,9 +125,9 @@ test_expect_equal \ + test_begin_subtest 'tagging all messages' + test_expect_success 'notmuch tag +blarney "encrypted message"' + test_begin_subtest "verify that tags have not changed" +-output=$(notmuch search tag:blarney) +-expected='thread:0000000000000001 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 001 (blarney encrypted inbox) +-thread:0000000000000005 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (blarney encrypted inbox unread)' ++output=$(notmuch search tag:blarney | notmuch_search_sanitize) ++expected='thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 001 (blarney encrypted inbox) ++thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (blarney encrypted inbox unread)' + test_expect_equal \ + "$output" \ + "$expected" +@@ -138,14 +136,14 @@ test_expect_equal \ + test_begin_subtest 'reindex old messages' + test_expect_success 'notmuch reindex --decrypt=true tag:encrypted and not property:index.decryption=success' + test_begin_subtest "reindexed encrypted message, including cleartext" +-output=$(notmuch search wumpus) ++output=$(notmuch search wumpus | notmuch_search_sanitize) + test_expect_equal \ + "$output" \ + "$expected" + + # and the same search, but by property ($expected is untouched): + test_begin_subtest "emacs search by property for both messages" +-output=$(notmuch search property:index.decryption=success) ++output=$(notmuch search property:index.decryption=success | notmuch_search_sanitize) + test_expect_equal \ + "$output" \ + "$expected" +@@ -154,7 +152,7 @@ test_expect_equal \ + test_begin_subtest 'reindex in auto mode' + test_expect_success 'notmuch reindex tag:encrypted and property:index.decryption=success' + test_begin_subtest "reindexed encrypted messages, should not have changed" +-output=$(notmuch search wumpus) ++output=$(notmuch search wumpus | notmuch_search_sanitize) + test_expect_equal \ + "$output" \ + "$expected" +@@ -188,9 +186,9 @@ test_expect_equal \ + + # ensure that the tags remain even when we are dropping the cleartext. + test_begin_subtest "verify that tags remain without cleartext" +-output=$(notmuch search tag:blarney) +-expected='thread:0000000000000001 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 001 (blarney encrypted inbox) +-thread:0000000000000005 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (blarney encrypted inbox unread)' ++output=$(notmuch search tag:blarney | notmuch_search_sanitize) ++expected='thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 001 (blarney encrypted inbox) ++thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (blarney encrypted inbox unread)' + test_expect_equal \ + "$output" \ + "$expected" +@@ -199,7 +197,7 @@ test_begin_subtest "index cleartext with + test_expect_success "notmuch reindex --decrypt=nostash tag:blarney" + + test_begin_subtest "Ensure that the indexed terms are present" +-output=$(notmuch search wumpus) ++output=$(notmuch search wumpus | notmuch_search_sanitize) + test_expect_equal \ + "$output" \ + "$expected" +--- notmuch-0.31.4.orig/test/T670-duplicate-mid.sh ++++ notmuch-0.31.4/test/T670-duplicate-mid.sh +@@ -6,6 +6,19 @@ add_message '[id]="duplicate"' '[subject + add_message '[id]="duplicate"' '[subject]="message 2" [filename]=copy2' + + add_message '[id]="duplicate"' '[subject]="message 0" [filename]=copy0' ++ ++test_begin_subtest 'at most 1 thread-id per xapian document' ++db=${MAIL_DIR}/.notmuch/xapian ++for doc in $(xapian-delve -1 -t '' "$db" | grep '^[1-9]'); do ++ xapian-delve -1 -r "$doc" "$db" | grep -c '^G' ++done > OUTPUT.raw ++sort -u < OUTPUT.raw > OUTPUT ++cat < EXPECTED ++0 ++1 ++EOF ++test_expect_equal_file EXPECTED OUTPUT ++ + test_begin_subtest 'search: first indexed subject preserved' + cat < EXPECTED + thread:XXX 2001-01-05 [1/1(3)] Notmuch Test Suite; message 1 (inbox unread) diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 00000000..7bb82529 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +debian-changes From b6cfc8a61c20aec1e54185829718f87c7f7dea79 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Mon, 28 Jun 2021 22:48:29 -0300 Subject: [PATCH 29/29] debian: document new build-dependency --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d767fb4b..ebfd9209 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,9 @@ notmuch (0.31.4-2) unstable; urgency=medium * Cherry pick upstream commit 3f4de98e7c8, which fixes a bug where duplicate message-ids can cause multiple thread-ids for some message documents. + * Add build-dependency on xapian-tools, for new test - -- David Bremner Mon, 28 Jun 2021 22:09:09 -0300 + -- David Bremner Mon, 28 Jun 2021 22:48:02 -0300 notmuch (0.31.4-1) unstable; urgency=medium