imap-2.1.16 and berkeley db 4.2.52?

Andreas andreas at conectiva.com.br
Mon Dec 15 08:31:00 EST 2003


On Mon, Dec 15, 2003 at 08:26:29AM -0500, Igor Brezac wrote:
> 
> On Mon, 15 Dec 2003, Andreas wrote:
> 
> > Has anybody tried to compile cyrus-imapd-2.1.16 with berkeley db 4.2.52?
> > Should it work?
> 
> It should work assuming configure script can locate berkeley db 4.2.52.  I
> have cyrus imapd 2.2 working with berkeley db 4.2.52.  I believe the
> berkeley code in both versions of cyrus imap is the same.  You also need
> to rebuild cyrus-sasl with the new berkeley db.

Correct. I just managed to do that (after changing configure and friends to
detect 4.2.x).

I had to change a few things in cyrusdb_db3.c, though, or else it wouldn't
compile. I'm still not sure if my environment is wrong or what. Some 
definitions seem to be gone in db 4.2's db.h. The patch I used is attached.

-------------- next part --------------
--- cyrus-imapd-2.1.16/cmulocal/berkdb.m4~	2003-10-08 17:35:24.000000000 -0300
+++ cyrus-imapd-2.1.16/cmulocal/berkdb.m4	2003-12-15 10:18:46.000000000 -0200
@@ -211,7 +211,7 @@
 	    BDB_LIBADD=""
 	fi
 
-        for dbname in db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 db
+        for dbname in db-4.2 db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 db
           do
             AC_CHECK_LIB($dbname, db_create, BDB_LIBADD="$BDB_LIBADD -l$dbname";
               dblib="berkeley"; break, dblib="no")
--- cyrus-imapd-2.1.16/lib/cyrusdb_db3.c.orig	2003-12-15 11:07:04.000000000 -0200
+++ cyrus-imapd-2.1.16/lib/cyrusdb_db3.c	2003-12-15 11:06:47.000000000 -0200
@@ -406,7 +406,7 @@
 		syslog(LOG_DEBUG, "%s: reusing txn %lu", where,
 		       (unsigned long) txn_id(*tid));
 	} else {
-	    r = txn_begin(dbenv, NULL, tid, 0);
+	    r = dbenv->txn_begin(dbenv, NULL, tid, 0);
 	    if (r != 0) {
 		syslog(LOG_ERR, "DBERROR: error beginning txn (%s): %s", where,
 		       db_strerror(r));
@@ -685,7 +685,7 @@
     if (!mytid) {
 	/* start a transaction for the write */
     restart:
-	r = txn_begin(dbenv, NULL, &tid, 0);
+	r = dbenv->txn_begin(dbenv, NULL, &tid, 0);
 	if (r != 0) {
 	    syslog(LOG_ERR, "DBERROR: mystore: error beginning txn: %s", 
 		   db_strerror(r));
@@ -704,7 +704,7 @@
 	    if (CONFIG_DB_VERBOSE)
 		syslog(LOG_DEBUG, "mystore: aborting txn %lu",
 		       (unsigned long) txn_id(tid));
-	    r2 = txn_abort(tid);
+	    r2 = tid->abort;
 	    if (r2) {
 		syslog(LOG_ERR, "DBERROR: mystore: error aborting txn: %s", 
 		       db_strerror(r));
@@ -718,7 +718,7 @@
 	    if (CONFIG_DB_VERBOSE)
 		syslog(LOG_DEBUG, "mystore: committing txn %lu",
 		       (unsigned long) txn_id(tid));
-	    r = txn_commit(tid, txnflags);
+	    r = tid->commit(tid, txnflags);
 	}
     }
 
@@ -795,7 +795,7 @@
     if (!mytid) {
     restart:
 	/* start txn for the write */
-	r = txn_begin(dbenv, NULL, &tid, 0);
+	r = dbenv->txn_begin(dbenv, NULL, &tid, 0);
 	if (r != 0) {
 	    syslog(LOG_ERR, "DBERROR: mydelete: error beginning txn: %s", 
 		   db_strerror(r));
@@ -813,7 +813,7 @@
 	    if (CONFIG_DB_VERBOSE)
 		syslog(LOG_DEBUG, "mydelete: aborting txn %lu",
 		       (unsigned long) txn_id(tid));
-	    r2 = txn_abort(tid);
+	    r2 = tid->abort;
 	    if (r2) {
 		syslog(LOG_ERR, "DBERROR: mydelete: error aborting txn: %s", 
 		       db_strerror(r));
@@ -827,7 +827,7 @@
 	    if (CONFIG_DB_VERBOSE)
 		syslog(LOG_DEBUG, "mydelete: committing txn %lu",
 		       (unsigned long) txn_id(tid));
-	    r = txn_commit(tid, txnflags);
+	    r = tid->commit(tid, txnflags);
 	}
     }
 
@@ -875,7 +875,7 @@
     if (CONFIG_DB_VERBOSE)
 	syslog(LOG_DEBUG, "mycommit: committing txn %lu",
 	       (unsigned long) txn_id(t));
-    r = txn_commit(t, txnflags);
+    r = t->commit(t, txnflags);
     switch (r) {
     case 0:
 	break;
@@ -914,7 +914,7 @@
     if (CONFIG_DB_VERBOSE)
 	syslog(LOG_DEBUG, "abort_txn: aborting txn %lu",
 	       (unsigned long) txn_id(t));
-    r = txn_abort(t);
+    r = t->abort;
     if (r != 0) {
 	syslog(LOG_ERR, "DBERROR: abort_txn: error aborting txn: %s",
 	       db_strerror(r));


More information about the Info-cyrus mailing list