dovecot-2.0: Renamed "dbox" to "sdbox". Keep also dbox as an ali...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Jul 14 19:11:02 EEST 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/76ee1fa16012
changeset: 11820:76ee1fa16012
user: Timo Sirainen <tss at iki.fi>
date: Wed Jul 14 17:10:30 2010 +0100
description:
Renamed "dbox" to "sdbox". Keep also dbox as an alias for it.
diffstat:
configure.in | 15 ++++++-
src/lib-storage/index/dbox-single/sdbox-storage.c | 29 +++++++++++---
src/lib-storage/index/dbox-single/sdbox-storage.h | 2 +-
src/lib-storage/index/dbox-single/sdbox-sync-rebuild.c | 4 +-
src/lib-storage/index/dbox-single/sdbox-sync.c | 4 +-
5 files changed, 40 insertions(+), 14 deletions(-)
diffs (174 lines):
diff -r 8fed05799c00 -r 76ee1fa16012 configure.in
--- a/configure.in Wed Jul 14 15:15:00 2010 +0100
+++ b/configure.in Wed Jul 14 17:10:30 2010 +0100
@@ -234,7 +234,7 @@
AC_MSG_ERROR([--with-storages needs storage list as parameter])
fi
mail_storages="shared `echo "$withval"|sed 's/,/ /g'`" ],
- mail_storages="shared maildir mbox dbox mdbox cydir")
+ mail_storages="shared maildir mbox sdbox mdbox cydir")
AC_SUBST(mail_storages)
AC_ARG_WITH(moduledir,
@@ -2409,7 +2409,7 @@
maildir_libs='$(top_builddir)/src/lib-storage/index/maildir/libstorage_maildir.la'
mbox_libs='$(top_builddir)/src/lib-storage/index/mbox/libstorage_mbox.la'
dbox_common_libs='$(top_builddir)/src/lib-storage/index/dbox-common/libstorage_dbox_common.la'
-dbox_libs='$(top_builddir)/src/lib-storage/index/dbox-single/libstorage_dbox_single.la'
+sdbox_libs='$(top_builddir)/src/lib-storage/index/dbox-single/libstorage_dbox_single.la'
mdbox_libs='$(top_builddir)/src/lib-storage/index/dbox-multi/libstorage_dbox_multi.la'
cydir_libs='$(top_builddir)/src/lib-storage/index/cydir/libstorage_cydir.la'
raw_libs='$(top_builddir)/src/lib-storage/index/raw/libstorage_raw.la'
@@ -2422,9 +2422,13 @@
mail_storages="$mail_storages raw"
# drop duplicates
mail_storages=`(for i in $mail_storages; do echo $i; done)|sort|uniq|xargs echo`
+have_sdbox=no
for storage in $mail_storages; do
LINKED_STORAGE_LIBS="$LINKED_STORAGE_LIBS `eval echo \\$${storage}_libs`"
- if test $storage = dbox || test $storage = mdbox; then
+ if test $storage = sdbox; then
+ have_sdbox=yes
+ fi
+ if test $storage = sdbox || test $storage = mdbox; then
LINKED_STORAGE_LIBS="$LINKED_STORAGE_LIBS $dbox_common_libs"
dbox_common_libs=""
fi
@@ -2432,6 +2436,11 @@
AC_SUBST(LINKED_STORAGE_LIBS)
AC_DEFINE_UNQUOTED(MAIL_STORAGES, "$mail_storages", List of compiled in mail storages)
+if test $have_sdbox = yes; then
+ # create alias for sdbox
+ mail_storages="$mail_storages dbox"
+fi
+
dnl **
dnl ** Shared libraries usage
dnl **
diff -r 8fed05799c00 -r 76ee1fa16012 src/lib-storage/index/dbox-single/sdbox-storage.c
--- a/src/lib-storage/index/dbox-single/sdbox-storage.c Wed Jul 14 15:15:00 2010 +0100
+++ b/src/lib-storage/index/dbox-single/sdbox-storage.c Wed Jul 14 17:10:30 2010 +0100
@@ -10,7 +10,7 @@
#include "sdbox-sync.h"
#include "sdbox-storage.h"
-extern struct mail_storage dbox_storage;
+extern struct mail_storage dbox_storage, sdbox_storage;
extern struct mailbox sdbox_mailbox;
extern struct dbox_storage_vfuncs sdbox_dbox_storage_vfuncs;
@@ -19,7 +19,7 @@
struct sdbox_storage *storage;
pool_t pool;
- pool = pool_alloconly_create("dbox storage", 512+256);
+ pool = pool_alloconly_create("sdbox storage", 512+256);
storage = p_new(pool, struct sdbox_storage, 1);
storage->storage.v = sdbox_dbox_storage_vfuncs;
storage->storage.storage = dbox_storage;
@@ -34,7 +34,7 @@
{
#ifndef HAVE_FLOCK
if (master_service_get_client_limit(master_service) > 1) {
- *error_r = "dbox requires client_limit=1 for service "
+ *error_r = "sdbox requires client_limit=1 for service "
"since your OS doesn't support flock()";
return -1;
}
@@ -53,7 +53,7 @@
/* dbox can't work without index files */
flags &= ~MAILBOX_FLAG_NO_INDEX_FILES;
- pool = pool_alloconly_create("dbox mailbox", 1024*3);
+ pool = pool_alloconly_create("sdbox mailbox", 1024*3);
mbox = p_new(pool, struct sdbox_mailbox, 1);
mbox->box = sdbox_mailbox;
mbox->box.pool = pool;
@@ -97,7 +97,7 @@
if (log_error) {
mail_storage_set_critical(
&mbox->storage->storage.storage,
- "dbox %s: Invalid dbox header size",
+ "sdbox %s: Invalid dbox header size",
mbox->box.path);
}
ret = -1;
@@ -263,8 +263,25 @@
return sdbox_write_index_header(box, update, NULL);
}
+struct mail_storage sdbox_storage = {
+ .name = SDBOX_STORAGE_NAME,
+ .class_flags = 0,
+
+ .v = {
+ NULL,
+ sdbox_storage_alloc,
+ sdbox_storage_create,
+ NULL,
+ NULL,
+ dbox_storage_get_list_settings,
+ NULL,
+ sdbox_mailbox_alloc,
+ NULL
+ }
+};
+
struct mail_storage dbox_storage = {
- .name = SDBOX_STORAGE_NAME,
+ .name = "dbox", /* alias */
.class_flags = 0,
.v = {
diff -r 8fed05799c00 -r 76ee1fa16012 src/lib-storage/index/dbox-single/sdbox-storage.h
--- a/src/lib-storage/index/dbox-single/sdbox-storage.h Wed Jul 14 15:15:00 2010 +0100
+++ b/src/lib-storage/index/dbox-single/sdbox-storage.h Wed Jul 14 17:10:30 2010 +0100
@@ -4,7 +4,7 @@
#include "index-storage.h"
#include "dbox-storage.h"
-#define SDBOX_STORAGE_NAME "dbox"
+#define SDBOX_STORAGE_NAME "sdbox"
#define SDBOX_MAIL_FILE_PREFIX "u."
#define SDBOX_MAIL_FILE_FORMAT SDBOX_MAIL_FILE_PREFIX"%u"
diff -r 8fed05799c00 -r 76ee1fa16012 src/lib-storage/index/dbox-single/sdbox-sync-rebuild.c
--- a/src/lib-storage/index/dbox-single/sdbox-sync-rebuild.c Wed Jul 14 15:15:00 2010 +0100
+++ b/src/lib-storage/index/dbox-single/sdbox-sync-rebuild.c Wed Jul 14 17:10:30 2010 +0100
@@ -45,7 +45,7 @@
if (ret < 0)
return -1;
- i_warning("dbox: Skipping unfixable file: %s", file->cur_path);
+ i_warning("sdbox: Skipping unfixable file: %s", file->cur_path);
return 0;
}
@@ -71,7 +71,7 @@
fname += strlen(SDBOX_MAIL_FILE_PREFIX);
if (str_to_uint32(fname, &uid) < 0 || uid == 0) {
- i_warning("dbox %s: Ignoring invalid filename %s",
+ i_warning("sdbox %s: Ignoring invalid filename %s",
ctx->box->path, fname);
return 0;
}
diff -r 8fed05799c00 -r 76ee1fa16012 src/lib-storage/index/dbox-single/sdbox-sync.c
--- a/src/lib-storage/index/dbox-single/sdbox-sync.c Wed Jul 14 15:15:00 2010 +0100
+++ b/src/lib-storage/index/dbox-single/sdbox-sync.c Wed Jul 14 17:10:30 2010 +0100
@@ -194,12 +194,12 @@
if (ret == 0) {
if (i >= SDBOX_REBUILD_COUNT) {
mail_storage_set_critical(storage,
- "dbox %s: Index keeps breaking",
+ "sdbox %s: Index keeps breaking",
ctx->mbox->box.path);
ret = -1;
} else {
/* do a full resync and try again. */
- i_warning("dbox %s: Rebuilding index",
+ i_warning("sdbox %s: Rebuilding index",
ctx->mbox->box.path);
rebuild = FALSE;
ret = sdbox_sync_index_rebuild(mbox,
More information about the dovecot-cvs
mailing list