# HG changeset patch # User Timo Sirainen # Date 1195237180 -7200 # Node ID f814eecd75cd841d329a4d0c22911e4a6db60a44 # Parent eebfe0cd2add8d7d31d435167ddb25c9e9419223 When reading an index file created by v1.0, make sure we update the header version and write the main index. diff -r eebfe0cd2add -r f814eecd75cd src/lib-index/mail-index-map.c --- a/src/lib-index/mail-index-map.c Fri Nov 16 20:11:05 2007 +0200 +++ b/src/lib-index/mail-index-map.c Fri Nov 16 20:19:40 2007 +0200 @@ -441,9 +441,13 @@ if (hdr->seen_messages_count > hdr->messages_count || hdr->deleted_messages_count > hdr->messages_count) return 0; - if (hdr->first_recent_uid == 0 && hdr->minor_version == 0) { + if (hdr->minor_version == 0) { /* upgrade silently from v1.0 */ - map->hdr.first_recent_uid = 1; + map->hdr.minor_version = MAIL_INDEX_MINOR_VERSION; + map->hdr.unused_old_recent_messages_count = 0; + if (hdr->first_recent_uid == 0) + map->hdr.first_recent_uid = 1; + index->need_recreate = TRUE; } if (hdr->first_recent_uid == 0 || hdr->first_recent_uid > hdr->next_uid || diff -r eebfe0cd2add -r f814eecd75cd src/lib-index/mail-index-sync.c --- a/src/lib-index/mail-index-sync.c Fri Nov 16 20:11:05 2007 +0200 +++ b/src/lib-index/mail-index-sync.c Fri Nov 16 20:19:40 2007 +0200 @@ -278,6 +278,9 @@ hdr->log_file_seq < log_file_seq) return TRUE; + if (index->need_recreate) + return TRUE; + /* already synced */ return mail_cache_need_compress(index->cache); }