* mu-util-xapian: do extra logging, small updates
This commit is contained in:
@ -42,6 +42,10 @@ mu_util_xapian_db_version (const gchar *xpath)
|
|||||||
Xapian::Database db (xpath);
|
Xapian::Database db (xpath);
|
||||||
const std::string version
|
const std::string version
|
||||||
(db.get_metadata (MU_XAPIAN_VERSION_KEY));
|
(db.get_metadata (MU_XAPIAN_VERSION_KEY));
|
||||||
|
|
||||||
|
MU_WRITE_LOG ("database version: '%s', expected '%s'",
|
||||||
|
version.empty() ? "<none>" : version.c_str(),
|
||||||
|
MU_XAPIAN_DB_VERSION);
|
||||||
|
|
||||||
return version.empty() ? NULL : g_strdup (version.c_str());
|
return version.empty() ? NULL : g_strdup (version.c_str());
|
||||||
|
|
||||||
@ -80,6 +84,8 @@ mu_util_xapian_clear_database (const gchar *xpath)
|
|||||||
(xpath, Xapian::DB_CREATE_OR_OVERWRITE);
|
(xpath, Xapian::DB_CREATE_OR_OVERWRITE);
|
||||||
db.flush ();
|
db.flush ();
|
||||||
|
|
||||||
|
MU_WRITE_LOG ("emptied database %s", xpath);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
} MU_XAPIAN_CATCH_BLOCK;
|
} MU_XAPIAN_CATCH_BLOCK;
|
||||||
|
|||||||
@ -35,7 +35,7 @@ G_BEGIN_DECLS
|
|||||||
* @return the version of the database as a newly allocated string
|
* @return the version of the database as a newly allocated string
|
||||||
* (free with g_free); if there is no version yet, it will return NULL
|
* (free with g_free); if there is no version yet, it will return NULL
|
||||||
*/
|
*/
|
||||||
char* mu_util_xapian_db_version (const gchar *xpath);
|
gchar* mu_util_xapian_db_version (const gchar *xpath) G_GNUC_WARN_UNUSED_RESULT;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,8 +47,6 @@ char* mu_util_xapian_db_version (const gchar *xpath);
|
|||||||
*/
|
*/
|
||||||
gboolean mu_util_xapian_db_version_up_to_date (const gchar *xpath);
|
gboolean mu_util_xapian_db_version_up_to_date (const gchar *xpath);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clear the database, ie., remove all of the contents. This is a
|
* clear the database, ie., remove all of the contents. This is a
|
||||||
* destructive operation, but the database can be restored be doing a
|
* destructive operation, but the database can be restored be doing a
|
||||||
|
|||||||
Reference in New Issue
Block a user