fix: dbiCloseIndex not called (typo).

dump db1 and db2 for now.

CVS patchset: 3665
CVS date: 2000/04/08 21:36:02
This commit is contained in:
jbj 2000-04-08 21:36:02 +00:00
parent df023d73e8
commit d91a22b165
6 changed files with 65 additions and 48 deletions

View File

@ -141,6 +141,18 @@
/* Use the included glob.c? */
#undef USE_GNU_GLOB
/* Use the Berkeley db3 API? */
#undef USE_DB3
/* Use the Berkeley db2 API? */
#undef USE_DB2
/* Use the Berkeley db1 retrofit to db2/db3 API? */
#undef USE_DB1
/* Use the Berkeley db1 API from glibc? */
#undef USE_DB0
^L
/* Leave that blank line there!! Autoheader needs it.
If you're adding to this file, keep in mind:

View File

@ -315,13 +315,13 @@ AC_CHECK_FUNC(db_create, [DBLIBOBJS="$DBLIBOBJS db3.c"],
AC_CHECK_LIB(db-3.0, db_create, [DBLIBOBJS="$DBLIBOBJS db3.c"]))
)
dnl Check for Berkeley db2 API.
AC_CHECK_FUNC(db_open, [DBLIBOBJS="$DBLIBOBJS db2.c"],
AC_CHECK_LIB(db, db_open, [LIBS="$LIBS -ldb"; DBLIBOBJS="$DBLIBOBJS db2.c"])
)
dnl Check for Berkeley db1 API retrofit to db2 database.
AC_CHECK_FUNC(dbopen, [DBLIBOBJS="$DBLIBOBJS db1.c"],
AC_CHECK_LIB(db, dbopen, [DBLIBOBJS="$DBLIBOBJS db1.c"])
)
dnl AC_CHECK_FUNC(db_open, [DBLIBOBJS="$DBLIBOBJS db2.c"],
dnl AC_CHECK_LIB(db, db_open, [LIBS="$LIBS -ldb"; DBLIBOBJS="$DBLIBOBJS db2.c"])
dnl )
dnl Check for Berkeley db1 API retrofit to db2/db3 database.
dnl AC_CHECK_FUNC(dbopen, [DBLIBOBJS="$DBLIBOBJS db1.c"],
dnl AC_CHECK_LIB(db, dbopen, [DBLIBOBJS="$DBLIBOBJS db1.c"])
dnl )
dnl Check for Berkeley db1 API in glibc.
AC_CHECK_LIB(db1, dbopen, [DBLIBOBJS="$DBLIBOBJS db0.c"])
@ -331,6 +331,15 @@ fi
dnl AC_DEFINE_UNQUOTED(DBLIBOBJS, "$DBLIBOBJS")
AC_SUBST(DBLIBOBJS)
for dbi in $DBLIBOBJS; do
case $dbi in
db3.c) AC_DEFINE(USE_DB3) ;;
db2.c) AC_DEFINE(USE_DB2) ;;
db1.c) AC_DEFINE(USE_DB1) ;;
db0.c) AC_DEFINE(USE_DB0) ;;
esac
done
AC_CHECK_FUNC(fork, [], [echo "using vfork() instead of fork()";
LIBOBJS=fakefork.o])

View File

@ -10,24 +10,28 @@ static int _debug = 0;
/*@access dbiIndexSet@*/
/*@access dbiIndexRecord@*/
#if HAVE_DB1_DB_H
#if USE_DB0
extern struct _dbiVec db0vec;
#define DB0vec &db0vec
#else
#define DB0vec NULL
#endif
#if HAVE_DB_185_H
#if USE_DB1
extern struct _dbiVec db1vec;
#define DB1vec &db1vec
#else
#define DB1vec NULL
#endif
#if USE_DB2
extern struct _dbiVec db2vec;
#define DB2vec &db2vec
#else
#define DB2vec NULL
#endif
#if HAVE_DB3_DB_H
#if USE_DB3
extern struct _dbiVec db3vec;
#define DB3vec &db3vec
#else

View File

