doveadm-dump-index.c (dovecot-2.3.16) | : | doveadm-dump-index.c (dovecot-2.3.17) | ||
---|---|---|---|---|
skipping to change at line 767 | skipping to change at line 767 | |||
else if (dir_has_index(path, "dovecot.map.index")) | else if (dir_has_index(path, "dovecot.map.index")) | |||
return mail_index_alloc(NULL, path, "dovecot.map.index"); | return mail_index_alloc(NULL, path, "dovecot.map.index"); | |||
else | else | |||
return NULL; | return NULL; | |||
} else if ((p = strrchr(path, '/')) != NULL) | } else if ((p = strrchr(path, '/')) != NULL) | |||
return mail_index_alloc(NULL, t_strdup_until(path, p), p + 1); | return mail_index_alloc(NULL, t_strdup_until(path, p), p + 1); | |||
else | else | |||
return mail_index_alloc(NULL, ".", path); | return mail_index_alloc(NULL, ".", path); | |||
} | } | |||
static void cmd_dump_index(int argc ATTR_UNUSED, char *argv[]) | static void | |||
cmd_dump_index(const char *path, const char *const *args) | ||||
{ | { | |||
struct mail_index *index; | struct mail_index *index; | |||
struct mail_index_view *view; | struct mail_index_view *view; | |||
struct mail_cache_view *cache_view; | struct mail_cache_view *cache_view; | |||
unsigned int seq, uid = 0; | unsigned int seq, uid = 0; | |||
index = path_open_index(argv[1]); | index = path_open_index(path); | |||
if (index == NULL || | if (index == NULL || | |||
mail_index_open(index, MAIL_INDEX_OPEN_FLAG_READONLY) <= 0) | mail_index_open(index, MAIL_INDEX_OPEN_FLAG_READONLY) <= 0) | |||
i_fatal("Couldn't open index %s", argv[1]); | i_fatal("Couldn't open index %s", path); | |||
if (argv[2] != NULL) { | if (args[0] != NULL) { | |||
if (str_to_uint(argv[2], &uid) < 0) | if (str_to_uint(args[0], &uid) < 0) | |||
i_fatal("Invalid uid number %s", argv[2]); | i_fatal("Invalid uid number %s", args[0]); | |||
} | } | |||
view = mail_index_view_open(index); | view = mail_index_view_open(index); | |||
cache_view = mail_cache_view_open(index->cache, view); | cache_view = mail_cache_view_open(index->cache, view); | |||
if (uid == 0) { | if (uid == 0) { | |||
printf("-- INDEX: %s\n", index->filepath); | printf("-- INDEX: %s\n", index->filepath); | |||
dump_hdr(index); | dump_hdr(index); | |||
dump_extensions(index); | dump_extensions(index); | |||
dump_keywords(index); | dump_keywords(index); | |||
End of changes. 3 change blocks. | ||||
6 lines changed or deleted | 7 lines changed or added |