Files | |
file | rpmlib.h |
In Memoriam: Steve Taylor <staylor@redhat.com> was here, now he's not. | |
file | dbconfig.c |
file | hdrNVR.c |
file | rpmdb.c |
file | rpmdb.h |
Access RPM indices using Berkeley DB interface(s). | |
Data Structures | |
struct | rpmdb_s |
Typedefs | |
typedef rpmdb_s * | rpmdb |
typedef _rpmdbMatchIterator * | rpmdbMatchIterator |
typedef _dbiIndexSet * | dbiIndexSet |
Enumerations | |
enum | rpmdbFlags { RPMDB_FLAG_JUSTCHECK = (1 << 0), RPMDB_FLAG_MINIMAL = (1 << 1), RPMDB_FLAG_CHROOT = (1 << 2) } |
Functions | |
int | rpmdbFindFpList (rpmdb db, fingerPrint *fpList, dbiIndexSet *matchList, int numItems) |
unsigned int | rpmdbGetIteratorFileNum (rpmdbMatchIterator mi) |
rpmdb | rpmdbUnlink (rpmdb db, const char *msg) |
rpmdb | rpmdbLink (rpmdb db, const char *msg) |
int | rpmdbOpen (const char *prefix, rpmdb *dbp, int mode, int perms) |
int | rpmdbInit (const char *prefix, int perms) |
int | rpmdbVerify (const char *prefix) |
int | rpmdbClose (rpmdb db) |
int | rpmdbSync (rpmdb db) |
int | rpmdbOpenAll (rpmdb db) |
int | rpmdbCountPackages (rpmdb db, const char *name) |
unsigned int | rpmdbGetIteratorOffset (rpmdbMatchIterator mi) |
int | rpmdbGetIteratorCount (rpmdbMatchIterator mi) |
int | rpmdbAppendIterator (rpmdbMatchIterator mi, const int *hdrNums, int nHdrNums) |
int | rpmdbPruneIterator (rpmdbMatchIterator mi, int *hdrNums, int nHdrNums, int sorted) |
int | rpmdbSetIteratorRE (rpmdbMatchIterator mi, rpmTag tag, rpmMireMode mode, const char *pattern) |
int | rpmdbSetIteratorRewrite (rpmdbMatchIterator mi, int rewrite) |
int | rpmdbSetIteratorModified (rpmdbMatchIterator mi, int modified) |
int | rpmdbSetHdrChk (rpmdbMatchIterator mi, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, const char **msg)) |
rpmdbMatchIterator | rpmdbInitIterator (rpmdb db, rpmTag rpmtag, const void *keyp, size_t keylen) |
Header | rpmdbNextIterator (rpmdbMatchIterator mi) |
int | rpmdbCheckSignals (void) |
rpmdbMatchIterator | rpmdbFreeIterator (rpmdbMatchIterator mi) |
int | rpmdbAdd (rpmdb db, int iid, Header h, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, const char **msg)) |
int | rpmdbRemove (rpmdb db, int rid, unsigned int hdrNum, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, const char **msg)) |
int | rpmdbRebuild (const char *prefix, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, const char **msg)) |
Variables | |
int * | dbiTags |
|
A single element (i.e. inverted list from tag values) of a database. Definition at line 49 of file rpmdb.h. Referenced by dbiAppendSet(), dbiFindByLabel(), dbiFindMatches(), dbiFreeIndexSet(), dbiIndexRecordFileNumber(), dbiIndexRecordOffset(), dbiIndexSetCount(), dbiPruneSet(), dbt2set(), rpmdbAdd(), rpmdbCountPackages(), rpmdbFindByFile(), rpmdbFindFpList(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbRemove(), rpmtsRun(), and set2dbt(). |
|
Database of headers and tag value indices. Definition at line 108 of file rpmlib.h. Referenced by blockSignals(), db3close(), db3New(), db3open(), db_fini(), db_init(), dbiOpen(), main(), newRpmdb(), openDatabase(), rpmdbAdd(), rpmdbCheckSignals(), rpmdbClose(), rpmdbCloseDBI(), rpmdbCountPackages(), rpmdbFindByFile(), rpmdbFindFpList(), rpmdbInit(), rpmdbInitIterator(), rpmdbOpen(), rpmdbOpenAll(), rpmdbRebuild(), rpmdbRemove(), rpmdbSync(), rpmdbVerify(), rpmtsGetRdb(), unblockSignals(), XrpmdbLink(), and XrpmdbUnlink(). |
|
|
|
|
|
Append items to set of package instances to iterate.
Definition at line 2367 of file rpmdb.c. References dbiAppendSet(), _rpmdbMatchIterator::mi_set, rpmdbMatchIterator, and xcalloc(). Referenced by markReplacedFiles(). |
|
Check rpmdb signal handler for trapped signal exit. Definition at line 671 of file rpmdb.c. References rpmdb_s::db_next, EXIT_FAILURE, _rpmdbMatchIterator::mi_next, rpmdb, rpmdbClose(), rpmdbFreeIterator(), rpmdbMatchIterator, rpmdbRock, RPMMESS_DEBUG, rpmMessage, rpmmiRock, and rpmsqCaught. Referenced by rpmdbFreeIterator(), rpmdbInitIterator(), rpmQueryVerify(), rpmtsRun(), and unblockSignals(). |
|
Close all database indices and free rpmdb.
Definition at line 812 of file rpmdb.c. References rpmdb_s::_dbi, _free(), rpmdb_s::db_bits, rpmdb_s::db_errpfx, rpmdb_s::db_home, rpmdb_s::db_ndbi, rpmdb_s::db_next, rpmdb_s::db_root, dbiClose(), rpmdb_s::nrefs, PBM_FREE, rpmdb, rpmdbUnlink, and rpmsqEnable(). Referenced by main(), openDatabase(), rpmdb_dealloc(), rpmdbCheckSignals(), rpmdbInit(), rpmdbRebuild(), rpmdbVerify(), rpmtsCloseDB(), and rpmtsCloseSDB(). |
|
Return number of instances of package in rpm database.
Definition at line 1284 of file rpmdb.c. References _, alloca(), _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_txnid, dbiCclose(), dbiCopen(), dbiFreeIndexSet(), dbiGet(), dbiIndex, dbiIndexSet, dbiIndexSetCount(), dbiOpen(), dbt2set(), rpmdb, RPMERR_DBGETINDEX, rpmError, RPMTAG_NAME, and tagName(). Referenced by handleOneTrigger(), rpmpsmStage(), and runTriggers(). |
|
Find fingerprint matches in database.
Definition at line 3263 of file rpmdb.c. References _free(), fingerPrint_s::baseName, _dbiIndexSet::count, dbiAppendSet(), dbiIndexItem, dbiIndexSet, fingerPrint, fingerPrintCache, FP_EQUAL, fpCacheCreate(), fpCacheFree(), fpLookupList(), _dbiIndexItem::fpNum, _dbiIndexItem::hdrNum, Header, HFD_t, HGE_t, int_32, _rpmdbMatchIterator::mi_data, _rpmdbMatchIterator::mi_key, _rpmdbMatchIterator::mi_set, _rpmdbMatchIterator::mi_setx, _dbiIndexSet::recs, rpmdb, rpmdbFreeIterator(), rpmdbGetIteratorCount(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbMatchIterator, rpmdbNextIterator(), rpmdbSortIterator(), RPMTAG_BASENAMES, RPMTAG_DIRINDEXES, RPMTAG_DIRNAMES, rpmTagType, skipDir(), _dbiIndexItem::tagNum, and xcalloc(). Referenced by rpmtsRun(). |
|
Destroy rpm database iterator.
Definition at line 1600 of file rpmdb.c. References _free(), dbiCclose(), dbiFreeIndexSet(), dbiIndex, dbiOpen(), _rpmdbMatchIterator::mi_db, _rpmdbMatchIterator::mi_dbc, _rpmdbMatchIterator::mi_keyp, _rpmdbMatchIterator::mi_next, _rpmdbMatchIterator::mi_nre, _rpmdbMatchIterator::mi_re, _rpmdbMatchIterator::mi_set, miFreeHeader(), miRE, miRE_s::pattern, miRE_s::preg, rpmdbCheckSignals(), RPMDBI_PACKAGES, rpmdbMatchIterator, and rpmdbUnlink. Referenced by checkPackageSet(), dbiFindMatches(), ftsCacheUpdate(), handleInstInstalledFiles(), handleRmvdInstalledFiles(), IDTXload(), main(), markReplacedFiles(), rpmcliShowMatches(), rpmdb_length(), rpmdb_subscript(), rpmdbCheckSignals(), rpmdbFindByFile(), rpmdbFindFpList(), rpmdbRebuild(), rpmdbRemove(), rpmErase(), rpmInstall(), rpmmi_dealloc(), rpmmi_iternext(), rpmpsmStage(), rpmQueryVerify(), rpmts_AddErase(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsFindPubkey(), rpmtsRun(), rpmtsSolve(), runImmedTriggers(), runTriggers(), and unsatisfiedDepend(). |
|
Return number of elements in rpm database iterator.
Definition at line 1662 of file rpmdb.c. References _dbiIndexSet::count, _rpmdbMatchIterator::mi_set, and rpmdbMatchIterator. Referenced by ftsCacheUpdate(), rpmdbFindFpList(), rpmInstall(), rpmmi_Count(), rpmts_AddErase(), and runImmedTriggers(). |
|
Definition at line 1658 of file rpmdb.c. References _rpmdbMatchIterator::mi_filenum, and rpmdbMatchIterator. Referenced by rpmtsFindPubkey(). |
|
Return header join key for current position of rpm database iterator.
Definition at line 1654 of file rpmdb.c. References _rpmdbMatchIterator::mi_offset, and rpmdbMatchIterator. Referenced by IDTXload(), markReplacedFiles(), rpmErase(), rpmmi_Instance(), rpmpsmStage(), rpmts_AddErase(), and rpmtsAddInstallElement(). |
|
Initialize database.
Definition at line 1072 of file rpmdb.c. References openDatabase(), rpmdb, RPMDB_FLAG_JUSTCHECK, rpmdbClose(), rpmdbOpenAll(), and rpmExpandNumeric(). Referenced by rpmtsInitDB(). |
|
Return database iterator.
Definition at line 2378 of file rpmdb.c. References _, _free(), _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_txnid, dbiCclose(), dbiCopen(), dbiFindByLabel(), dbiFreeIndexSet(), dbiGet(), dbiIndex, dbiIndexSet, dbiOpen(), dbt2set(), _rpmdbMatchIterator::mi_data, _rpmdbMatchIterator::mi_db, _rpmdbMatchIterator::mi_key, _rpmdbMatchIterator::mi_keylen, _rpmdbMatchIterator::mi_keyp, _rpmdbMatchIterator::mi_next, rpmdb, rpmdbCheckSignals(), rpmdbFindByFile(), RPMDBI_PACKAGES, rpmdbLink, rpmdbMatchIterator, RPMERR_DBGETINDEX, rpmError, rpmmiRock, tagName(), xcalloc(), and xmalloc(). Referenced by dbiFindMatches(), main(), rpmdb_length(), rpmdb_Match(), rpmdb_subscript(), rpmdbFindByFile(), rpmdbFindFpList(), rpmdbRebuild(), rpmdbRemove(), rpmtsInitIterator(), and rpmtsSolve(). |
|
Reference a database instance.
|
|
Return next package header from iteration.
Definition at line 2078 of file rpmdb.c. References _, _free(), _dbiIndexSet::count, rpmdb_s::db_bits, rpmdb_s::db_nbits, _dbiIndex::dbi_txnid, dbiCopen(), dbiGet(), dbiIndex, dbiIndexRecordFileNumber(), dbiIndexRecordOffset(), dbiOpen(), headerToken_s::flags, Header, headerCopyLoad(), headerIsEntry(), headerLoad(), _rpmdbMatchIterator::mi_cflags, _rpmdbMatchIterator::mi_data, _rpmdbMatchIterator::mi_db, _rpmdbMatchIterator::mi_dbc, _rpmdbMatchIterator::mi_filenum, _rpmdbMatchIterator::mi_h, _rpmdbMatchIterator::mi_hdrchk, _rpmdbMatchIterator::mi_key, _rpmdbMatchIterator::mi_keylen, _rpmdbMatchIterator::mi_keyp, _rpmdbMatchIterator::mi_modified, _rpmdbMatchIterator::mi_offset, _rpmdbMatchIterator::mi_prevoffset, _rpmdbMatchIterator::mi_set, _rpmdbMatchIterator::mi_setx, _rpmdbMatchIterator::mi_ts, miFreeHeader(), mireSkip(), PBM_ISSET, PBM_REALLOC(), PBM_SET, RPMDBI_PACKAGES, rpmdbMatchIterator, RPMERR_BADHEADER, rpmError, RPMMESS_ERROR, rpmMessage, rpmRC, RPMRC_FAIL, and RPMTAG_NAME. Referenced by checkPackageSet(), dbiFindMatches(), handleInstInstalledFiles(), handleRmvdInstalledFiles(), IDTXload(), main(), markReplacedFiles(), rpmcliShowMatches(), rpmdb_length(), rpmdb_subscript(), rpmdbFindByFile(), rpmdbFindFpList(), rpmdbRebuild(), rpmdbRemove(), rpmErase(), rpmInstall(), rpmmi_iternext(), rpmpsmStage(), rpmts_AddErase(), rpmtsAddInstallElement(), rpmtsFindPubkey(), rpmtsRun(), rpmtsSolve(), runImmedTriggers(), runTriggers(), and unsatisfiedDepend(). |
|
Open rpm database.
Definition at line 1064 of file rpmdb.c. References openDatabase(), rpmdb, and rpmExpandNumeric(). Referenced by main(), rpmtsOpenDB(), and rpmtsOpenSDB(). |
|
Open all database indices.
Definition at line 768 of file rpmdb.c. References rpmdb_s::_dbi, rpmdb_s::db_flags, dbiOpen(), dbiTags, and rpmdb. Referenced by rpmdbInit(), and rpmdbVerify(). |
|
Remove items from set of package instances to iterate.
Definition at line 2356 of file rpmdb.c. References dbiPruneSet(), _rpmdbMatchIterator::mi_set, and rpmdbMatchIterator. Referenced by checkPackageSet(), rpmtsAddInstallElement(), and unsatisfiedDepend(). |
|
Rebuild database indices from package headers.
Definition at line 3597 of file rpmdb.c. References _, _db_filter_dups, _free(), _rebuildinprogress, _RECNUM, rpmdb_s::db_api, rpmdb_s::db_filter_dups, errno, F_OK, Header, headerCopy(), headerFree(), headerIsEntry(), headerNVR(), Mkdir(), openDatabase(), Rmdir(), rpmdb, RPMDB_FLAG_MINIMAL, rpmdbAdd(), rpmdbClose(), rpmdbFreeIterator(), RPMDBI_PACKAGES, rpmdbInitIterator(), rpmdbMatchIterator, rpmdbMoveDatabase(), rpmdbNextIterator(), rpmdbRemoveDatabase(), rpmdbSetHdrChk(), rpmdbSetIteratorRE(), rpmDefineMacro(), RPMERR_INTERNAL, RPMERR_MKDIR, rpmError, rpmExpandNumeric(), rpmGetPath(), RPMMESS_DEBUG, RPMMESS_ERROR, RPMMESS_NORMAL, rpmMessage, RPMMIRE_DEFAULT, RPMTAG_BUILDTIME, RPMTAG_HEADERIMAGE, RPMTAG_NAME, RPMTAG_RELEASE, RPMTAG_VERSION, stpcpy(), strerror(), and xmalloc(). Referenced by rpmtsRebuildDB(). |
|
Remove package header from rpm database and indices.
Definition at line 2501 of file rpmdb.c. References _, _free(), alloca(), blockSignals(), byte, _dbiIndexSet::count, _dbiIndex::dbi_no_dbsync, _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_txnid, dbiCclose(), dbiCopen(), dbiDel(), dbiFreeIndexSet(), dbiGet(), dbiIndex, dbiIndexItem, dbiIndexNewItem(), dbiIndexSet, dbiOpen(), dbiPruneSet(), dbiPut(), dbiSync(), dbiTags, dbt2set(), Header, headerAddEntry(), headerFree(), headerLink(), headerNVR(), HFD_t, HGE_t, int_32, nibble(), pgpDig, pgpNewDig(), pgpPrtPkts(), pgpDig_s::pubkey, RPM_BIN_TYPE, RPM_CHAR_TYPE, RPM_I18NSTRING_TYPE, RPM_INT16_TYPE, RPM_INT32_TYPE, RPM_INT8_TYPE, RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, rpmdb, rpmdbFreeIterator(), RPMDBI_ADDED, RPMDBI_AVAILABLE, RPMDBI_DEPENDS, RPMDBI_PACKAGES, RPMDBI_REMOVED, rpmdbInitIterator(), rpmdbMatchIterator, rpmdbNextIterator(), RPMERR_DBCORRUPT, RPMERR_DBGETINDEX, RPMERR_DBPUTINDEX, rpmError, RPMMESS_DEBUG, rpmMessage, RPMTAG_FILEMD5S, RPMTAG_REMOVETID, rpmTagType, set2dbt(), pgpDigParams_s::signid, tagName(), and unblockSignals(). Referenced by rpmpsmStage(). |
|
Modify iterator to verify retrieved header blobs.
Definition at line 2063 of file rpmdb.c. References _rpmdbMatchIterator::mi_hdrchk, _rpmdbMatchIterator::mi_ts, and rpmdbMatchIterator. Referenced by rpmdbRebuild(), and rpmtsInitIterator(). |
|
Modify iterator to mark header for lazy write on release.
Definition at line 2053 of file rpmdb.c. References _rpmdbMatchIterator::mi_modified, and rpmdbMatchIterator. Referenced by markReplacedFiles(). |
|
Add pattern to iterator selector.
Definition at line 1821 of file rpmdb.c. References _free(), miRE_s::cflags, miRE_s::eflags, miRE_s::fnflags, _rpmdbMatchIterator::mi_nre, _rpmdbMatchIterator::mi_re, miRE, mireCmp(), mireDup(), miRE_s::mode, miRE_s::notmatch, miRE_s::pattern, miRE_s::preg, rpmdbMatchIterator, RPMERR_REGCOMP, rpmError, rpmExpand(), RPMMIRE_DEFAULT, RPMMIRE_GLOB, RPMMIRE_REGEX, RPMMIRE_STRCMP, rpmMireMode, miRE_s::tag, xcalloc(), and xrealloc(). Referenced by dbiFindMatches(), IDTXload(), rpmdbRebuild(), rpmmi_Pattern(), rpmpsmStage(), rpmQueryVerify(), rpmtsInitIterator(), and rpmtsRun(). |
|
Prepare iterator for lazy writes.
Definition at line 2040 of file rpmdb.c. References _rpmdbMatchIterator::mi_cflags, and rpmdbMatchIterator. Referenced by markReplacedFiles(). |
|
Sync all database indices.
Definition at line 869 of file rpmdb.c. References rpmdb_s::_dbi, rpmdb_s::db_ndbi, dbiSync(), and rpmdb. Referenced by rpmtsRun(). |
|
Unreference a database instance.
|
|
Verify database components.
Definition at line 1093 of file rpmdb.c. References rpmdb_s::_dbi, rpmdb_s::db_ndbi, dbiVerify(), openDatabase(), rpmdb, rpmdbClose(), rpmdbOpenAll(), and rpmExpandNumeric(). Referenced by rpmtsVerifyDB(). |
|
Tags for which rpmdb indices will be built. Definition at line 61 of file rpmdb.c. Referenced by dbiTagsInit(), dbiTagToDbix(), main(), openDatabase(), rpmdbAdd(), rpmdbCloseDBI(), rpmdbMoveDatabase(), rpmdbOpenAll(), rpmdbRemove(), and rpmdbRemoveDatabase(). |