From 094979ab687ea6f895a00aba16b0a4882c8a447a Mon Sep 17 00:00:00 2001 From: djcb Date: Sun, 21 Apr 2013 23:10:40 +0300 Subject: [PATCH] * fix some confusion between --reindex and --rebuild (remove the former) --- man/mu-index.1 | 18 ++++++------------ mu/mu-cmd-index.c | 4 +--- mu/mu-config.c | 2 -- mu/mu-config.h | 1 - 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/man/mu-index.1 b/man/mu-index.1 index 3d7ea7bb..7377d374 100644 --- a/man/mu-index.1 +++ b/man/mu-index.1 @@ -76,24 +76,18 @@ found in the address fields of a message which also has (\fBmu cfind --personal\fR) addresses which were merely seen in mailing list messages. -.TP -\fB\-\-reindex\fR re-index all mails, even ones that are already in the -database. - .TP \fB\-\-nocleanup\fR disables the database cleanup that \fBmu\fR does by default after indexing. .TP \fB\-\-rebuild\fR -clear all messages from the database before -indexing. This is effectively the same as removing the database. The -difference with \fB\-\-reindex\fR is that \fB\-\-rebuild\fR guarantees that -after the indexing has finished, there are no 'old' messages in the database -anymore, which is not true with \fB\-\-reindex\fR when indexing only a part of -messages (using \fB\-\-maildir\fR). For this reason, it is necessary to run -\fBmu index \-\-rebuild\fR when there is an upgrade in the database -format. \fBmu index\fR will issue a warning about this. +clear all messages from the database before indexing. \fB\-\-rebuild\fR +guarantees that after the indexing has finished, there are no 'old' messages +in the database anymore, which is not true with \fB\-\-reindex\fR when +indexing only a part of messages (using \fB\-\-maildir\fR). For this reason, +it is necessary to run \fBmu index \-\-rebuild\fR when there is an upgrade in +the database format. \fBmu index\fR will issue a warning about this. .TP \fB\-\-autoupgrade\fR diff --git a/mu/mu-cmd-index.c b/mu/mu-cmd-index.c index 3beadae4..2b855800 100644 --- a/mu/mu-cmd-index.c +++ b/mu/mu-cmd-index.c @@ -197,7 +197,6 @@ database_version_check_and_update (MuStore *store, MuConfig *opts, /* when rebuilding, we empty the database before doing * anything */ if (opts->rebuild) { - opts->reindex = TRUE; g_debug ("clearing database"); g_debug ("clearing contacts-cache"); return mu_store_clear (store, err); @@ -208,7 +207,6 @@ database_version_check_and_update (MuStore *store, MuConfig *opts, /* ok, database is not up to date */ if (opts->autoupgrade) { - opts->reindex = TRUE; g_debug ("auto-upgrade: clearing old database and cache"); return mu_store_clear (store, err); } @@ -319,7 +317,7 @@ cmd_index (MuIndex *midx, MuConfig *opts, MuIndexStats *stats, GError **err) show_progress = !opts->quiet && isatty(fileno(stdout)); idata.color = !opts->nocolor; newline_before_on(); - rv = mu_index_run (midx, opts->maildir, opts->reindex, stats, + rv = mu_index_run (midx, opts->maildir, opts->rebuild, stats, show_progress ? (MuIndexMsgCallback)index_msg_cb : (MuIndexMsgCallback)index_msg_silent_cb, diff --git a/mu/mu-config.c b/mu/mu-config.c index 29de498d..338420a7 100644 --- a/mu/mu-config.c +++ b/mu/mu-config.c @@ -146,8 +146,6 @@ config_options_group_index (void) GOptionEntry entries[] = { {"maildir", 'm', 0, G_OPTION_ARG_FILENAME, &MU_CONFIG.maildir, "top of the maildir", ""}, - {"reindex", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.reindex, - "index even already indexed messages (false)", NULL}, {"rebuild", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.rebuild, "rebuild the database from scratch (false)", NULL}, {"my-address", 0, 0, G_OPTION_ARG_STRING_ARRAY, diff --git a/mu/mu-config.h b/mu/mu-config.h index b7d9b737..10154c0b 100644 --- a/mu/mu-config.h +++ b/mu/mu-config.h @@ -109,7 +109,6 @@ struct _MuConfig { /* options for indexing */ gchar *maildir; /* where the mails are */ gboolean nocleanup; /* don't cleanup del'd mails from db */ - gboolean reindex; /* re-index existing mails */ gboolean rebuild; /* empty the database before indexing */ gboolean autoupgrade; /* automatically upgrade db * when needed */