Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a few issues found while packaging #12

Closed
darix opened this issue Jan 24, 2019 · 7 comments
Closed

a few issues found while packaging #12

darix opened this issue Jan 24, 2019 · 7 comments

Comments

@darix
Copy link

darix commented Jan 24, 2019

  1. document which xapian version is required as minimum. 1.2.x doesnt seem to be enough. maybe even check the required version in your configure script. you are using DB_RETRY_LOCK which seems missing in 1.2.x

  2. you are using cstdio without including it

diff --git a/src/fts-backend-xapian.cpp b/src/fts-backend-xapian.cpp
index a5a77b8..edd5145 100644
--- a/src/fts-backend-xapian.cpp
+++ b/src/fts-backend-xapian.cpp
@@ -1,6 +1,7 @@
 /* Copyright (c) 2019 Joan Moreau <jom@grosjo.net>, see the included COPYING file */
 
 #include <xapian.h>
+#include <cstdio>
 extern "C" {
 #include "fts-xapian-plugin.h"
 }
  1. openSUSE user can find a package soon on https://software.opensuse.org/download.html?project=server:mail&package=dovecot23-fts-xapian
@darix
Copy link
Author

darix commented Jan 24, 2019

Forgot the compiler warnings:

In file included from fts-backend-xapian.cpp:46:0:
fts-backend-xapian-functions.cpp: In function 'void fts_backend_xapian_oldbox(xapian_fts_backend*)':
fts-backend-xapian-functions.cpp:481:113: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat=]
                 i_info("Done indexing '%s' (%d msgs in %d ms, rate: %.1f)",backend->oldbox,backend->perf_nb,dt,r);
                                                                                                                 ^
fts-backend-xapian-functions.cpp:481:113: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long int' [-Wformat=]
fts-backend-xapian-functions.cpp: In function 'bool fts_backend_xapian_check_write(xapian_fts_backend*)':
fts-backend-xapian-functions.cpp:600:87: error: 'DB_RETRY_LOCK' is not a member of 'Xapian'
   backend->dbw = new Xapian::WritableDatabase(backend->db,Xapian::DB_CREATE_OR_OPEN | Xapian::DB_RETRY_LOCK);
                                                                                       ^
fts-backend-xapian.cpp: In function 'void fts_backend_xapian_update_unset_build_key(fts_backend_update_context*)':
fts-backend-xapian.cpp:311:29: warning: unused variable 'backend' [-Wunused-variable]
  struct xapian_fts_backend *backend =
                             ^
fts-backend-xapian.cpp: In function 'int fts_backend_xapian_lookup(fts_backend*, mailbox*, mail_search_arg*, fts_lookup_flags, fts_result*)':
fts-backend-xapian.cpp:488:30: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long int' [-Wformat=]
  i_info("Query: %d results",n);
  ```

grosjo added a commit that referenced this issue Jan 24, 2019
@grosjo
Copy link
Owner

grosjo commented Jan 24, 2019

I added your fixes.
For Xapian, yes, you need 1.4.x (added in Readme), which is the default (at least in Archlinux)

@grosjo
Copy link
Owner

grosjo commented Jan 24, 2019

Thank you for adding in OpenSuse

@cmouse
Copy link
Contributor

cmouse commented Jan 24, 2019

You can tell pkg-check the minimum version you want. See https://autotools.io/pkgconfig/pkg_check_modules.html

@grosjo
Copy link
Owner

grosjo commented Jan 24, 2019

I am honestly a total newbie with autotools.
@cmouse Can you please kindly suggest the corrections via a pull request ?

@grosjo
Copy link
Owner

grosjo commented Jan 24, 2019

Tried d3a90b9
Is that ok ?

@darix
Copy link
Author

darix commented Jan 24, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants