* improve checks for database version

This commit is contained in:
Dirk-Jan C. Binnema
2011-01-12 23:13:03 +02:00
parent 87f9dc6cb6
commit d1bf8b3c73
6 changed files with 195 additions and 131 deletions

View File

@ -78,7 +78,7 @@ get_output_format (const char *formatstr)
static void
update_warning (void)
upgrade_warning (void)
{
g_warning ("the database needs to be updated to version %s\n",
MU_XAPIAN_DB_VERSION);
@ -300,14 +300,14 @@ get_query (MuConfig *opts)
static gboolean
db_is_ready (const char *xpath)
{
if (mu_util_db_is_empty (xpath)) {
if (mu_util_xapian_is_empty (xpath)) {
g_warning ("database is empty; use 'mu index' to "
"add messages");
return FALSE;
}
if (!mu_util_db_version_up_to_date (xpath)) {
update_warning ();
if (mu_util_xapian_needs_upgrade (xpath)) {
upgrade_warning ();
return FALSE;
}