summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTomi Ollila <tomi.ollila@iki.fi>2020-04-22 00:07:29 +0300
committerDavid Bremner <david@tethera.net>2020-04-23 21:28:45 -0300
commit00cdfe10717020423870fdaf56e973db9aba9f5a (patch)
treec958339dfb55e818f51657b62e8f1831868b34bf /lib
parente02bb7e9fdbc96c66f32ce531509824f8afd4686 (diff)
build: drop support for xapian versions less than 1.4
Xapian 1.4 is over 3 years old now (1.4.0 released 2016-06-24), and 1.2 has been deprecated in Notmuch version 0.27 (2018-06-13). Xapian 1.4 supports compaction, field processors and retry locking; conditionals checking compaction and field processors were removed but user may want to disable retry locking at configure time so it is kept.
Diffstat (limited to 'lib')
-rw-r--r--lib/built-with.c4
-rw-r--r--lib/database.cc10
-rw-r--r--lib/parse-time-vrp.cc2
-rw-r--r--lib/parse-time-vrp.h3
-rw-r--r--lib/query-fp.cc3
-rw-r--r--lib/query-fp.h3
-rw-r--r--lib/regexp-fields.cc2
-rw-r--r--lib/regexp-fields.h4
-rw-r--r--lib/thread-fp.cc3
-rw-r--r--lib/thread-fp.h3
10 files changed, 7 insertions, 30 deletions
diff --git a/lib/built-with.c b/lib/built-with.c
index 320be6c5..0c70010b 100644
--- a/lib/built-with.c
+++ b/lib/built-with.c
@@ -25,9 +25,9 @@ notmuch_bool_t
notmuch_built_with (const char *name)
{
if (STRNCMP_LITERAL (name, "compact") == 0) {
- return HAVE_XAPIAN_COMPACT;
+ return true;
} else if (STRNCMP_LITERAL (name, "field_processor") == 0) {
- return HAVE_XAPIAN_FIELD_PROCESSOR;
+ return true;
} else if (STRNCMP_LITERAL (name, "retry_lock") == 0) {
return HAVE_XAPIAN_DB_RETRY_LOCK;
} else if (STRNCMP_LITERAL (name, "session_key") == 0) {
diff --git a/lib/database.cc b/lib/database.cc
index 24b7ec43..78b5fec9 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -291,12 +291,10 @@ prefix_t prefix_table[] = {
*/
{ "folder", "XFOLDER:", NOTMUCH_FIELD_EXTERNAL |
NOTMUCH_FIELD_PROCESSOR },
-#if HAVE_XAPIAN_FIELD_PROCESSOR
{ "date", NULL, NOTMUCH_FIELD_EXTERNAL |
NOTMUCH_FIELD_PROCESSOR },
{ "query", NULL, NOTMUCH_FIELD_EXTERNAL |
NOTMUCH_FIELD_PROCESSOR },
-#endif
{ "from", "XFROM", NOTMUCH_FIELD_EXTERNAL |
NOTMUCH_FIELD_PROBABILISTIC |
NOTMUCH_FIELD_PROCESSOR },
@@ -380,7 +378,6 @@ _setup_user_query_fields (notmuch_database_t *notmuch)
return NOTMUCH_STATUS_SUCCESS;
}
-#if HAVE_XAPIAN_FIELD_PROCESSOR
static void
_setup_query_field (const prefix_t *prefix, notmuch_database_t *notmuch)
{
@@ -405,13 +402,6 @@ _setup_query_field (const prefix_t *prefix, notmuch_database_t *notmuch)
_setup_query_field_default (prefix, notmuch);
}
}
-#else
-static inline void
-_setup_query_field (const prefix_t *prefix, notmuch_database_t *notmuch)
-{
- _setup_query_field_default (prefix, notmuch);
-}
-#endif
const char *
_find_prefix (const char *name)
diff --git a/lib/parse-time-vrp.cc b/lib/parse-time-vrp.cc
index 45db9597..168d5810 100644
--- a/lib/parse-time-vrp.cc
+++ b/lib/parse-time-vrp.cc
@@ -65,7 +65,6 @@ ParseTimeValueRangeProcessor::operator() (std::string &begin, std::string &end)
return valno;
}
-#if HAVE_XAPIAN_FIELD_PROCESSOR
/* XXX TODO: is throwing an exception the right thing to do here? */
Xapian::Query
DateFieldProcessor::operator() (const std::string & str)
@@ -86,4 +85,3 @@ DateFieldProcessor::operator() (const std::string & str)
Xapian::Query (Xapian::Query::OP_VALUE_GE, 0, Xapian::sortable_serialise ((double) from)),
Xapian::Query (Xapian::Query::OP_VALUE_LE, 0, Xapian::sortable_serialise ((double) to)));
}
-#endif
diff --git a/lib/parse-time-vrp.h b/lib/parse-time-vrp.h
index e6138d05..9fb1af60 100644
--- a/lib/parse-time-vrp.h
+++ b/lib/parse-time-vrp.h
@@ -39,9 +39,8 @@ public:
Xapian::valueno operator() (std::string &begin, std::string &end);
};
-#if HAVE_XAPIAN_FIELD_PROCESSOR
class DateFieldProcessor : public Xapian::FieldProcessor {
Xapian::Query operator() (const std::string & str);
};
-#endif
+
#endif /* NOTMUCH_PARSE_TIME_VRP_H */
diff --git a/lib/query-fp.cc b/lib/query-fp.cc
index c39f5915..b980b7f0 100644
--- a/lib/query-fp.cc
+++ b/lib/query-fp.cc
@@ -24,8 +24,6 @@
#include "query-fp.h"
#include <iostream>
-#if HAVE_XAPIAN_FIELD_PROCESSOR
-
Xapian::Query
QueryFieldProcessor::operator() (const std::string & name)
{
@@ -40,4 +38,3 @@ QueryFieldProcessor::operator() (const std::string & name)
return parser.parse_query (expansion, NOTMUCH_QUERY_PARSER_FLAGS);
}
-#endif
diff --git a/lib/query-fp.h b/lib/query-fp.h
index 8a8bde62..beaaf405 100644
--- a/lib/query-fp.h
+++ b/lib/query-fp.h
@@ -26,7 +26,6 @@
#include <xapian.h>
#include "notmuch.h"
-#if HAVE_XAPIAN_FIELD_PROCESSOR
class QueryFieldProcessor : public Xapian::FieldProcessor {
protected:
Xapian::QueryParser &parser;
@@ -40,5 +39,5 @@ public:
Xapian::Query operator() (const std::string & str);
};
-#endif
+
#endif /* NOTMUCH_QUERY_FP_H */
diff --git a/lib/regexp-fields.cc b/lib/regexp-fields.cc
index 198eb32f..0feb50e5 100644
--- a/lib/regexp-fields.cc
+++ b/lib/regexp-fields.cc
@@ -26,7 +26,6 @@
#include "notmuch-private.h"
#include "database-private.h"
-#if HAVE_XAPIAN_FIELD_PROCESSOR
static void
compile_regex (regex_t &regexp, const char *str)
{
@@ -208,4 +207,3 @@ RegexpFieldProcessor::operator() (const std::string & str)
}
}
}
-#endif
diff --git a/lib/regexp-fields.h b/lib/regexp-fields.h
index 97778a1d..a8cca243 100644
--- a/lib/regexp-fields.h
+++ b/lib/regexp-fields.h
@@ -24,7 +24,7 @@
#ifndef NOTMUCH_REGEXP_FIELDS_H
#define NOTMUCH_REGEXP_FIELDS_H
-#if HAVE_XAPIAN_FIELD_PROCESSOR
+
#include <sys/types.h>
#include <regex.h>
#include "database-private.h"
@@ -79,5 +79,5 @@ public:
Xapian::Query operator() (const std::string & str);
};
-#endif
+
#endif /* NOTMUCH_REGEXP_FIELDS_H */
diff --git a/lib/thread-fp.cc b/lib/thread-fp.cc
index 73277006..97a65211 100644
--- a/lib/thread-fp.cc
+++ b/lib/thread-fp.cc
@@ -24,8 +24,6 @@
#include "thread-fp.h"
#include <iostream>
-#if HAVE_XAPIAN_FIELD_PROCESSOR
-
Xapian::Query
ThreadFieldProcessor::operator() (const std::string & str)
{
@@ -64,4 +62,3 @@ ThreadFieldProcessor::operator() (const std::string & str)
}
}
-#endif
diff --git a/lib/thread-fp.h b/lib/thread-fp.h
index de837d3e..00bf1aa2 100644
--- a/lib/thread-fp.h
+++ b/lib/thread-fp.h
@@ -26,7 +26,6 @@
#include <xapian.h>
#include "notmuch.h"
-#if HAVE_XAPIAN_FIELD_PROCESSOR
class ThreadFieldProcessor : public Xapian::FieldProcessor {
protected:
Xapian::QueryParser &parser;
@@ -40,5 +39,5 @@ public:
Xapian::Query operator() (const std::string & str);
};
-#endif
+
#endif /* NOTMUCH_THREAD_FP_H */