Add --preferdb for now to permit testing db0/db1/db2.

CVS patchset: 3641
CVS date: 2000/03/26 22:45:02
This commit is contained in:
jbj 2000-03-26 22:45:02 +00:00
parent c47d8f3f63
commit 22a911a3b3
22 changed files with 3689 additions and 3709 deletions

View File

@ -29,42 +29,16 @@ librpm_la_SOURCES = \
librpm_la_LIBADD = $(subst .c,.lo,$(DBLIBOBJS))
#librpm_la_LIBADD = -lpopt
Xdb0.o: db0.c
@echo '$(COMPILE) -c $<'; \
$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-cp .deps/$(*F).pp .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm .deps/$(*F).pp
@__LD@ -r -o $@.o $@ -L/usr/lib -ldb1
@__OBJCOPY@ `\
@__NM@ -g --defined-only $@.o | \
sed -e '/ [TWD] /!d' -e 's/.* [TWD] /-L /' | \
grep -v '^-L $*'` $@.o $@
rm -f $@.o
db0.lo: db0.c
@echo '$(LTCOMPILE) -c $<'; \
$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
< .deps/$(*F).pp > .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm -f .deps/$(*F).pp
@__LD@ -r -o $*.o.o $*.o -L/usr/lib -ldb1
@__OBJCOPY@ `\
@__NM@ -g --defined-only $*.o.o | \
sed -e '/ [TWD] /!d' -e 's/.* [TWD] /-L /' | \
grep -v '^-L $*'` $*.o.o $*.o
rm -f $*.o.o
@__LD@ -r -o $@.o $@ -L/usr/lib -ldb1
@__OBJCOPY@ `\
@__NM@ -g --defined-only $@.o | \
sed -e '/ [TWD] /!d' -e 's/.* [TWD] /-L /' | \
grep -v '^-L $*'` $@.o $@
rm -f $@.o
db0.lo: db0.c $(top_srcdir)/system.h rpmlib.h dbindex.h db0.h
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
for F in $*.o $*.lo ; do \
@__LD@ -r -o $${F}.o $${F} -L/usr/lib -ldb1 ; \
@__OBJCOPY@ `\
@__NM@ -g --defined-only $${F}.o | \
sed -e '/ [TWD] /!d' -e 's/.* [TWD] /-L /' | \
grep -v '^-L $*'` $${F}.o $${F} ; \
rm -f $${F}.o ; \
done
tagtable.c: rpmlib.h
@echo '#include "system.h"' > tagtable.c

View File

@ -55,8 +55,8 @@ static void freeDBI( /*@only@*/ /*@null@*/ dbiIndex dbi) {
}
}
int prefer_dbi_major = 2; /* XXX shared with rebuilddb.c */
int use_dbi_major = -1;
int _preferDbiMajor = 0; /* XXX shared with rebuilddb.c */
int _useDbiMajor = -1;
typedef int (*_dbopen) (dbiIndex dbi);
@ -93,7 +93,7 @@ dbiIndex dbiOpenIndex(const char * urlfn, int flags, int perms, DBI_TYPE type) {
dbi->dbi_perms = perms;
dbi->dbi_type = type;
dbi->dbi_openinfo = NULL;
dbi->dbi_major = use_dbi_major;
dbi->dbi_major = _useDbiMajor;
switch (dbi->dbi_major) {
case 3:
@ -126,7 +126,7 @@ fprintf(stderr, "*** loop db%d rc %d errno %d %s\n", dbi->dbi_major, rc, errno,
dbi->dbi_major--; /* XXX don't bother with db_185 */
}
}
use_dbi_major = dbi->dbi_major;
_useDbiMajor = dbi->dbi_major;
break;
}

View File

