unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* suppress deprecation warnings
@ 2016-10-05 11:34 David Bremner
  2016-10-05 11:34 ` [PATCH 1/2] lib: replace deprecated xapian call 'flush()' with 'commit()' David Bremner
  2016-10-05 11:34 ` [PATCH 2/2] lib: optionally silence Xapian deprecation warnings David Bremner
  0 siblings, 2 replies; 5+ messages in thread
From: David Bremner @ 2016-10-05 11:34 UTC (permalink / raw)
  To: notmuch

If you're compiling against Xapian 1.4 you will have noticed several
deprecation warnings. This series fixes the one which is fixable in
Xapian 1.2.x, and silences the rest of them.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] lib: replace deprecated xapian call 'flush()' with 'commit()'
  2016-10-05 11:34 suppress deprecation warnings David Bremner
@ 2016-10-05 11:34 ` David Bremner
  2016-10-26  1:05   ` David Bremner
  2016-10-05 11:34 ` [PATCH 2/2] lib: optionally silence Xapian deprecation warnings David Bremner
  1 sibling, 1 reply; 5+ messages in thread
From: David Bremner @ 2016-10-05 11:34 UTC (permalink / raw)
  To: notmuch

This will make notmuch incompatible with Xapian before 1.1.0, which is
more than 6 years old this point.
---
 lib/database.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/database.cc b/lib/database.cc
index 4bfae01..f76c375 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -1723,7 +1723,7 @@ notmuch_database_end_atomic (notmuch_database_t *notmuch)
 	 * However, we rely on flushing to test atomicity. */
 	const char *thresh = getenv ("XAPIAN_FLUSH_THRESHOLD");
 	if (thresh && atoi (thresh) == 1)
-	    db->flush ();
+	    db->commit ();
     } catch (const Xapian::Error &error) {
 	_notmuch_database_log (notmuch, "A Xapian exception occurred committing transaction: %s.\n",
 		 error.get_msg().c_str());
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] lib: optionally silence Xapian deprecation warnings
  2016-10-05 11:34 suppress deprecation warnings David Bremner
  2016-10-05 11:34 ` [PATCH 1/2] lib: replace deprecated xapian call 'flush()' with 'commit()' David Bremner
@ 2016-10-05 11:34 ` David Bremner
  2016-11-15 12:12   ` David Bremner
  1 sibling, 1 reply; 5+ messages in thread
From: David Bremner @ 2016-10-05 11:34 UTC (permalink / raw)
  To: notmuch

This is not ideal, but the new API is not available in Xapian 1.2.x, and
it seems to soon to depend on Xapian >= 1.4
---
 configure              | 1 +
 lib/database-private.h | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/configure b/configure
index cc6746c..27b3b45 100755
--- a/configure
+++ b/configure
@@ -1141,6 +1141,7 @@ COMMON_CONFIGURE_CFLAGS = \\
 	-DSTD_GETPWUID=\$(STD_GETPWUID)				\\
 	-DSTD_ASCTIME=\$(STD_ASCTIME)				\\
 	-DHAVE_XAPIAN_COMPACT=\$(HAVE_XAPIAN_COMPACT)		\\
+	-DSILENCE_XAPIAN_DEPRECATION_WARNINGS			\\
 	-DHAVE_XAPIAN_FIELD_PROCESSOR=\$(HAVE_XAPIAN_FIELD_PROCESSOR) \\
 	-DHAVE_XAPIAN_DB_RETRY_LOCK=\$(HAVE_XAPIAN_DB_RETRY_LOCK) \\
 	-DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER)
diff --git a/lib/database-private.h b/lib/database-private.h
index ca71a92..ccc1e9a 100644
--- a/lib/database-private.h
+++ b/lib/database-private.h
@@ -32,6 +32,10 @@
 
 #include "notmuch-private.h"
 
+#ifdef SILENCE_XAPIAN_DEPRECATION_WARNINGS
+#define XAPIAN_DEPRECATED(D) D
+#endif
+
 #include <xapian.h>
 
 #pragma GCC visibility push(hidden)
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] lib: replace deprecated xapian call 'flush()' with 'commit()'
  2016-10-05 11:34 ` [PATCH 1/2] lib: replace deprecated xapian call 'flush()' with 'commit()' David Bremner
@ 2016-10-26  1:05   ` David Bremner
  0 siblings, 0 replies; 5+ messages in thread
From: David Bremner @ 2016-10-26  1:05 UTC (permalink / raw)
  To: notmuch

David Bremner <david@tethera.net> writes:

> This will make notmuch incompatible with Xapian before 1.1.0, which is
> more than 6 years old this point.

pushed to master, which already requires Xapian 1.2.6, as of 0.23.1

d

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] lib: optionally silence Xapian deprecation warnings
  2016-10-05 11:34 ` [PATCH 2/2] lib: optionally silence Xapian deprecation warnings David Bremner
@ 2016-11-15 12:12   ` David Bremner
  0 siblings, 0 replies; 5+ messages in thread
From: David Bremner @ 2016-11-15 12:12 UTC (permalink / raw)
  To: notmuch

David Bremner <david@tethera.net> writes:

> This is not ideal, but the new API is not available in Xapian 1.2.x, and
> it seems to soon to depend on Xapian >= 1.4

pushed to master

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-15 12:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-05 11:34 suppress deprecation warnings David Bremner
2016-10-05 11:34 ` [PATCH 1/2] lib: replace deprecated xapian call 'flush()' with 'commit()' David Bremner
2016-10-26  1:05   ` David Bremner
2016-10-05 11:34 ` [PATCH 2/2] lib: optionally silence Xapian deprecation warnings David Bremner
2016-11-15 12:12   ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).