]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Renamed "dbox" to "sdbox". Keep also dbox as an alias for it.
authorTimo Sirainen <tss@iki.fi>
Wed, 14 Jul 2010 16:10:30 +0000 (17:10 +0100)
committerTimo Sirainen <tss@iki.fi>
Wed, 14 Jul 2010 16:10:30 +0000 (17:10 +0100)
configure.in
src/lib-storage/index/dbox-single/sdbox-storage.c
src/lib-storage/index/dbox-single/sdbox-storage.h
src/lib-storage/index/dbox-single/sdbox-sync-rebuild.c
src/lib-storage/index/dbox-single/sdbox-sync.c

index e8df2cb8177140ee623278e4fb5aa5294cd64611..83935e390c04509ee56d60669050b4d0b9a00b61 100644 (file)
@@ -234,7 +234,7 @@ AC_ARG_WITH(storages,
                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 @@ dnl **
 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 @@ LINKED_STORAGE_LIBS=
 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 @@ done
 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 **
index b283004e69eebba94399b9b50c61823d59b3fc8a..08c73bde14ece6389fec311b541019244acb799a 100644 (file)
@@ -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 @@ static struct mail_storage *sdbox_storage_alloc(void)
        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 @@ sdbox_storage_create(struct mail_storage *storage ATTR_UNUSED,
 {
 #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 @@ sdbox_mailbox_alloc(struct mail_storage *storage, struct mailbox_list *list,
        /* 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 @@ int sdbox_read_header(struct sdbox_mailbox *mbox,
                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,7 +263,7 @@ dbox_mailbox_update(struct mailbox *box, const struct mailbox_update *update)
        return sdbox_write_index_header(box, update, NULL);
 }
 
-struct mail_storage dbox_storage = {
+struct mail_storage sdbox_storage = {
        .name = SDBOX_STORAGE_NAME,
        .class_flags = 0,
 
@@ -280,6 +280,23 @@ struct mail_storage dbox_storage = {
        }
 };
 
+struct mail_storage dbox_storage = {
+       .name = "dbox", /* alias */
+       .class_flags = 0,
+
+       .v = {
+                NULL,
+               sdbox_storage_alloc,
+               sdbox_storage_create,
+               NULL,
+               NULL,
+               dbox_storage_get_list_settings,
+               NULL,
+               sdbox_mailbox_alloc,
+               NULL
+       }
+};
+
 struct mailbox sdbox_mailbox = {
        .v = {
                index_storage_is_readonly,
index 02438c25dbf1ab52d0a9b5395ca9916664b2fd59..42fcbc282cd186ef802261c209d2da57d2ec3d26 100644 (file)
@@ -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"
 
index 34ca509f247dd8547e58f380cf8be92513da3d6f..ba94e812bb2db1c3aceb8b3ff419815dcf9a93a8 100644 (file)
@@ -45,7 +45,7 @@ static int sdbox_sync_add_file_index(struct dbox_sync_rebuild_context *ctx,
                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 @@ sdbox_sync_add_file(struct dbox_sync_rebuild_context *ctx,
        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;
        }
index f191d394cfd02e7980ef14fc3946d1d36679c800..7b9e3c67ad27e02636393109a419f1f73774400f 100644 (file)
@@ -194,12 +194,12 @@ int sdbox_sync_begin(struct sdbox_mailbox *mbox, enum sdbox_sync_flags flags,
                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,