diff options
author | jbj <devnull@localhost> | 2002-07-13 19:08:51 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-07-13 19:08:51 +0000 |
commit | 261b4a2ecbc7b4ccef094490c74e90f8cfdacfff (patch) | |
tree | 16df21598d84a9ba57f8b5accd422c75607c980f /rpmdb/rpmdb.c | |
parent | b9df0c51e490b2a2e158a8525d7753cb1fe1bc6e (diff) | |
download | rpm-261b4a2ecbc7b4ccef094490c74e90f8cfdacfff.tar.gz rpm-261b4a2ecbc7b4ccef094490c74e90f8cfdacfff.tar.bz2 rpm-261b4a2ecbc7b4ccef094490c74e90f8cfdacfff.zip |
- install rpmal.h and rpmhash.h, implicit rpmps.hinclude, for now.
- revert headerFree/headerLink/headerUnlink debugging.
CVS patchset: 5550
CVS date: 2002/07/13 19:08:51
Diffstat (limited to 'rpmdb/rpmdb.c')
-rw-r--r-- | rpmdb/rpmdb.c | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c index 24beaa7fa..20db5d9f1 100644 --- a/rpmdb/rpmdb.c +++ b/rpmdb/rpmdb.c @@ -624,6 +624,32 @@ int rpmdbOpenAll(rpmdb db) return rc; } +int rpmdbCloseDBI(rpmdb db, int rpmtag) +{ + int dbix; + int rc = 0; + + if (db == NULL || db->_dbi == NULL || dbiTags == NULL) + return 0; + + for (dbix = 0; dbix < dbiTagsMax; dbix++) { + if (dbiTags[dbix] != rpmtag) + continue; +/*@-boundswrite@*/ + if (db->_dbi[dbix] != NULL) { + int xx; + /*@-unqualifiedtrans@*/ /* FIX: double indirection. */ + xx = dbiClose(db->_dbi[dbix], 0); + if (xx && rc == 0) rc = xx; + db->_dbi[dbix] = NULL; + /*@=unqualifiedtrans@*/ + } +/*@=boundswrite@*/ + break; + } + return rc; +} + /* XXX query.c, rpminstall.c, verify.c */ int rpmdbClose(rpmdb db) { @@ -1033,7 +1059,7 @@ if (rc == 0) mi = rpmdbInitIterator(db, RPMDBI_PACKAGES, &offset, sizeof(offset)); h = rpmdbNextIterator(mi); if (h) - h = headerLink(h, "rpmdbFindByFile"); + h = headerLink(h); mi = rpmdbFreeIterator(mi); } @@ -1067,7 +1093,7 @@ if (rc == 0) baseNames = hfd(baseNames, bnt); dirNames = hfd(dirNames, dnt); - h = headerFree(h, "rpmdbFindByFile"); + h = headerFree(h); } rec = _free(rec); @@ -1404,7 +1430,7 @@ static int miFreeHeader(rpmdbMatchIterator mi, dbiIndex dbi) data->size = 0; } - mi->mi_h = headerFree(mi->mi_h, "mi->mi_h"); + mi->mi_h = headerFree(mi->mi_h); /*@-nullstate@*/ return rc; @@ -2245,7 +2271,7 @@ memset(data, 0, sizeof(*data)); mi = rpmdbInitIterator(db, RPMDBI_PACKAGES, &hdrNum, sizeof(hdrNum)); h = rpmdbNextIterator(mi); if (h) - h = headerLink(h, "rpmdbRemove"); + h = headerLink(h); mi = rpmdbFreeIterator(mi); } @@ -2520,7 +2546,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */ (void) unblockSignals(db, &signalMask); - h = headerFree(h, "rpmdbRemove"); + h = headerFree(h); /* XXX return ret; */ return 0; @@ -3403,7 +3429,7 @@ int rpmdbRebuild(const char * prefix) { Header nh = (headerIsEntry(h, RPMTAG_HEADERIMAGE) ? headerCopy(h) : NULL); rc = rpmdbAdd(newdb, -1, (nh ? nh : h)); - nh = headerFree(nh, "rpmdbRebuild"); + nh = headerFree(nh); } if (rc) { |