From 7c3673b3de78c8c9976e944ba2549c597d2d5987 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Wed, 29 Apr 2020 20:27:49 +0300 Subject: [PATCH] mu: do a full index when the database is empty I.e., do _not_ honor .noupdate in that case. --- NEWS.org | 4 +++- lib/mu-index.c | 13 +++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/NEWS.org b/NEWS.org index edaeb8b2..5afa6b40 100644 --- a/NEWS.org +++ b/NEWS.org @@ -24,7 +24,9 @@ anymore. ~mu4e~ now depends on those parameters. ~init~ only needs to be run once or when changing these parameters. That - implies that you need to re-index after changing these parameters. + implies that you need to re-index after changing these parameters. The + ~.noupdate~ files are ignored when indexing the first time after ~mu init~ (or + in general, when the database is empty). - There is another new subcommand ~mu info~ to get information about the mu database, the personal addresses etc. diff --git a/lib/mu-index.c b/lib/mu-index.c index 9e81a4b1..33aaffe3 100644 --- a/lib/mu-index.c +++ b/lib/mu-index.c @@ -60,12 +60,7 @@ mu_index_new (MuStore *store, GError **err) if (count == (unsigned)-1) return NULL; else if (count == 0) - index->_needs_reindex = FALSE; - - /* FIXME */ - /* else */ - /* index->_needs_reindex = */ - /* mu_store_database_needs_upgrade (xpath); */ + index->_needs_reindex = TRUE; return index; } @@ -341,10 +336,8 @@ mu_index_run (MuIndex *index, gboolean reindex, gboolean lazycheck, if (!check_path (path)) return MU_ERROR; - if (!reindex && index->_needs_reindex) { - g_warning ("database not up-to-date; needs full reindex"); - return MU_ERROR; - } + if (index->_needs_reindex) + reindex = TRUE; init_cb_data (&cb_data, index->_store, reindex, lazycheck, index->_max_filesize, stats,