@ -5,8 +5,8 @@
#include "rpmdb.h"
extern int prefer_dbi_major; /* XXX shared with rebuilddb.c */
extern int use_dbi_major;
extern int _preferDbiMajor; /* XXX shared with rebuilddb.c */
extern int _useDbiMajor;
/** */
int rpmdbRebuild(const char * rootdir)
@ -69,18 +69,18 @@ int rpmdbRebuild(const char * rootdir)
goto exit;
}
use_dbi_major = prefer_dbi_major;
_useDbiMajor = ((_preferDbiMajor >= 0) ? (_preferDbiMajor & 0x03) : -1);
rpmMessage(RPMMESS_DEBUG, _("opening old database with dbi_major %d\n"),
use_dbi_major);
_useDbiMajor);
if (openDatabase(rootdir, dbpath, &olddb, O_RDONLY, 0644,
RPMDB_FLAG_MINIMAL)) {
rc = 1;
goto exit;
}
use_dbi_major = prefer_dbi_major;
_useDbiMajor = ((_preferDbiMajor >= 0) ? (_preferDbiMajor & 0x03) : -1);
rpmMessage(RPMMESS_DEBUG, _("opening new database with dbi_major %d\n"),
use_dbi_major);
_useDbiMajor);
if (openDatabase(rootdir, newdbpath, &newdb, O_RDWR | O_CREAT, 0644, 0)) {
rc = 1;
goto exit;

View File

@ -26,6 +26,9 @@ extern "C" {
*/
void dbiFreeIndexSet(/*@only@*/ /*@null@*/ dbiIndexSet set);
/* XXX API compatibility */
#define dbiFreeIndexRecord(_a) dbiFreeIndexSet(_a)
/**
* Count items in index database set.
* @param set set of index database items

510
po/cs.po

File diff suppressed because it is too large Load Diff

510
po/de.po

File diff suppressed because it is too large Load Diff

510
po/fi.po

File diff suppressed because it is too large Load Diff

530
po/fr.po

File diff suppressed because it is too large Load Diff

550
po/ja.po

File diff suppressed because it is too large Load Diff

528
po/pl.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

528
po/ru.po

File diff suppressed because it is too large Load Diff

510
po/sk.po

File diff suppressed because it is too large Load Diff

512
po/sl.po

File diff suppressed because it is too large Load Diff

528
po/sr.po

File diff suppressed because it is too large Load Diff

512
po/sv.po

File diff suppressed because it is too large Load Diff

510
po/tr.po

File diff suppressed because it is too large Load Diff

View File

@ -814,10 +814,10 @@ static PyObject * handleDbResult(int rc, dbiIndexSet matches) {
list = PyList_New(0);
if (!rc) {
for (i = 0; i < matches.count; i++)
PyList_Append(list, PyInt_FromLong(matches.recs[i].recOffset));
for (i = 0; i < dbiIndexSetCount(matches); i++)
PyList_Append(list, PyInt_FromLong(dbiIndexRecordOffset(matches, i)));
dbiFreeIndexRecord(matches);
dbiFreeIndexSet(matches);
}
return list;

View File

@ -164,13 +164,13 @@ static int findPackagesWithObsoletes(rpmdb db, struct pkgSet *psp)
while (obsoletesCount--) {
rc = rpmdbFindPackage(db, obsoletes[obsoletesCount], &matches);
if (!rc) {
if (matches.count) {
if (dbiIndexSetCount(matches)) {
(*pip)->selected = 1;
dbiFreeIndexRecord(matches);
dbiFreeIndexSet(matches);
break;
}
dbiFreeIndexRecord(matches);
dbiFreeIndexSet(matches);
}
}
@ -219,9 +219,9 @@ static int findUpgradePackages(rpmdb db, struct pkgSet *psp,
if (rc == 0) {
skipThis = 0;
rpmErrorSetCallback(errorFunction);
for (i = 0; i < matches.count; i++) {
for (i = 0; i < dbiIndexSetCount(matches); i++) {
installedHeader =
rpmdbGetRecord(db, matches.recs[i].recOffset);
rpmdbGetRecord(db, dbiIndexRecordOffset(matches, i));
if (rpmVersionCompare(installedHeader, h) >= 0) {
/* already have a newer version installed */
DEBUG (("Already have newer version\n"))
@ -257,10 +257,10 @@ static int findUpgradePackages(rpmdb db, struct pkgSet *psp,
(void **) &availDirIndexes, NULL);
}
for (i = 0; i < matches.count; i++) {
for (i = 0; i < dbiIndexSetCount(matches); i++) {
/* Compare the file lists */
installedHeader =
rpmdbGetRecord(db, matches.recs[i].recOffset);
rpmdbGetRecord(db, dbiIndexRecordOffset(matches, i));
if (headerGetEntryMinMemory(installedHeader, RPMTAG_BASENAMES,
NULL, (void **) &installedFiles,
&installedFileCount)) {
@ -288,7 +288,7 @@ static int findUpgradePackages(rpmdb db, struct pkgSet *psp,
}
if (rc == 0) {
dbiFreeIndexRecord(matches);
dbiFreeIndexSet(matches);
}
DEBUG (("\n\n"))
@ -439,9 +439,9 @@ static int unmarkPackagesAlreadyInstalled(rpmdb db, struct pkgSet *psp)
rc = rpmdbFindPackage(db, name, &matches);
if (rc == 0) {
rpmErrorSetCallback(errorFunction);
for (i = 0; i < matches.count; i++) {
for (i = 0; i < dbiIndexSetCount(matches); i++) {
installedHeader =
rpmdbGetRecord(db, matches.recs[i].recOffset);
rpmdbGetRecord(db, dbiIndexRecordOffset(matches, i));
if (rpmVersionCompare(installedHeader, h) >= 0) {
/* already have a newer version installed */
DEBUG (("Already have newer version\n"))
@ -452,7 +452,7 @@ static int unmarkPackagesAlreadyInstalled(rpmdb db, struct pkgSet *psp)
headerFree(installedHeader);
}
rpmErrorSetCallback(NULL);
dbiFreeIndexRecord(matches);
dbiFreeIndexSet(matches);
}
}

3
rpm.c
View File

@ -94,6 +94,8 @@ static int signIt;
static int test;
extern int _url_debug;
extern int _noDirTokens;
extern int _preferDbiMajor;
extern int _useDbiMajor;
static int showVersion;
extern const char * rpmNAME;
@ -153,6 +155,7 @@ static struct poptOption optionsTable[] = {
{ "oldpackage", '\0', 0, &oldPackage, 0, NULL, NULL},
{ "percent", '\0', 0, &showPercents, 0, NULL, NULL},
{ "pipe", '\0', POPT_ARG_STRING, &pipeOutput, 0, NULL, NULL},
{ "preferdb", '\0', POPT_ARG_INT, &_preferDbiMajor, 0, NULL, NULL},
{ "prefix", '\0', POPT_ARG_STRING, &prefix, 0, NULL, NULL},
{ "query", 'q', 0, NULL, 'q', NULL, NULL},
{ "querytags", '\0', 0, &queryTags, 0, NULL, NULL},

View File

@ -13,7 +13,7 @@ BuildRequires: bzip2 >= 0.9.0c-2
Requires: popt, bzip2 >= 0.9.0c-2
BuildRequires: python-devel >= 1.5.2
%endif
BuildRoot: /var/tmp/%{name}-root
BuildRoot: %{_tmppath}/%{name}-root
%description
The RPM Package Manager (RPM) is a powerful command line driven