X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fdatabase.cc;h=93cc7f57e9db979e276b6d56c67cd5f2c4372b10;hp=d09ad99f505c63b060c6d78ed81bdc79d0b470fb;hb=59823f964250be6d0ddbdfc45d4b07803bab267d;hpb=6452ae0fcb0a2ee45a47144da71a6de9d8dace2c diff --git a/lib/database.cc b/lib/database.cc index d09ad99f..93cc7f57 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -100,8 +100,8 @@ typedef struct { * In addition, terms from the content of the message are added with * "from", "to", "attachment", and "subject" prefixes for use by the * user in searching. Similarly, terms from the path of the mail - * message are added with a "folder" prefix. But the database doesn't - * really care itself about any of these. + * message are added with "folder" and "path" prefixes. But the + * database doesn't really care itself about any of these. * * The data portion of a mail document is empty. * @@ -208,7 +208,8 @@ static prefix_t BOOLEAN_PREFIX_EXTERNAL[] = { { "thread", "G" }, { "tag", "K" }, { "is", "K" }, - { "id", "Q" } + { "id", "Q" }, + { "path", "P" }, }; static prefix_t PROBABILISTIC_PREFIX[]= { @@ -942,19 +943,27 @@ notmuch_database_compact (const char *path, } if (rename (xapian_path, backup_path)) { - fprintf (stderr, "Error moving old database out of the way\n"); + fprintf (stderr, "Error moving %s to %s: %s\n", + xapian_path, backup_path, strerror (errno)); ret = NOTMUCH_STATUS_FILE_ERROR; goto DONE; } if (rename (compact_xapian_path, xapian_path)) { - fprintf (stderr, "Error moving compacted database\n"); + fprintf (stderr, "Error moving %s to %s: %s\n", + compact_xapian_path, xapian_path, strerror (errno)); ret = NOTMUCH_STATUS_FILE_ERROR; goto DONE; } - if (! keep_backup) - rmtree (backup_path); + if (! keep_backup) { + if (rmtree (backup_path)) { + fprintf (stderr, "Error removing old database %s: %s\n", + backup_path, strerror (errno)); + ret = NOTMUCH_STATUS_FILE_ERROR; + goto DONE; + } + } DONE: if (notmuch)