@ -244,19 +244,14 @@ int openDatabase(const char * prefix, const char * dbpath, rpmdb *dbp,
rc = openDbFile(prefix, dbpath, dbiTemplate, justcheck, mode,
&db->_dbi[dbix]);
if (dbix == 0) rc = 0; /* XXX HACK */
if (dbix == 0) rc = 0; /* XXX HACK for non-db3 */
if (rc)
continue;
switch (dbix) {
case 1:
if (minimal) {
if (dbp)
*dbp = db;
else
rpmdbClose(db);
return 0;
}
if (minimal)
goto exit;
break;
case 2:
@ -280,6 +275,7 @@ int openDatabase(const char * prefix, const char * dbpath, rpmdb *dbp,
}
}
exit:
if (!(rc || justcheck || dbp == NULL))
*dbp = db;
else
@ -325,13 +321,13 @@ void rpmdbClose (rpmdb db)
{
int dbix;
if (db->pkgs != NULL) Fclose(db->pkgs);
for (dbix = RPMDBI_MAX; --dbix >= RPMDBI_MAX; ) {
for (dbix = RPMDBI_MAX; --dbix >= RPMDBI_MIN; ) {
if (db->_dbi[dbix] == NULL)
continue;
dbiCloseIndex(db->_dbi[dbix]);
db->_dbi[dbix] = NULL;
}
if (db->pkgs != NULL) Fclose(db->pkgs);
free(db);
}
@ -658,8 +654,6 @@ int rpmdbRemove(rpmdb db, unsigned int offset, int tolerant)
dbi = db->_dbi[dbix];
if (_debug)
fprintf(stderr, "*** removing dbix %d tag %d offset 0x%x\n", dbix, dbi->dbi_rpmtag, offset);
if (dbi->dbi_rpmtag == 0) {
/* XXX TODO: remove h to packages.rpm */
(void) (*dbi->dbi_vec->del) (dbi, &offset, sizeof(offset), 0);
@ -846,8 +840,6 @@ int rpmdbAdd(rpmdb db, Header h)
dbi = db->_dbi[dbix];
if (_debug)
fprintf(stderr, "*** adding dbix %d tag %d offset 0x%x\n", dbix, dbi->dbi_rpmtag, offset);
if (dbi->dbi_rpmtag == 0) {
size_t uhlen = headerSizeof(h, HEADER_MAGIC_NO);
void * uh = headerUnload(h);

View File

@ -8,7 +8,7 @@ WriteMakefile(
'OBJECT' => 'rpm.o constant.o',
'VERSION_FROM' => 'rpm.pm', # finds $VERSION
'MAKEFILE'=> 'PMakefile',
'LIBS' => [' -L/usr/local/lib -ldb -lz -lbz2'], # e.g., '-lm'
'LIBS' => [' -L/usr/local/lib -lz -lbz2'], # e.g., '-lm'
'CCFLAGS' => '-g -O2 -D_GNU_SOURCE -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts',
'OPTIMIZE'=> '-g',
'DEFINE' => '-Dbool=char -DHAS_BOOL',

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2000-04-08 15:20-0400\n"
"POT-Creation-Date: 2000-04-08 17:30-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -1986,12 +1986,12 @@ msgstr ""
msgid " failed - "
msgstr ""
#: lib/dbindex.c:99
#: lib/dbindex.c:103
#, c-format
msgid "bad db file %s"
msgstr ""
#: lib/dbindex.c:139
#: lib/dbindex.c:143
msgid ""
"\n"
"--> Please run \"rpm --rebuilddb\" as root to convert your database from\n"
@ -1999,22 +1999,22 @@ msgid ""
"\n"
msgstr ""
#: lib/dbindex.c:152
#: lib/dbindex.c:156
#, c-format
msgid "cannot open file %s: %s"
msgstr ""
#: lib/dbindex.c:192
#: lib/dbindex.c:196
#, c-format
msgid "error getting record %s from %s"
msgstr ""
#: lib/dbindex.c:206
#: lib/dbindex.c:210
#, c-format
msgid "error storing record %s into %s"
msgstr ""
#: lib/dbindex.c:211
#: lib/dbindex.c:215
#, c-format
msgid "error removing record %s into %s"
msgstr ""
@ -2713,7 +2713,7 @@ msgstr ""
msgid "display a verbose file listing"
msgstr ""
#: lib/rebuilddb.c:34 lib/rpmdb.c:298
#: lib/rebuilddb.c:34 lib/rpmdb.c:294
msgid "no dbpath has been set"
msgstr ""
@ -2891,78 +2891,78 @@ msgstr ""
msgid "shared"
msgstr ""
#: lib/rpmdb.c:271
#: lib/rpmdb.c:266
msgid ""
"old format database is present; use --rebuilddb to generate a new format "
"database"
msgstr ""
#. error
#: lib/rpmdb.c:587
#: lib/rpmdb.c:583
#, c-format
msgid "cannot retrieve package \"%s\" from db"
msgstr ""
#: lib/rpmdb.c:616
#: lib/rpmdb.c:612
#, c-format
msgid "package not found with key \"%s\" in %s"
msgstr ""
#: lib/rpmdb.c:625
#: lib/rpmdb.c:621
#, c-format
msgid "key \"%s\" not found in %s"
msgstr ""
#: lib/rpmdb.c:643
#: lib/rpmdb.c:639
#, c-format
msgid "rpmdbRemove: cannot read header at 0x%x"
msgstr ""
#: lib/rpmdb.c:671
#: lib/rpmdb.c:665
#, c-format
msgid "removing 0 %s entries.\n"
msgstr ""
#: lib/rpmdb.c:677
#: lib/rpmdb.c:671
#, c-format
msgid "removing \"%s\" from %s index.\n"
msgstr ""
#: lib/rpmdb.c:685
#: lib/rpmdb.c:679
#, c-format
msgid "removing %d entries in %s index:\n"
msgstr ""
#: lib/rpmdb.c:689 lib/rpmdb.c:898
#: lib/rpmdb.c:683 lib/rpmdb.c:890
#, c-format
msgid "\t%6d %s\n"
msgstr ""
#: lib/rpmdb.c:832
#: lib/rpmdb.c:826
msgid "cannot allocate space for database"
msgstr ""
#: lib/rpmdb.c:875
#: lib/rpmdb.c:867
#, c-format
msgid "adding 0 %s entries.\n"
msgstr ""
#: lib/rpmdb.c:887
#: lib/rpmdb.c:879
#, c-format
msgid "adding \"%s\" to %s index.\n"
msgstr ""
#: lib/rpmdb.c:894
#: lib/rpmdb.c:886
#, c-format
msgid "adding %d entries to %s index:\n"
msgstr ""
#: lib/rpmdb.c:952
#: lib/rpmdb.c:944
#, c-format
msgid "cannot read header at %d for update"
msgstr ""
#: lib/rpmdb.c:965
#: lib/rpmdb.c:957
msgid "header changed size!"
msgstr ""