mu-cmd: update for lib/mu-store changes
* some small API updates * in with_store, try to rebuild automatically when possible
This commit is contained in:
@ -229,17 +229,11 @@ get_query_obj (MuStore *store, GError **err)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
g_set_error (err, MU_ERROR_DOMAIN, MU_ERROR_XAPIAN_IS_EMPTY,
|
g_set_error (err, MU_ERROR_DOMAIN, MU_ERROR_XAPIAN_NEEDS_REINDEX,
|
||||||
"the database is empty");
|
"the database is empty");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mu_store_versions_match (store)) {
|
|
||||||
g_set_error (err, MU_ERROR_DOMAIN, MU_ERROR_XAPIAN_VERSION_MISMATCH,
|
|
||||||
"the database needs a rebuild");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
mquery = mu_query_new (store, err);
|
mquery = mu_query_new (store, err);
|
||||||
if (!mquery)
|
if (!mquery)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
#include "mu-util.h"
|
#include "mu-util.h"
|
||||||
#include "mu-msg.h"
|
#include "mu-msg.h"
|
||||||
#include "mu-index.h"
|
#include "mu-index.h"
|
||||||
#include "mu-store.h"
|
#include "mu-store.hh"
|
||||||
#include "mu-runtime.h"
|
#include "mu-runtime.h"
|
||||||
#include "mu-log.h"
|
#include "mu-log.h"
|
||||||
|
|
||||||
@ -81,12 +81,6 @@ check_params (MuConfig *opts, GError **err)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opts->xbatchsize < 0) {
|
|
||||||
mu_util_g_set_error (err, MU_ERROR_IN_PARAMETERS,
|
|
||||||
"the batch size must be >= 0");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (opts->max_msg_size < 0) {
|
if (opts->max_msg_size < 0) {
|
||||||
mu_util_g_set_error (err, MU_ERROR_IN_PARAMETERS,
|
mu_util_g_set_error (err, MU_ERROR_IN_PARAMETERS,
|
||||||
"the maximum message size must >= 0");
|
"the maximum message size must >= 0");
|
||||||
@ -185,36 +179,6 @@ index_msg_cb (MuIndexStats* stats, IndexData *idata)
|
|||||||
return MU_CAUGHT_SIGNAL ? MU_STOP: MU_OK;
|
return MU_CAUGHT_SIGNAL ? MU_STOP: MU_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
database_version_check_and_update (MuStore *store, MuConfig *opts,
|
|
||||||
GError **err)
|
|
||||||
{
|
|
||||||
if (mu_store_count (store, err) == 0)
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
/* when rebuilding, we empty the database before doing
|
|
||||||
* anything */
|
|
||||||
if (opts->rebuild) {
|
|
||||||
g_debug ("clearing database");
|
|
||||||
g_debug ("clearing contacts-cache");
|
|
||||||
return mu_store_clear (store, err);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mu_store_versions_match (store))
|
|
||||||
return TRUE; /* ok, nothing to do */
|
|
||||||
|
|
||||||
/* ok, database is not up to date */
|
|
||||||
if (opts->autoupgrade) {
|
|
||||||
g_debug ("auto-upgrade: clearing old database and cache");
|
|
||||||
return mu_store_clear (store, err);
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
show_time (unsigned t, unsigned processed, gboolean color)
|
show_time (unsigned t, unsigned processed, gboolean color)
|
||||||
{
|
{
|
||||||
@ -288,17 +252,44 @@ cleanup_missing (MuIndex *midx, MuConfig *opts, MuIndexStats *stats,
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
index_title (const char* maildir, const char* xapiandir, gboolean color)
|
index_title (MuStore *store, MuConfig *opts)
|
||||||
{
|
{
|
||||||
if (color)
|
const char *blue, *green, *def;
|
||||||
g_print ("indexing messages under "
|
char **addrs;
|
||||||
MU_COLOR_BLUE "%s" MU_COLOR_DEFAULT
|
int i;
|
||||||
" ["
|
time_t created;
|
||||||
MU_COLOR_BLUE "%s" MU_COLOR_DEFAULT
|
struct tm *tstamp;
|
||||||
"]\n", maildir, xapiandir);
|
char tbuf[40];
|
||||||
else
|
|
||||||
g_print ("indexing messages under %s [%s]\n",
|
blue = opts->nocolor ? "" : MU_COLOR_BLUE;
|
||||||
maildir, xapiandir);
|
green = opts->nocolor ? "" : MU_COLOR_GREEN;
|
||||||
|
def = opts->nocolor ? "" : MU_COLOR_DEFAULT;
|
||||||
|
|
||||||
|
g_print ("database : %s%s%s\n",
|
||||||
|
green, mu_store_database_path (store), def);
|
||||||
|
g_print ("schema-version : %s%s%s\n",
|
||||||
|
green, mu_store_schema_version(store), def);
|
||||||
|
|
||||||
|
created = mu_store_created (store);
|
||||||
|
tstamp = localtime (&created);
|
||||||
|
strftime (tbuf, sizeof(tbuf), "%c", tstamp);
|
||||||
|
|
||||||
|
g_print ("created : %s%s%s\n", green, tbuf, def);
|
||||||
|
g_print ("maildir : %s%s%s\n",
|
||||||
|
green, mu_store_maildir (store), def);
|
||||||
|
|
||||||
|
g_print ("personal-addresses : ");
|
||||||
|
|
||||||
|
addrs = mu_store_personal_addresses (store);
|
||||||
|
for (i = 0; addrs[i]; ++i) {
|
||||||
|
if (i != 0)
|
||||||
|
g_print (" ");
|
||||||
|
g_print ("%s%s%s\n", green, addrs[i], def);
|
||||||
|
}
|
||||||
|
|
||||||
|
g_strfreev(addrs);
|
||||||
|
|
||||||
|
g_print ("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -309,11 +300,6 @@ cmd_index (MuIndex *midx, MuConfig *opts, MuIndexStats *stats, GError **err)
|
|||||||
MuError rv;
|
MuError rv;
|
||||||
gboolean show_progress;
|
gboolean show_progress;
|
||||||
|
|
||||||
if (!opts->quiet)
|
|
||||||
index_title (opts->maildir,
|
|
||||||
mu_runtime_path(MU_RUNTIME_PATH_XAPIANDB),
|
|
||||||
!opts->nocolor);
|
|
||||||
|
|
||||||
show_progress = !opts->quiet && isatty(fileno(stdout));
|
show_progress = !opts->quiet && isatty(fileno(stdout));
|
||||||
idata.color = !opts->nocolor;
|
idata.color = !opts->nocolor;
|
||||||
|
|
||||||
@ -345,10 +331,6 @@ init_mu_index (MuStore *store, MuConfig *opts, GError **err)
|
|||||||
if (!check_params (opts, err))
|
if (!check_params (opts, err))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!database_version_check_and_update(store, opts, err))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
|
|
||||||
if (!check_maildir (opts->maildir, err))
|
if (!check_maildir (opts->maildir, err))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -357,7 +339,6 @@ init_mu_index (MuStore *store, MuConfig *opts, GError **err)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
mu_index_set_max_msg_size (midx, opts->max_msg_size);
|
mu_index_set_max_msg_size (midx, opts->max_msg_size);
|
||||||
mu_index_set_xbatch_size (midx, opts->xbatchsize);
|
|
||||||
|
|
||||||
return midx;
|
return midx;
|
||||||
}
|
}
|
||||||
@ -366,10 +347,10 @@ init_mu_index (MuStore *store, MuConfig *opts, GError **err)
|
|||||||
MuError
|
MuError
|
||||||
mu_cmd_index (MuStore *store, MuConfig *opts, GError **err)
|
mu_cmd_index (MuStore *store, MuConfig *opts, GError **err)
|
||||||
{
|
{
|
||||||
MuIndex *midx;
|
MuIndex *midx;
|
||||||
MuIndexStats stats;
|
MuIndexStats stats;
|
||||||
gboolean rv;
|
gboolean rv;
|
||||||
time_t t;
|
time_t t;
|
||||||
|
|
||||||
g_return_val_if_fail (opts, FALSE);
|
g_return_val_if_fail (opts, FALSE);
|
||||||
g_return_val_if_fail (opts->cmd == MU_CONFIG_CMD_INDEX,
|
g_return_val_if_fail (opts->cmd == MU_CONFIG_CMD_INDEX,
|
||||||
@ -383,6 +364,9 @@ mu_cmd_index (MuStore *store, MuConfig *opts, GError **err)
|
|||||||
mu_index_stats_clear (&stats);
|
mu_index_stats_clear (&stats);
|
||||||
install_sig_handler ();
|
install_sig_handler ();
|
||||||
|
|
||||||
|
if (!opts->quiet)
|
||||||
|
index_title (store, opts);
|
||||||
|
|
||||||
t = time (NULL);
|
t = time (NULL);
|
||||||
rv = cmd_index (midx, opts, &stats, err);
|
rv = cmd_index (midx, opts, &stats, err);
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@
|
|||||||
#include "mu-maildir.h"
|
#include "mu-maildir.h"
|
||||||
#include "mu-query.h"
|
#include "mu-query.h"
|
||||||
#include "mu-index.h"
|
#include "mu-index.h"
|
||||||
#include "mu-store.h"
|
#include "mu-store.hh"
|
||||||
#include "mu-msg-part.h"
|
#include "mu-msg-part.h"
|
||||||
#include "mu-contacts.hh"
|
#include "mu-contacts.hh"
|
||||||
|
|
||||||
@ -624,7 +624,7 @@ each_contact_sexp (const char* full_address,
|
|||||||
* @return the sexp
|
* @return the sexp
|
||||||
*/
|
*/
|
||||||
static char*
|
static char*
|
||||||
contacts_to_sexp (MuContacts *contacts, gboolean personal,
|
contacts_to_sexp (const MuContacts *contacts, gboolean personal,
|
||||||
time_t last_seen, gint64 tstamp)
|
time_t last_seen, gint64 tstamp)
|
||||||
{
|
{
|
||||||
SexpData sdata;
|
SexpData sdata;
|
||||||
@ -657,12 +657,12 @@ contacts_to_sexp (MuContacts *contacts, gboolean personal,
|
|||||||
static MuError
|
static MuError
|
||||||
cmd_contacts (ServerContext *ctx, GHashTable *args, GError **err)
|
cmd_contacts (ServerContext *ctx, GHashTable *args, GError **err)
|
||||||
{
|
{
|
||||||
MuContacts *contacts;
|
const MuContacts *contacts;
|
||||||
char *sexp;
|
char *sexp;
|
||||||
gboolean personal;
|
gboolean personal;
|
||||||
time_t after;
|
time_t after;
|
||||||
const char *str;
|
const char *str;
|
||||||
gint64 tstamp;
|
gint64 tstamp;
|
||||||
|
|
||||||
personal = get_bool_from_args (args, "personal", TRUE, NULL);
|
personal = get_bool_from_args (args, "personal", TRUE, NULL);
|
||||||
str = get_string_from_args (args, "after", TRUE, NULL);
|
str = get_string_from_args (args, "after", TRUE, NULL);
|
||||||
@ -1012,7 +1012,7 @@ set_my_addresses (MuStore *store, const char *addrstr)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
my_addresses = g_strsplit (addrstr, ",", -1);
|
my_addresses = g_strsplit (addrstr, ",", -1);
|
||||||
mu_store_set_my_addresses (store, (const char**)my_addresses);
|
mu_store_set_personal_addresses (store, (const char**)my_addresses);
|
||||||
|
|
||||||
g_strfreev (my_addresses);
|
g_strfreev (my_addresses);
|
||||||
}
|
}
|
||||||
@ -1040,7 +1040,7 @@ static MuError
|
|||||||
index_and_maybe_cleanup (MuIndex *index, const char *path,
|
index_and_maybe_cleanup (MuIndex *index, const char *path,
|
||||||
gboolean cleanup, gboolean lazy_check, GError **err)
|
gboolean cleanup, gboolean lazy_check, GError **err)
|
||||||
{
|
{
|
||||||
MuError rv;
|
MuError rv;
|
||||||
MuIndexStats stats, stats2;
|
MuIndexStats stats, stats2;
|
||||||
|
|
||||||
mu_index_stats_clear (&stats);
|
mu_index_stats_clear (&stats);
|
||||||
@ -1100,7 +1100,6 @@ cmd_index (ServerContext *ctx, GHashTable *args, GError **err)
|
|||||||
index_and_maybe_cleanup (index, path,
|
index_and_maybe_cleanup (index, path,
|
||||||
cleanup, lazy_check,
|
cleanup, lazy_check,
|
||||||
err);
|
err);
|
||||||
|
|
||||||
leave:
|
leave:
|
||||||
g_free (path);
|
g_free (path);
|
||||||
|
|
||||||
@ -1531,10 +1530,6 @@ cmd_view (ServerContext *ctx, GHashTable *args, GError **err)
|
|||||||
return MU_OK;
|
return MU_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
static MuError
|
static MuError
|
||||||
@ -1578,12 +1573,11 @@ handle_args (ServerContext *ctx, GHashTable *args, GError **err)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MuError
|
MuError
|
||||||
mu_cmd_server (MuStore *store, MuConfig *opts/*unused*/, GError **err)
|
mu_cmd_server (MuStore *store, MuConfig *opts/*unused*/, GError **err)
|
||||||
{
|
{
|
||||||
ServerContext ctx;
|
ServerContext ctx;
|
||||||
gboolean do_quit;
|
gboolean do_quit;
|
||||||
|
|
||||||
g_return_val_if_fail (store, MU_ERROR_INTERNAL);
|
g_return_val_if_fail (store, MU_ERROR_INTERNAL);
|
||||||
|
|
||||||
|
|||||||
58
mu/mu-cmd.c
58
mu/mu-cmd.c
@ -38,7 +38,6 @@
|
|||||||
#include "mu-contacts.hh"
|
#include "mu-contacts.hh"
|
||||||
#include "mu-runtime.h"
|
#include "mu-runtime.h"
|
||||||
#include "mu-flags.h"
|
#include "mu-flags.h"
|
||||||
#include "mu-store.h"
|
|
||||||
#include "mu-log.h"
|
#include "mu-log.h"
|
||||||
|
|
||||||
#define VIEW_TERMINATOR '\f' /* form-feed */
|
#define VIEW_TERMINATOR '\f' /* form-feed */
|
||||||
@ -569,31 +568,68 @@ show_usage (void)
|
|||||||
|
|
||||||
typedef MuError (*store_func) (MuStore *, MuConfig *, GError **err);
|
typedef MuError (*store_func) (MuStore *, MuConfig *, GError **err);
|
||||||
|
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
needs_rebuild (MuStore *store, MuConfig *opts, GError **err)
|
||||||
|
{
|
||||||
|
if (store)
|
||||||
|
return mu_store_count(store, NULL) == 0;
|
||||||
|
else
|
||||||
|
return err &&
|
||||||
|
(*err)->code == MU_ERROR_XAPIAN_NEEDS_REINDEX &&
|
||||||
|
opts->maildir;
|
||||||
|
}
|
||||||
|
|
||||||
static MuError
|
static MuError
|
||||||
with_store (store_func func, MuConfig *opts, gboolean read_only,
|
with_store (store_func func, MuConfig *opts, gboolean read_only,
|
||||||
GError **err)
|
GError **err)
|
||||||
{
|
{
|
||||||
MuStore *store;
|
MuStore *store;
|
||||||
MuError merr;
|
MuError merr;
|
||||||
|
|
||||||
if (read_only)
|
if (opts->rebuild && read_only) {
|
||||||
store = mu_store_new_read_only
|
g_set_error (err, MU_ERROR_DOMAIN, MU_ERROR,
|
||||||
(mu_runtime_path(MU_RUNTIME_PATH_XAPIANDB),
|
"cannot rebuild a read-only database");
|
||||||
err);
|
return MU_G_ERROR_CODE(err);
|
||||||
else
|
}
|
||||||
|
|
||||||
|
if (read_only) {
|
||||||
|
store = mu_store_new_readable (
|
||||||
|
mu_runtime_path(MU_RUNTIME_PATH_XAPIANDB), err);
|
||||||
|
} else if (!opts->rebuild) {
|
||||||
store = mu_store_new_writable
|
store = mu_store_new_writable
|
||||||
|
(mu_runtime_path(MU_RUNTIME_PATH_XAPIANDB), err);
|
||||||
|
if (needs_rebuild (store, opts, err)) {
|
||||||
|
if (store)
|
||||||
|
mu_store_unref(store);
|
||||||
|
opts->rebuild = TRUE;
|
||||||
|
g_clear_error (err);
|
||||||
|
return with_store(func, opts, read_only, err);
|
||||||
|
}
|
||||||
|
} else { /* rebuilding */
|
||||||
|
if (!opts->maildir) {
|
||||||
|
g_set_error (err, MU_ERROR_DOMAIN,
|
||||||
|
MU_ERROR_IN_PARAMETERS,
|
||||||
|
"missing --maildir parameter");
|
||||||
|
}
|
||||||
|
store = mu_store_new_create
|
||||||
(mu_runtime_path(MU_RUNTIME_PATH_XAPIANDB),
|
(mu_runtime_path(MU_RUNTIME_PATH_XAPIANDB),
|
||||||
opts->rebuild, err);
|
opts->maildir, err);
|
||||||
|
}
|
||||||
|
|
||||||
if (!store)
|
if (!store)
|
||||||
return MU_G_ERROR_CODE(err);
|
return MU_G_ERROR_CODE(err);
|
||||||
|
|
||||||
mu_store_set_my_addresses (store, (const char**)opts->my_addresses);
|
if (!read_only && opts->my_addresses)
|
||||||
|
mu_store_set_personal_addresses (
|
||||||
|
store, (const char**)opts->my_addresses);
|
||||||
|
|
||||||
merr = func (store, opts, err);
|
merr = func (store, opts, err);
|
||||||
mu_store_unref (store);
|
mu_store_unref (store);
|
||||||
|
|
||||||
return merr;
|
return merr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
check_params (MuConfig *opts, GError **err)
|
check_params (MuConfig *opts, GError **err)
|
||||||
{
|
{
|
||||||
@ -607,7 +643,6 @@ check_params (MuConfig *opts, GError **err)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_log_options (MuConfig *opts)
|
set_log_options (MuConfig *opts)
|
||||||
{
|
{
|
||||||
@ -626,7 +661,6 @@ set_log_options (MuConfig *opts)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MuError
|
MuError
|
||||||
mu_cmd_execute (MuConfig *opts, GError **err)
|
mu_cmd_execute (MuConfig *opts, GError **err)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -19,13 +19,12 @@
|
|||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef __MU_CMD_H__
|
#ifndef __MU_CMD_H__
|
||||||
#define __MU_CMD_H__
|
#define __MU_CMD_H__
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <mu-config.h>
|
#include <mu-config.h>
|
||||||
#include <mu-store.h>
|
#include <mu-store.hh>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
|||||||
@ -132,8 +132,6 @@ config_options_group_mu (void)
|
|||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_group_index_defaults (void)
|
set_group_index_defaults (void)
|
||||||
{
|
{
|
||||||
@ -156,16 +154,10 @@ config_options_group_index (void)
|
|||||||
"only check dir-timestamps (false)", NULL},
|
"only check dir-timestamps (false)", NULL},
|
||||||
{"my-address", 0, 0, G_OPTION_ARG_STRING_ARRAY,
|
{"my-address", 0, 0, G_OPTION_ARG_STRING_ARRAY,
|
||||||
&MU_CONFIG.my_addresses,
|
&MU_CONFIG.my_addresses,
|
||||||
"my e-mail address (regexp); can be used multiple times",
|
"my e-mail address; can be used multiple times",
|
||||||
"<address>"},
|
"<address>"},
|
||||||
{"autoupgrade", 0, 0, G_OPTION_ARG_NONE,
|
|
||||||
&MU_CONFIG.autoupgrade,
|
|
||||||
"auto-upgrade the database with new mu versions (false)",
|
|
||||||
NULL},
|
|
||||||
{"nocleanup", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.nocleanup,
|
{"nocleanup", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.nocleanup,
|
||||||
"don't clean up the database after indexing (false)", NULL},
|
"don't clean up the database after indexing (false)", NULL},
|
||||||
{"xbatchsize", 0, 0, G_OPTION_ARG_INT, &MU_CONFIG.xbatchsize,
|
|
||||||
"set transaction batchsize for xapian commits (0)", NULL},
|
|
||||||
{"max-msg-size", 0, 0, G_OPTION_ARG_INT,
|
{"max-msg-size", 0, 0, G_OPTION_ARG_INT,
|
||||||
&MU_CONFIG.max_msg_size,
|
&MU_CONFIG.max_msg_size,
|
||||||
"set the maximum size for message files", "<size>"},
|
"set the maximum size for message files", "<size>"},
|
||||||
|
|||||||
@ -114,13 +114,8 @@ struct _MuConfig {
|
|||||||
gchar *maildir; /* where the mails are */
|
gchar *maildir; /* where the mails are */
|
||||||
gboolean nocleanup; /* don't cleanup del'd mails from db */
|
gboolean nocleanup; /* don't cleanup del'd mails from db */
|
||||||
gboolean rebuild; /* empty the database before indexing */
|
gboolean rebuild; /* empty the database before indexing */
|
||||||
gboolean autoupgrade; /* automatically upgrade db
|
|
||||||
* when needed */
|
|
||||||
gboolean lazycheck; /* don't check dirs with up-to-date
|
gboolean lazycheck; /* don't check dirs with up-to-date
|
||||||
* timestamps */
|
* timestamps */
|
||||||
int xbatchsize; /* batchsize for xapian
|
|
||||||
* commits, or 0 for
|
|
||||||
* default */
|
|
||||||
int max_msg_size; /* maximum size for message files */
|
int max_msg_size; /* maximum size for message files */
|
||||||
char** my_addresses; /* 'my e-mail address', for mu
|
char** my_addresses; /* 'my e-mail address', for mu
|
||||||
* cfind; can be use multiple
|
* cfind; can be use multiple
|
||||||
@ -136,7 +131,7 @@ struct _MuConfig {
|
|||||||
gboolean summary; /* OBSOLETE: use summary_len */
|
gboolean summary; /* OBSOLETE: use summary_len */
|
||||||
int summary_len; /* max # of lines for summary */
|
int summary_len; /* max # of lines for summary */
|
||||||
|
|
||||||
gchar *bookmark; /* use bookmark */
|
gchar *bookmark; /* use bookmark */
|
||||||
gchar *formatstr; /* output type for find
|
gchar *formatstr; /* output type for find
|
||||||
* (plain,links,xml,json,sexp)
|
* (plain,links,xml,json,sexp)
|
||||||
* and view (plain, sexp) and cfind
|
* and view (plain, sexp) and cfind
|
||||||
|
|||||||
13
mu/mu.cc
13
mu/mu.cc
@ -58,14 +58,11 @@ handle_error (MuConfig *conf, MuError merr, GError **err)
|
|||||||
case MU_ERROR_XAPIAN_CANNOT_GET_WRITELOCK:
|
case MU_ERROR_XAPIAN_CANNOT_GET_WRITELOCK:
|
||||||
g_printerr ("maybe mu is already running?\n");
|
g_printerr ("maybe mu is already running?\n");
|
||||||
break;
|
break;
|
||||||
case MU_ERROR_XAPIAN_CORRUPTION:
|
case MU_ERROR_XAPIAN_NEEDS_REINDEX:
|
||||||
case MU_ERROR_XAPIAN_VERSION_MISMATCH:
|
g_printerr ("database needs (re)indexing.\n"
|
||||||
g_printerr ("database needs a rebuild; "
|
"try 'mu index' "
|
||||||
"try 'mu index --rebuild'\n");
|
"(see mu-index(1) for details)\n");
|
||||||
break;
|
return;
|
||||||
case MU_ERROR_XAPIAN_IS_EMPTY:
|
|
||||||
g_printerr ("database is empty; try 'mu index'\n");
|
|
||||||
break;
|
|
||||||
case MU_ERROR_IN_PARAMETERS:
|
case MU_ERROR_IN_PARAMETERS:
|
||||||
if (conf && mu_config_cmd_is_valid(conf->cmd))
|
if (conf && mu_config_cmd_is_valid(conf->cmd))
|
||||||
mu_config_show_help (conf->cmd);
|
mu_config_show_help (conf->cmd);
|
||||||
|
|||||||
Reference in New Issue
Block a user