diff --git a/db/dist/configure b/db/dist/configure index 2a9cad4cf..9a3670f70 100755 --- a/db/dist/configure +++ b/db/dist/configure @@ -2154,11 +2154,11 @@ fi # Uniquename excludes C++, Java, RPC. if test "$db_cv_uniquename" = "yes"; then - if test "$db_cv_rpc" = "yes"; then - { { echo "$as_me:$LINENO: error: --with-uniquename is not compatible with --enable-rpc" >&5 -echo "$as_me: error: --with-uniquename is not compatible with --enable-rpc" >&2;} - { (exit 1); exit 1; }; } - fi +# if test "$db_cv_rpc" = "yes"; then +# { { echo "$as_me:$LINENO: error: --with-uniquename is not compatible with --enable-rpc" >&5 +#echo "$as_me: error: --with-uniquename is not compatible with --enable-rpc" >&2;} +# { (exit 1); exit 1; }; } +# fi if test "$db_cv_cxx" = "yes"; then { { echo "$as_me:$LINENO: error: --with-uniquename is not compatible with --enable-cxx" >&5 echo "$as_me: error: --with-uniquename is not compatible with --enable-cxx" >&2;} diff --git a/python/_rpmdb.c b/python/_rpmdb.c index 959f398e1..48ccaba3e 100644 --- a/python/_rpmdb.c +++ b/python/_rpmdb.c @@ -102,7 +102,7 @@ #endif #define PY_BSDDB_VERSION "4.2.4" -static char *rcs_id = "$Id: _rpmdb.c,v 1.12 2004/01/01 16:34:10 jbj Exp $"; +static char *rcs_id = "$Id: _rpmdb.c,v 1.13 2004/10/16 12:50:52 jbj Exp $"; #ifdef WITH_THREAD @@ -436,10 +436,17 @@ static int add_partial_dbt(DBT* d, int dlen, int doff) { /* Callback used to save away more information about errors from the DB * library. */ static char _db_errmsg[1024]; +#if (DBVER >= 43) +static void _db_errorCallback(const DB_ENV *db_env, const char* prefix, char* msg) +{ + strcpy(_db_errmsg, msg); +} +#else static void _db_errorCallback(const char* prefix, char* msg) { strcpy(_db_errmsg, msg); } +#endif /* make a nice exception object to raise for errors. */ @@ -2011,7 +2018,11 @@ DB_stat(DBObject* self, PyObject* args) MYDB_BEGIN_ALLOW_THREADS; #if (DBVER >= 33) +#if (DBVER >= 43) + err = self->db->stat(self->db, NULL, &sp, flags); +#else err = self->db->stat(self->db, &sp, flags); +#endif #else err = self->db->stat(self->db, &sp, NULL, flags); #endif @@ -2273,7 +2284,11 @@ int DB_length(DBObject* self) MYDB_BEGIN_ALLOW_THREADS; #if (DBVER >= 33) +#if (DBVER >= 43) + err = self->db->stat(self->db, NULL, &sp, flags); +#else err = self->db->stat(self->db, &sp, flags); +#endif #else err = self->db->stat(self->db, &sp, NULL, flags); #endif @@ -4585,7 +4600,9 @@ DL_EXPORT(void) init_bsddb(void) #if (DBVER >= 33) ADD_INT(d, DB_LSTAT_ABORTED); +#if (DBVER < 43) ADD_INT(d, DB_LSTAT_ERR); +#endif ADD_INT(d, DB_LSTAT_FREE); ADD_INT(d, DB_LSTAT_HELD); #if (DBVER == 33) diff --git a/rpmdb/Makefile.am b/rpmdb/Makefile.am index 277031d64..c564bf1a2 100644 --- a/rpmdb/Makefile.am +++ b/rpmdb/Makefile.am @@ -82,7 +82,7 @@ db.h: # XXX grrr, force noinst libdb.la for db3. $(libdb_la): - sed -e"/^libdir=/s/^.*$$/libdir=''/" < $(top_builddir)/$(WITH_DB_SUBDIR)/libdb-4.2.la > $(libdb_la) + sed -e"/^libdir=/s/^.*$$/libdir=''/" < $(top_builddir)/$(WITH_DB_SUBDIR)/libdb-4.3.la > $(libdb_la) rpmdb_archive_SOURCES = rpmdb_archive_LDADD = \ @@ -121,6 +121,15 @@ rpmdb_load_LDADD = \ rpmdb_printlog_SOURCES = rpmdb_printlog_LDADD = \ $(top_builddir)/$(WITH_DB_SUBDIR)/db_printlog.o \ + $(top_builddir)/$(WITH_DB_SUBDIR)/btree_autop.o \ + $(top_builddir)/$(WITH_DB_SUBDIR)/crdel_autop.o \ + $(top_builddir)/$(WITH_DB_SUBDIR)/db_autop.o \ + $(top_builddir)/$(WITH_DB_SUBDIR)/dbreg_autop.o \ + $(top_builddir)/$(WITH_DB_SUBDIR)/fileops_autop.o \ + $(top_builddir)/$(WITH_DB_SUBDIR)/hash_autop.o \ + $(top_builddir)/$(WITH_DB_SUBDIR)/qam_autop.o \ + $(top_builddir)/$(WITH_DB_SUBDIR)/rep_autop.o \ + $(top_builddir)/$(WITH_DB_SUBDIR)/txn_autop.o \ $(top_builddir)/$(WITH_DB_SUBDIR)/util_sig.o \ librpmdb.la diff --git a/rpmdb/db3.c b/rpmdb/db3.c index 2fdfe2e4a..badb8d072 100644 --- a/rpmdb/db3.c +++ b/rpmdb/db3.c @@ -355,8 +355,10 @@ static int db_init(dbiIndex dbi, const char * dbhome, sleep(15); } } else { +#if !(DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3) xx = dbenv->set_verbose(dbenv, DB_VERB_CHKPOINT, (dbi->dbi_verbose & DB_VERB_CHKPOINT)); +#endif xx = dbenv->set_verbose(dbenv, DB_VERB_DEADLOCK, (dbi->dbi_verbose & DB_VERB_DEADLOCK)); xx = dbenv->set_verbose(dbenv, DB_VERB_RECOVERY, @@ -666,6 +668,9 @@ static int db3stat(dbiIndex dbi, unsigned int flags) /*@modifies dbi, fileSystem @*/ { DB * db = dbi->dbi_db; +#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3) + DB_TXN * txnid = NULL; +#endif int rc = 0; assert(db != NULL); @@ -678,7 +683,11 @@ static int db3stat(dbiIndex dbi, unsigned int flags) dbi->dbi_stats = _free(dbi->dbi_stats); /* XXX 3.3.4 change. */ #if (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR == 3) || (DB_VERSION_MAJOR == 4) +#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3) + rc = db->stat(db, txnid, &dbi->dbi_stats, flags); +#else rc = db->stat(db, &dbi->dbi_stats, flags); +#endif #else rc = db->stat(db, &dbi->dbi_stats, NULL, flags); #endif @@ -809,8 +818,10 @@ static int db3close(/*@only@*/ dbiIndex dbi, /*@unused@*/ unsigned int flags) dbenv->set_errpfx(dbenv, rpmdb->db_errpfx); /* dbenv->set_paniccall(???) */ /*@=noeffectuncon@*/ +#if !(DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3) xx = dbenv->set_verbose(dbenv, DB_VERB_CHKPOINT, (dbi->dbi_verbose & DB_VERB_CHKPOINT)); +#endif xx = dbenv->set_verbose(dbenv, DB_VERB_DEADLOCK, (dbi->dbi_verbose & DB_VERB_DEADLOCK)); xx = dbenv->set_verbose(dbenv, DB_VERB_RECOVERY, diff --git a/rpmdb/dbconfig.c b/rpmdb/dbconfig.c index 0a87cd99e..0f2229cc8 100644 --- a/rpmdb/dbconfig.c +++ b/rpmdb/dbconfig.c @@ -165,8 +165,10 @@ struct poptOption rdbOptions[] = { { "tas_spins", 0,POPT_ARG_INT, &db3dbi.dbi_tas_spins, 0, NULL, NULL }, +#if defined(DB_VERB_CHKPOINT) { "chkpoint", 0,POPT_BIT_SET, &db3dbi.dbi_verbose, DB_VERB_CHKPOINT, NULL, NULL }, +#endif { "deadlock", 0,POPT_BIT_SET, &db3dbi.dbi_verbose, DB_VERB_DEADLOCK, NULL, NULL }, { "recovery", 0,POPT_BIT_SET, &db3dbi.dbi_verbose, DB_VERB_RECOVERY, diff --git a/rpmdb/rpmdb.h b/rpmdb/rpmdb.h index d756b6d90..6407c27b8 100644 --- a/rpmdb/rpmdb.h +++ b/rpmdb/rpmdb.h @@ -312,7 +312,8 @@ struct _dbiIndex { /* dbenv parameters */ int dbi_lorder; /*@unused@*/ - void (*db_errcall) (const char *db_errpfx, char *buffer) + /* XXX db-4.3.14 adds dbenv as 1st arg. */ + void (*db_errcall) (void * dbenv, const char *db_errpfx, char *buffer) /*@globals fileSystem @*/ /*@modifies fileSystem @*/; /*@unused@*/ /*@shared@*/