]> git.notmuchmail.org Git - notmuch/commitdiff
fix build without sfsexp
authorMichael J Gruber <git@grubix.eu>
Fri, 15 Apr 2022 16:23:46 +0000 (18:23 +0200)
committerDavid Bremner <david@tethera.net>
Fri, 15 Apr 2022 17:17:31 +0000 (14:17 -0300)
a1d139de ("lib: add sexp: prefix to Xapian (infix) query parser.",
2022-04-09) introduced sfsexp infix queries. This requires the infix
preprocessor to be built in in a way which does not require sfsexp when
notmuch is built without it.

Make the preprocessor throw a Xapian error in this case (and fix the
build).

Signed-off-by: Michael J Gruber <git@grubix.eu>
lib/database-private.h
lib/query.cc
lib/sexp-fp.cc

index 657b1aa11dc1d71b411c0fc45b6d814464d51611..419b9fe6bd521c0f7ba3e5934fd06a11e3f864a6 100644 (file)
@@ -354,10 +354,6 @@ _notmuch_query_string_to_xapian_query (notmuch_database_t *notmuch,
                                       std::string query_string,
                                       Xapian::Query &output,
                                       std::string &msg);
-/* parse-sexp.cc */
-notmuch_status_t
-_notmuch_sexp_string_to_xapian_query (notmuch_database_t *notmuch, const char *querystr,
-                                     Xapian::Query &output);
 
 notmuch_status_t
 _notmuch_query_expand (notmuch_database_t *notmuch, const char *field, Xapian::Query subquery,
index b0937fcc97ed3eefa4fb51881ebc4159843bb575..707f6222b16bd001c17097439e49804a6babc4ef 100644 (file)
@@ -227,6 +227,7 @@ _notmuch_query_ensure_parsed_xapian (notmuch_query_t *query)
     return NOTMUCH_STATUS_SUCCESS;
 }
 
+#if HAVE_SFSEXP
 static notmuch_status_t
 _notmuch_query_ensure_parsed_sexpr (notmuch_query_t *query)
 {
@@ -243,6 +244,7 @@ _notmuch_query_ensure_parsed_sexpr (notmuch_query_t *query)
     _notmuch_query_cache_terms (query);
     return NOTMUCH_STATUS_SUCCESS;
 }
+#endif
 
 static notmuch_status_t
 _notmuch_query_ensure_parsed (notmuch_query_t *query)
index ed26f6ec365cd1e3d9edad24bdc5231d386b62e1..1fdf5225a588faccde07be545c67a7a0ce402201 100644 (file)
@@ -30,10 +30,14 @@ SexpFieldProcessor::operator() (const std::string & query_string)
     notmuch_status_t status;
     Xapian::Query output;
 
+#if HAVE_SFSEXP
     status = _notmuch_sexp_string_to_xapian_query (notmuch, query_string.c_str (), output);
     if (status) {
        throw Xapian::QueryParserError ("error parsing " + query_string);
     }
+#else
+    throw Xapian::QueryParserError ("sexp query parser not available");
+#endif
 
     return output;