* fix some confusion between --reindex and --rebuild (remove the former)

This commit is contained in:
djcb 2013-04-21 23:10:40 +03:00
parent 42807a3a01
commit 094979ab68
4 changed files with 7 additions and 18 deletions

View File

@ -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

View File

@ -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,

View File

@ -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", "<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,

View File

@ -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 */