1998-07-26 05:00:26 +08:00
|
|
|
#include "system.h"
|
1996-02-20 12:31:08 +08:00
|
|
|
|
1998-07-31 06:09:42 +08:00
|
|
|
#include "build/rpmbuild.h"
|
|
|
|
|
1996-07-21 07:21:18 +08:00
|
|
|
#include "install.h"
|
1997-02-12 12:48:51 +08:00
|
|
|
#include "url.h"
|
1999-05-11 07:41:04 +08:00
|
|
|
|
|
|
|
#if DEAD
|
|
|
|
typedef int (*QVF_t) (QVA_t *qva, rpmdb db, Header h);
|
|
|
|
#endif
|
1996-02-20 12:31:08 +08:00
|
|
|
|
1999-05-08 02:33:35 +08:00
|
|
|
#define POPT_NOFILES 1000
|
|
|
|
|
|
|
|
/* ========== Verify specific popt args */
|
|
|
|
static void verifyArgCallback(poptContext con, enum poptCallbackReason reason,
|
|
|
|
const struct poptOption * opt, const char * arg,
|
1999-05-11 07:41:04 +08:00
|
|
|
QVA_t *qva)
|
1999-05-08 02:33:35 +08:00
|
|
|
{
|
|
|
|
switch (opt->val) {
|
1999-05-11 07:41:04 +08:00
|
|
|
case POPT_NOFILES: qva->qva_flags |= VERIFY_FILES; break;
|
1999-05-08 02:33:35 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int noFiles = 0;
|
|
|
|
struct poptOption rpmVerifyPoptTable[] = {
|
|
|
|
{ NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA,
|
|
|
|
verifyArgCallback, 0, NULL, NULL },
|
|
|
|
{ "nofiles", '\0', 0, &noFiles, POPT_NOFILES,
|
|
|
|
N_("don't verify files in package"), NULL},
|
|
|
|
{ 0, 0, 0, 0, 0, NULL, NULL }
|
|
|
|
};
|
1996-02-20 12:31:08 +08:00
|
|
|
|
1999-05-08 02:33:35 +08:00
|
|
|
/* ======================================================================== */
|
1999-05-11 07:41:04 +08:00
|
|
|
static int verifyHeader(QVA_t *qva, Header h) {
|
1999-01-14 02:30:31 +08:00
|
|
|
const char ** fileList;
|
1996-02-20 12:31:08 +08:00
|
|
|
int count, type;
|
1996-02-21 03:42:47 +08:00
|
|
|
int verifyResult;
|
1998-09-25 01:47:41 +08:00
|
|
|
int i, ec, rc;
|
1996-03-05 06:52:34 +08:00
|
|
|
int_32 * fileFlagsList;
|
1997-01-24 04:56:45 +08:00
|
|
|
int omitMask = 0;
|
1996-03-05 06:52:34 +08:00
|
|
|
|
1998-09-25 01:47:41 +08:00
|
|
|
ec = 0;
|
1999-05-11 07:41:04 +08:00
|
|
|
if (!(qva->qva_flags & VERIFY_MD5)) omitMask = RPMVERIFY_MD5;
|
1996-02-20 12:31:08 +08:00
|
|
|
|
1998-11-21 04:18:22 +08:00
|
|
|
if (headerGetEntry(h, RPMTAG_FILEFLAGS, NULL, (void **) &fileFlagsList, NULL) &&
|
|
|
|
headerGetEntry(h, RPMTAG_FILENAMES, &type, (void **) &fileList, &count)) {
|
1996-02-20 12:31:08 +08:00
|
|
|
for (i = 0; i < count; i++) {
|
1999-05-11 07:41:04 +08:00
|
|
|
if ((rc = rpmVerifyFile(qva->qva_prefix, h, i, &verifyResult, omitMask)) != 0) {
|
1998-09-28 06:03:52 +08:00
|
|
|
fprintf(stdout, _("missing %s\n"), fileList[i]);
|
1998-09-25 01:47:41 +08:00
|
|
|
} else {
|
1998-12-06 03:38:29 +08:00
|
|
|
const char * size, * md5, * link, * mtime, * mode;
|
|
|
|
const char * group, * user, * rdev;
|
|
|
|
static const char * aok = ".";
|
|
|
|
static const char * unknown = "?";
|
1996-02-20 12:31:08 +08:00
|
|
|
|
1996-02-21 06:18:36 +08:00
|
|
|
if (!verifyResult) continue;
|
|
|
|
|
1998-09-25 01:47:41 +08:00
|
|
|
rc = 1;
|
1998-12-06 03:38:29 +08:00
|
|
|
|
|
|
|
#define _verify(_RPMVERIFY_F, _C) \
|
|
|
|
((verifyResult & _RPMVERIFY_F) ? _C : aok)
|
|
|
|
#define _verifylink(_RPMVERIFY_F, _C) \
|
|
|
|
((verifyResult & RPMVERIFY_READLINKFAIL) ? unknown : \
|
|
|
|
(verifyResult & _RPMVERIFY_F) ? _C : aok)
|
|
|
|
#define _verifyfile(_RPMVERIFY_F, _C) \
|
|
|
|
((verifyResult & RPMVERIFY_READFAIL) ? unknown : \
|
|
|
|
(verifyResult & _RPMVERIFY_F) ? _C : aok)
|
|
|
|
|
|
|
|
md5 = _verifyfile(RPMVERIFY_MD5, "5");
|
|
|
|
size = _verify(RPMVERIFY_FILESIZE, "S");
|
|
|
|
link = _verifylink(RPMVERIFY_LINKTO, "L");
|
|
|
|
mtime = _verify(RPMVERIFY_MTIME, "T");
|
|
|
|
rdev = _verify(RPMVERIFY_RDEV, "D");
|
|
|
|
user = _verify(RPMVERIFY_USER, "U");
|
|
|
|
group = _verify(RPMVERIFY_GROUP, "G");
|
|
|
|
mode = _verify(RPMVERIFY_MODE, "M");
|
|
|
|
|
|
|
|
#undef _verify
|
|
|
|
#undef _verifylink
|
|
|
|
#undef _verifyfile
|
1996-02-20 12:31:08 +08:00
|
|
|
|
1998-09-28 06:03:52 +08:00
|
|
|
fprintf(stdout, "%s%s%s%s%s%s%s%s %c %s\n",
|
1996-02-21 06:18:36 +08:00
|
|
|
size, mode, md5, rdev, link, user, group, mtime,
|
1996-03-05 06:52:34 +08:00
|
|
|
fileFlagsList[i] & RPMFILE_CONFIG ? 'c' : ' ',
|
1996-02-21 06:18:36 +08:00
|
|
|
fileList[i]);
|
|
|
|
}
|
1998-09-25 01:47:41 +08:00
|
|
|
if (rc)
|
|
|
|
ec = rc;
|
1996-02-20 12:31:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
free(fileList);
|
|
|
|
}
|
1998-09-25 01:47:41 +08:00
|
|
|
return ec;
|
1996-02-20 12:31:08 +08:00
|
|
|
}
|
|
|
|
|
1998-09-25 01:47:41 +08:00
|
|
|
static int verifyDependencies(rpmdb db, Header h) {
|
1998-12-17 05:58:53 +08:00
|
|
|
rpmTransactionSet rpmdep;
|
1996-07-21 07:21:18 +08:00
|
|
|
struct rpmDependencyConflict * conflicts;
|
|
|
|
int numConflicts;
|
1999-01-14 02:30:31 +08:00
|
|
|
const char * name, * version, * release;
|
1996-07-21 07:21:18 +08:00
|
|
|
int type, count, i;
|
|
|
|
|
1998-12-17 05:58:53 +08:00
|
|
|
rpmdep = rpmtransCreateSet(db, NULL);
|
|
|
|
rpmtransAddPackage(rpmdep, h, NULL, NULL, 0, NULL);
|
1996-07-21 07:21:18 +08:00
|
|
|
|
|
|
|
rpmdepCheck(rpmdep, &conflicts, &numConflicts);
|
1998-12-17 05:58:53 +08:00
|
|
|
rpmtransFree(rpmdep);
|
1996-07-21 07:21:18 +08:00
|
|
|
|
|
|
|
if (numConflicts) {
|
1996-11-19 02:02:36 +08:00
|
|
|
headerGetEntry(h, RPMTAG_NAME, &type, (void **) &name, &count);
|
|
|
|
headerGetEntry(h, RPMTAG_VERSION, &type, (void **) &version, &count);
|
|
|
|
headerGetEntry(h, RPMTAG_RELEASE, &type, (void **) &release, &count);
|
1998-09-28 06:03:52 +08:00
|
|
|
fprintf(stdout, _("Unsatisfied dependencies for %s-%s-%s: "),
|
|
|
|
name, version, release);
|
1996-07-21 07:21:18 +08:00
|
|
|
for (i = 0; i < numConflicts; i++) {
|
1998-09-28 06:03:52 +08:00
|
|
|
if (i) fprintf(stdout, ", ");
|
|
|
|
fprintf(stdout, "%s", conflicts[i].needsName);
|
1996-07-21 07:21:18 +08:00
|
|
|
if (conflicts[i].needsFlags) {
|
|
|
|
printDepFlags(stdout, conflicts[i].needsVersion,
|
|
|
|
conflicts[i].needsFlags);
|
|
|
|
}
|
|
|
|
}
|
1998-09-28 06:03:52 +08:00
|
|
|
fprintf(stdout, "\n");
|
1996-10-21 09:21:48 +08:00
|
|
|
rpmdepFreeConflicts(conflicts, numConflicts);
|
1998-09-25 01:47:41 +08:00
|
|
|
return 1;
|
1996-07-21 07:21:18 +08:00
|
|
|
}
|
1998-09-25 01:47:41 +08:00
|
|
|
return 0;
|
1996-07-21 07:21:18 +08:00
|
|
|
}
|
|
|
|
|
1999-05-11 07:41:04 +08:00
|
|
|
static int showVerifyPackage(QVA_t *qva, rpmdb db, Header h) {
|
1998-09-25 01:47:41 +08:00
|
|
|
int ec, rc;
|
1998-11-19 05:41:05 +08:00
|
|
|
FD_t fdo;
|
1998-09-25 01:47:41 +08:00
|
|
|
ec = 0;
|
1999-05-11 07:41:04 +08:00
|
|
|
if ((qva->qva_flags & VERIFY_DEPS) &&
|
1998-09-25 01:47:41 +08:00
|
|
|
(rc = verifyDependencies(db, h)) != 0)
|
|
|
|
ec = rc;
|
1999-05-11 07:41:04 +08:00
|
|
|
if ((qva->qva_flags & VERIFY_FILES) &&
|
|
|
|
(rc = verifyHeader(qva, h)) != 0)
|
1998-09-25 01:47:41 +08:00
|
|
|
ec = rc;;
|
1998-11-20 02:10:28 +08:00
|
|
|
fdo = fdDup(STDOUT_FILENO);
|
1999-05-11 07:41:04 +08:00
|
|
|
if ((qva->qva_flags & VERIFY_SCRIPT) &&
|
|
|
|
(rc = rpmVerifyScript(qva->qva_prefix, h, fdo)) != 0)
|
1998-09-25 01:47:41 +08:00
|
|
|
ec = rc;
|
1998-11-21 04:18:22 +08:00
|
|
|
fdClose(fdo);
|
1998-09-25 01:47:41 +08:00
|
|
|
return ec;
|
1996-11-23 01:19:14 +08:00
|
|
|
}
|
|
|
|
|
1999-05-11 07:41:04 +08:00
|
|
|
#if DELETE_ME
|
|
|
|
int
|
|
|
|
showMatches(QVA_t *qva, rpmdb db, dbiIndexSet matches, QVF_t showPackage)
|
|
|
|
{
|
1996-02-20 12:31:08 +08:00
|
|
|
Header h;
|
1999-05-11 07:41:04 +08:00
|
|
|
int ec = 0;
|
|
|
|
int i;
|
1996-02-20 12:31:08 +08:00
|
|
|
|
1998-11-20 02:10:28 +08:00
|
|
|
for (i = 0; i < dbiIndexSetCount(matches); i++) {
|
1999-05-11 07:41:04 +08:00
|
|
|
int rc;
|
1998-11-20 02:10:28 +08:00
|
|
|
unsigned int recOffset = dbiIndexRecordOffset(matches, i);
|
|
|
|
if (recOffset == 0)
|
1998-09-25 01:47:41 +08:00
|
|
|
continue;
|
1999-05-11 07:41:04 +08:00
|
|
|
rpmMessage(RPMMESS_DEBUG, _("record number %u\n"), recOffset);
|
1996-02-20 12:31:08 +08:00
|
|
|
|
1998-11-20 02:10:28 +08:00
|
|
|
h = rpmdbGetRecord(db, recOffset);
|
1998-11-17 05:40:28 +08:00
|
|
|
if (h == NULL) {
|
1997-04-29 10:45:19 +08:00
|
|
|
fprintf(stderr, _("error: could not read database record\n"));
|
1998-09-25 01:47:41 +08:00
|
|
|
ec = 1;
|
|
|
|
} else {
|
1999-05-11 07:41:04 +08:00
|
|
|
if ((rc = showPackage(qva, db, h)) != 0)
|
1998-09-25 01:47:41 +08:00
|
|
|
ec = rc;
|
1996-11-19 02:02:36 +08:00
|
|
|
headerFree(h);
|
1996-02-20 12:31:08 +08:00
|
|
|
}
|
|
|
|
}
|
1998-09-25 01:47:41 +08:00
|
|
|
return ec;
|
1996-02-20 12:31:08 +08:00
|
|
|
}
|
1999-05-11 07:41:04 +08:00
|
|
|
#endif
|
1996-02-20 12:31:08 +08:00
|
|
|
|
1999-05-11 07:41:04 +08:00
|
|
|
int rpmVerify(QVA_t *qva, enum rpmQVSources source, const char *arg)
|
1999-05-08 02:33:35 +08:00
|
|
|
{
|
1999-05-11 07:41:04 +08:00
|
|
|
QVF_t showPackage = showVerifyPackage;
|
|
|
|
rpmdb db = NULL;
|
|
|
|
dbiIndexSet matches;
|
1996-02-20 12:31:08 +08:00
|
|
|
Header h;
|
|
|
|
int offset;
|
1999-05-08 02:33:35 +08:00
|
|
|
int rc;
|
1996-02-20 12:31:08 +08:00
|
|
|
int isSource;
|
1999-05-08 02:33:35 +08:00
|
|
|
int recNumber;
|
|
|
|
int retcode = 0;
|
|
|
|
char *end = NULL;
|
1996-02-20 12:31:08 +08:00
|
|
|
|
1999-05-08 02:33:35 +08:00
|
|
|
switch (source) {
|
|
|
|
case RPMQV_RPM:
|
1999-05-11 07:41:04 +08:00
|
|
|
if (!(qva->qva_flags & VERIFY_DEPS))
|
1999-05-08 02:33:35 +08:00
|
|
|
break;
|
|
|
|
/* fall thru */
|
|
|
|
default:
|
1999-05-11 07:41:04 +08:00
|
|
|
if (rpmdbOpen(qva->qva_prefix, &db, O_RDONLY, 0644)) {
|
|
|
|
fprintf(stderr, _("rpmQuery: rpmdbOpen() failed\n"));
|
|
|
|
return 1;
|
|
|
|
}
|
1999-05-08 02:33:35 +08:00
|
|
|
break;
|
1996-02-20 12:31:08 +08:00
|
|
|
}
|
|
|
|
|
1999-05-08 02:33:35 +08:00
|
|
|
switch (source) {
|
|
|
|
case RPMQV_RPM:
|
|
|
|
{ FD_t fd;
|
|
|
|
|
|
|
|
fd = ufdOpen(arg, O_RDONLY, 0);
|
|
|
|
if (fdFileno(fd) < 0) {
|
|
|
|
fprintf(stderr, _("open of %s failed\n"), arg);
|
|
|
|
ufdClose(fd);
|
|
|
|
retcode = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
retcode = rpmReadPackageHeader(fd, &h, &isSource, NULL, NULL);
|
|
|
|
|
|
|
|
ufdClose(fd);
|
|
|
|
|
|
|
|
switch (retcode) {
|
|
|
|
case 0:
|
1999-05-11 07:41:04 +08:00
|
|
|
retcode = showPackage(qva, db, h);
|
1999-05-08 02:33:35 +08:00
|
|
|
headerFree(h);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
fprintf(stderr, _("%s does not appear to be a RPM package\n"), arg);
|
|
|
|
/* fallthrough */
|
|
|
|
case 2:
|
1999-05-11 07:41:04 +08:00
|
|
|
fprintf(stderr, _("verify of %s failed\n"), arg);
|
1999-05-08 02:33:35 +08:00
|
|
|
retcode = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} break;
|
|
|
|
|
|
|
|
case RPMQV_SPECFILE: /* XXX FIXME */
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RPMQV_ALL:
|
1998-09-25 01:47:41 +08:00
|
|
|
for (offset = rpmdbFirstRecNum(db);
|
|
|
|
offset != 0;
|
|
|
|
offset = rpmdbNextRecNum(db, offset)) {
|
|
|
|
h = rpmdbGetRecord(db, offset);
|
1998-11-17 05:40:28 +08:00
|
|
|
if (h == NULL) {
|
1998-09-25 01:47:41 +08:00
|
|
|
fprintf(stderr, _("could not read database record!\n"));
|
1999-05-11 07:41:04 +08:00
|
|
|
return 1;
|
1998-09-25 01:47:41 +08:00
|
|
|
}
|
1999-05-11 07:41:04 +08:00
|
|
|
if ((rc = showPackage(qva, db, h)) != 0)
|
1999-05-08 02:33:35 +08:00
|
|
|
retcode = rc;
|
1998-09-25 01:47:41 +08:00
|
|
|
headerFree(h);
|
1996-02-20 12:31:08 +08:00
|
|
|
}
|
1999-05-08 02:33:35 +08:00
|
|
|
break;
|
1999-05-11 07:41:04 +08:00
|
|
|
|
1999-05-08 02:33:35 +08:00
|
|
|
case RPMQV_GROUP:
|
|
|
|
if (rpmdbFindByGroup(db, arg, &matches)) {
|
1999-05-11 07:41:04 +08:00
|
|
|
fprintf(stderr, _("group %s does not contain any packages\n"), arg);
|
|
|
|
retcode = 1;
|
1999-05-08 02:33:35 +08:00
|
|
|
} else {
|
1999-05-11 07:41:04 +08:00
|
|
|
retcode = showMatches(qva, db, matches, showPackage);
|
1999-05-08 02:33:35 +08:00
|
|
|
dbiFreeIndexRecord(matches);
|
|
|
|
}
|
|
|
|
break;
|
1998-12-01 08:10:18 +08:00
|
|
|
|
1999-05-08 02:33:35 +08:00
|
|
|
case RPMQV_WHATPROVIDES:
|
|
|
|
if (rpmdbFindByProvides(db, arg, &matches)) {
|
|
|
|
fprintf(stderr, _("no package provides %s\n"), arg);
|
|
|
|
retcode = 1;
|
|
|
|
} else {
|
1999-05-11 07:41:04 +08:00
|
|
|
retcode = showMatches(qva, db, matches, showPackage);
|
1999-05-08 02:33:35 +08:00
|
|
|
dbiFreeIndexRecord(matches);
|
|
|
|
}
|
|
|
|
break;
|
1998-12-01 08:10:18 +08:00
|
|
|
|
1999-05-08 02:33:35 +08:00
|
|
|
case RPMQV_TRIGGEREDBY:
|
|
|
|
if (rpmdbFindByTriggeredBy(db, arg, &matches)) {
|
|
|
|
fprintf(stderr, _("no package triggers %s\n"), arg);
|
|
|
|
retcode = 1;
|
|
|
|
} else {
|
1999-05-11 07:41:04 +08:00
|
|
|
retcode = showMatches(qva, db, matches, showPackage);
|
1999-05-08 02:33:35 +08:00
|
|
|
dbiFreeIndexRecord(matches);
|
|
|
|
}
|
|
|
|
break;
|
1996-02-20 12:31:08 +08:00
|
|
|
|
1999-05-08 02:33:35 +08:00
|
|
|
case RPMQV_WHATREQUIRES:
|
|
|
|
if (rpmdbFindByRequiredBy(db, arg, &matches)) {
|
|
|
|
fprintf(stderr, _("no package requires %s\n"), arg);
|
|
|
|
retcode = 1;
|
|
|
|
} else {
|
1999-05-11 07:41:04 +08:00
|
|
|
retcode = showMatches(qva, db, matches, showPackage);
|
1999-05-08 02:33:35 +08:00
|
|
|
dbiFreeIndexRecord(matches);
|
|
|
|
}
|
|
|
|
break;
|
1996-02-20 12:31:08 +08:00
|
|
|
|
1999-05-08 02:33:35 +08:00
|
|
|
case RPMQV_PATH:
|
|
|
|
if (rpmdbFindByFile(db, arg, &matches)) {
|
|
|
|
int myerrno = 0;
|
|
|
|
if (access(arg, F_OK) != 0)
|
|
|
|
myerrno = errno;
|
|
|
|
switch (myerrno) {
|
|
|
|
default:
|
|
|
|
fprintf(stderr, _("file %s: %s\n"), arg, strerror(myerrno));
|
1996-02-20 12:31:08 +08:00
|
|
|
break;
|
1999-05-08 02:33:35 +08:00
|
|
|
case 0:
|
|
|
|
fprintf(stderr, _("file %s is not owned by any package\n"), arg);
|
1998-12-15 05:34:11 +08:00
|
|
|
break;
|
1996-02-20 12:31:08 +08:00
|
|
|
}
|
1999-05-08 02:33:35 +08:00
|
|
|
retcode = 1;
|
|
|
|
} else {
|
1999-05-11 07:41:04 +08:00
|
|
|
retcode = showMatches(qva, db, matches, showPackage);
|
1999-05-08 02:33:35 +08:00
|
|
|
dbiFreeIndexRecord(matches);
|
1996-02-20 12:31:08 +08:00
|
|
|
}
|
1999-05-08 02:33:35 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RPMQV_DBOFFSET:
|
|
|
|
recNumber = strtoul(arg, &end, 10);
|
|
|
|
if ((*end) || (end == arg) || (recNumber == ULONG_MAX)) {
|
|
|
|
fprintf(stderr, _("invalid package number: %s\n"), arg);
|
|
|
|
return 1;
|
|
|
|
}
|
1999-05-11 07:41:04 +08:00
|
|
|
rpmMessage(RPMMESS_DEBUG, _("package record number: %d\n"), recNumber);
|
1999-05-08 02:33:35 +08:00
|
|
|
h = rpmdbGetRecord(db, recNumber);
|
|
|
|
if (h == NULL) {
|
|
|
|
fprintf(stderr, _("record %d could not be read\n"), recNumber);
|
|
|
|
retcode = 1;
|
|
|
|
} else {
|
1999-05-11 07:41:04 +08:00
|
|
|
retcode = showPackage(qva, db, h);
|
1999-05-08 02:33:35 +08:00
|
|
|
headerFree(h);
|
|
|
|
}
|
|
|
|
break;
|
1999-05-11 07:41:04 +08:00
|
|
|
|
|
|
|
case RPMQV_PACKAGE:
|
|
|
|
rc = rpmdbFindByLabel(db, arg, &matches);
|
|
|
|
if (rc == 1) {
|
|
|
|
retcode = 1;
|
|
|
|
fprintf(stderr, _("package %s is not installed\n"), arg);
|
|
|
|
} else if (rc == 2) {
|
|
|
|
retcode = 1;
|
|
|
|
fprintf(stderr, _("error looking for package %s\n"), arg);
|
|
|
|
} else {
|
|
|
|
retcode = showMatches(qva, db, matches, showPackage);
|
|
|
|
dbiFreeIndexRecord(matches);
|
|
|
|
}
|
|
|
|
break;
|
1996-02-20 12:31:08 +08:00
|
|
|
}
|
|
|
|
|
1999-05-11 07:41:04 +08:00
|
|
|
switch (source) {
|
1999-05-08 02:33:35 +08:00
|
|
|
case RPMQV_RPM:
|
1999-05-11 07:41:04 +08:00
|
|
|
if (!(qva->qva_flags & VERIFY_DEPS))
|
1999-05-08 02:33:35 +08:00
|
|
|
break;
|
|
|
|
/* fall thru */
|
|
|
|
default:
|
|
|
|
if (db) {
|
|
|
|
rpmdbClose(db);
|
|
|
|
db = NULL;
|
|
|
|
}
|
|
|
|
break;
|
1996-02-20 12:31:08 +08:00
|
|
|
}
|
1999-05-08 02:33:35 +08:00
|
|
|
return retcode;
|
1996-02-20 12:31:08 +08:00
|
|
|
}
|