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 |
Describes the collection of index databases used by rpm. More... | |
Typedefs | |
typedef rpmdb_s * | rpmdb |
Database of headers and tag value indices. | |
typedef _rpmdbMatchIterator * | rpmdbMatchIterator |
Database iterator. | |
typedef _dbiIndexSet * | dbiIndexSet |
A single element (i.e. | |
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) |
Find fingerprint matches in database. | |
unsigned int | rpmdbGetIteratorFileNum (rpmdbMatchIterator mi) |
rpmdb | rpmdbUnlink (rpmdb db, const char *msg) |
Unreference a database instance. | |
rpmdb | rpmdbLink (rpmdb db, const char *msg) |
Reference a database instance. | |
int | rpmdbOpen (const char *prefix, rpmdb *dbp, int mode, int perms) |
Open rpm database. | |
int | rpmdbInit (const char *prefix, int perms) |
Initialize database. | |
int | rpmdbVerify (const char *prefix) |
Verify database components. | |
int | rpmdbClose (rpmdb db) |
Close all database indices and free rpmdb. | |
int | rpmdbSync (rpmdb db) |
Sync all database indices. | |
int | rpmdbOpenAll (rpmdb db) |
Open all database indices. | |
int | rpmdbCountPackages (rpmdb db, const char *name) |
Return number of instances of package in rpm database. | |
unsigned int | rpmdbGetIteratorOffset (rpmdbMatchIterator mi) |
Return header join key for current position of rpm database iterator. | |
int | rpmdbGetIteratorCount (rpmdbMatchIterator mi) |
Return number of elements in rpm database iterator. | |
int | rpmdbAppendIterator (rpmdbMatchIterator mi, const int *hdrNums, int nHdrNums) |
Append items to set of package instances to iterate. | |
int | rpmdbPruneIterator (rpmdbMatchIterator mi, int *hdrNums, int nHdrNums, int sorted) |
Remove items from set of package instances to iterate. | |
int | rpmdbSetIteratorRE (rpmdbMatchIterator mi, rpmTag tag, rpmMireMode mode, const char *pattern) |
Add pattern to iterator selector. | |
int | rpmdbSetIteratorRewrite (rpmdbMatchIterator mi, int rewrite) |
Prepare iterator for lazy writes. | |
int | rpmdbSetIteratorModified (rpmdbMatchIterator mi, int modified) |
Modify iterator to mark header for lazy write on release. | |
int | rpmdbSetHdrChk (rpmdbMatchIterator mi, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, const char **msg)) |
Modify iterator to verify retrieved header blobs. | |
rpmdbMatchIterator | rpmdbInitIterator (rpmdb db, rpmTag rpmtag, const void *keyp, size_t keylen) |
Return database iterator. | |
Header | rpmdbNextIterator (rpmdbMatchIterator mi) |
Return next package header from iteration. | |
int | rpmdbCheckSignals (void) |
Check rpmdb signal handler for trapped signal exit. | |
rpmdbMatchIterator | rpmdbFreeIterator (rpmdbMatchIterator mi) |
Destroy rpm database iterator. | |
int | rpmdbAdd (rpmdb db, int iid, Header h, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, const char **msg)) |
Add package header to rpm database and indices. | |
int | rpmdbRemove (rpmdb db, int rid, unsigned int hdrNum, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, const char **msg)) |
Remove package header from rpm database and indices. | |
int | rpmdbRebuild (const char *prefix, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, const char **msg)) |
Rebuild database indices from package headers. | |
Variables | |
int * | dbiTags |
Tags for which rpmdb indices will be built. |
|
A single element (i.e. inverted list from tag values) of a database. |
|
Database of headers and tag value indices.
|
|
Database iterator.
|
|
|
|
|
Append items to set of package instances to iterate.
Definition at line 2447 of file rpmdb.c. References dbiAppendSet(), _rpmdbMatchIterator::mi_set, and xcalloc(). Referenced by markReplacedFiles(). |
|
Check rpmdb signal handler for trapped signal exit.
Definition at line 703 of file rpmdb.c. References db, rpmdb_s::db_next, EXIT_FAILURE, _rpmdbMatchIterator::mi_next, rpmdbClose(), rpmdbFreeIterator(), RPMMESS_DEBUG, rpmMessage, and rpmsqCaught. Referenced by rpmdbFreeIterator(), rpmdbInitIterator(), rpmQueryVerify(), rpmtsRun(), and unblockSignals(). |
|
Close all database indices and free rpmdb.
Definition at line 842 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(), next, rpmdb_s::nrefs, PBM_FREE, rpmdbUnlink, and rpmsqEnable(). Referenced by do_tsort(), main(), openDatabase(), rpmdb_dealloc(), rpmdbCheckSignals(), rpmdbInit(), rpmdbRebuild(), rpmdbVerify(), rpmtsCloseDB(), and rpmtsCloseSDB(). |
|
Return number of instances of package in rpm database.
Definition at line 1333 of file rpmdb.c. References _, alloca(), data, DB_NOTFOUND, DB_SET, _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_txnid, dbiCclose(), dbiCopen(), dbiFreeIndexSet(), dbiGet(), dbiIndexSetCount(), dbiOpen(), dbt2set(), RPMERR_DBGETINDEX, rpmError, RPMTAG_NAME, and tagName(). Referenced by handleOneTrigger(), rpmpsmStage(), and runTriggers(). |
|
Find fingerprint matches in database.
Definition at line 3393 of file rpmdb.c. References _free(), fingerPrint_s::baseName, data, __db_dbt::data, dbiAppendSet(), FP_EQUAL, fpCacheCreate(), fpCacheFree(), fpLookupList(), _dbiIndexItem::fpNum, _dbiIndexItem::hdrNum, headerFreeData(), headerGetEntryMinMemory(), _rpmdbMatchIterator::mi_data, _rpmdbMatchIterator::mi_key, _rpmdbMatchIterator::mi_set, _rpmdbMatchIterator::mi_setx, _dbiIndexSet::recs, rpmdbFreeIterator(), rpmdbGetIteratorCount(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbNextIterator(), rpmdbSortIterator(), RPMTAG_BASENAMES, RPMTAG_DIRINDEXES, RPMTAG_DIRNAMES, __db_dbt::size, skipDir(), _dbiIndexItem::tagNum, and xcalloc(). Referenced by rpmtsRun(). |
|
Destroy rpm database iterator.
Definition at line 1656 of file rpmdb.c. References _free(), dbiCclose(), dbiFreeIndexSet(), dbiOpen(), _rpmdbMatchIterator::mi_db, _rpmdbMatchIterator::mi_dbc, _rpmdbMatchIterator::mi_keyp, _rpmdbMatchIterator::mi_next, _rpmdbMatchIterator::mi_re, _rpmdbMatchIterator::mi_set, miFreeHeader(), next, miRE_s::pattern, miRE_s::preg, rpmdbCheckSignals(), RPMDBI_PACKAGES, and rpmdbUnlink. Referenced by _rpmtsAddRollbackElement(), checkPackageSet(), dbiFindMatches(), do_tsort(), ftsCacheUpdate(), handleInstInstalledFiles(), handleRmvdInstalledFiles(), IDTXload(), main(), markReplacedFiles(), rpmcliShowMatches(), rpmdb_length(), rpmdb_subscript(), rpmdbCheckSignals(), rpmdbFindByFile(), rpmdbFindFpList(), rpmdbRebuild(), rpmdbRemove(), rpmErase(), rpmfcFindRequiredPackages(), rpmgiFree(), rpmgiInitFilter(), rpmgiNext(), rpmInstall(), rpmmi_dealloc(), rpmmi_iternext(), rpmpsmStage(), rpmts_AddErase(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsFindPubkey(), rpmtsRun(), rpmtsSolve(), runImmedTriggers(), runTriggers(), and unsatisfiedDepend(). |
|
Return number of elements in rpm database iterator.
Definition at line 1718 of file rpmdb.c. References _dbiIndexSet::count, and _rpmdbMatchIterator::mi_set. Referenced by ftsCacheUpdate(), rpmdbFindFpList(), rpmfcFindRequiredPackages(), rpmInstall(), rpmmi_Count(), rpmts_AddErase(), and runImmedTriggers(). |
|
Definition at line 1714 of file rpmdb.c. References _rpmdbMatchIterator::mi_filenum. Referenced by rpmtsFindPubkey(). |
|
Return header join key for current position of rpm database iterator.
Definition at line 1710 of file rpmdb.c. References _rpmdbMatchIterator::mi_offset. Referenced by IDTXload(), markReplacedFiles(), rpmErase(), rpmgiNext(), rpmmi_Instance(), rpmpsmStage(), rpmts_AddErase(), rpmtsAddInstallElement(), and rpmtsFindPubkey(). |
|
Initialize database.
Definition at line 1121 of file rpmdb.c. References db, openDatabase(), RPMDB_FLAG_JUSTCHECK, rpmdbClose(), rpmdbOpenAll(), and rpmExpandNumeric(). Referenced by rpmtsInitDB(). |
|
Return database iterator.
Definition at line 2458 of file rpmdb.c. References _, _DBSWAP, _free(), __db_dbt::data, data, DB_SET, _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_txnid, dbiByteSwapped(), dbiCclose(), dbiCopen(), dbiFindByLabel(), dbiFreeIndexSet(), dbiGet(), dbiOpen(), dbt2set(), _rpmdbMatchIterator::mi_next, rpmdbCheckSignals(), rpmdbFindByFile(), RPMDBI_LABEL, RPMDBI_PACKAGES, rpmdbLink, RPMERR_DBGETINDEX, rpmError, RPMTAG_BASENAMES, RPMTAG_NAME, __db_dbt::size, tagName(), _dbswap::ui, xcalloc(), and xmalloc(). Referenced by dbiFindMatches(), do_tsort(), 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 2134 of file rpmdb.c. References _, _DBSWAP, _free(), _dbiIndexSet::count, data, rpmdb_s::db_bits, DB_DBT_MALLOC, rpmdb_s::db_nbits, DB_NEXT, DB_SET, _dbiIndex::dbi_txnid, dbiByteSwapped(), dbiCopen(), dbiGet(), dbiIndexRecordFileNumber(), dbiIndexRecordOffset(), dbiOpen(), headerToken_s::flags, headerCopyLoad(), HEADERFLAG_ALLOCATED, 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, RPMERR_BADHEADER, rpmError, RPMMESS_DEBUG, RPMMESS_ERROR, rpmMessage, RPMRC_FAIL, RPMRC_NOTFOUND, RPMRC_OK, RPMTAG_NAME, and _dbswap::ui. Referenced by _rpmtsAddRollbackElement(), checkPackageSet(), dbiFindMatches(), do_tsort(), handleInstInstalledFiles(), handleRmvdInstalledFiles(), IDTXload(), main(), markReplacedFiles(), rpmcliShowMatches(), rpmdb_length(), rpmdb_subscript(), rpmdbFindByFile(), rpmdbFindFpList(), rpmdbRebuild(), rpmdbRemove(), rpmErase(), rpmfcFindRequiredPackages(), rpmgiNext(), rpmInstall(), rpmmi_iternext(), rpmpsmStage(), rpmts_AddErase(), rpmtsAddInstallElement(), rpmtsFindPubkey(), rpmtsRun(), rpmtsSolve(), runImmedTriggers(), runTriggers(), and unsatisfiedDepend(). |
|
Open rpm database.
Definition at line 1113 of file rpmdb.c. References openDatabase(), and rpmExpandNumeric(). Referenced by do_tsort(), main(), rpmtsOpenDB(), and rpmtsOpenSDB(). |
|
Open all database indices.
Definition at line 798 of file rpmdb.c. References rpmdb_s::_dbi, rpmdb_s::db_flags, dbiOpen(), dbiTags, and dbiTagsMax. Referenced by rpmdbInit(), and rpmdbVerify(). |
|
Remove items from set of package instances to iterate.
Definition at line 2436 of file rpmdb.c. References dbiPruneSet(), and _rpmdbMatchIterator::mi_set. Referenced by checkPackageSet(), rpmtsAddInstallElement(), and unsatisfiedDepend(). |
|
Rebuild database indices from package headers.
Definition at line 3735 of file rpmdb.c. References _, _db_filter_dups, _free(), _rebuildinprogress, _RECNUM, rpmdb_s::db_api, rpmdb_s::db_filter_dups, errno, F_OK, headerCopy(), headerFree(), headerIsEntry(), headerNVR(), Mkdir(), name, openDatabase(), Rmdir(), RPMDB_FLAG_MINIMAL, rpmdbAdd(), rpmdbClose(), rpmdbFreeIterator(), RPMDBI_PACKAGES, rpmdbInitIterator(), 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 2600 of file rpmdb.c. References _, _DBSWAP, _free(), alloca(), blockSignals(), _dbiIndexSet::count, data, DB_KEYLAST, DB_NOTFOUND, DB_SET, DB_WRITECURSOR, _dbiIndex::dbi_no_dbsync, _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_txnid, dbiByteSwapped(), dbiCclose(), dbiCopen(), dbiDel(), dbiFreeIndexSet(), dbiGet(), dbiIndexNewItem(), dbiOpen(), dbiPruneSet(), dbiPut(), dbiSync(), dbiTags, dbiTagsMax, dbt2set(), headerAddEntry(), headerFree(), headerFreeData(), headerGetEntryMinMemory(), headerLink(), headerNVR(), nibble(), 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, rpmdbFreeIterator(), RPMDBI_ADDED, RPMDBI_AVAILABLE, RPMDBI_DEPENDS, RPMDBI_PACKAGES, RPMDBI_REMOVED, rpmdbInitIterator(), rpmdbNextIterator(), RPMERR_DBCORRUPT, RPMERR_DBGETINDEX, RPMERR_DBPUTINDEX, rpmError, RPMMESS_DEBUG, rpmMessage, RPMTAG_FILEMD5S, RPMTAG_PUBKEYS, RPMTAG_REMOVETID, set2dbt(), pgpDigParams_s::signid, tagName(), _dbswap::ui, and unblockSignals(). Referenced by rpmpsmStage(). |
|
Modify iterator to verify retrieved header blobs.
Definition at line 2119 of file rpmdb.c. References _rpmdbMatchIterator::mi_hdrchk, and _rpmdbMatchIterator::mi_ts. Referenced by rpmdbRebuild(), and rpmtsInitIterator(). |
|
Modify iterator to mark header for lazy write on release.
Definition at line 2109 of file rpmdb.c. References _rpmdbMatchIterator::mi_modified. Referenced by markReplacedFiles(). |
|
Add pattern to iterator selector.
Definition at line 1877 of file rpmdb.c. References _free(), miRE_s::cflags, miRE_s::eflags, miRE_s::fnflags, _rpmdbMatchIterator::mi_nre, _rpmdbMatchIterator::mi_re, mireCmp(), mireDup(), miRE_s::mode, miRE_s::notmatch, miRE_s::pattern, miRE_s::preg, RPMERR_REGCOMP, rpmError, rpmExpand(), RPMMIRE_DEFAULT, RPMMIRE_GLOB, RPMMIRE_REGEX, RPMMIRE_STRCMP, miRE_s::tag, xcalloc(), and xrealloc(). Referenced by dbiFindMatches(), IDTXload(), main(), rpmdbRebuild(), rpmgiInitFilter(), rpmmi_Pattern(), rpmpsmStage(), rpmtsInitIterator(), and rpmtsRun(). |
|
Prepare iterator for lazy writes.
Definition at line 2096 of file rpmdb.c. References DB_WRITECURSOR, and _rpmdbMatchIterator::mi_cflags. Referenced by markReplacedFiles(). |
|
Sync all database indices.
Definition at line 899 of file rpmdb.c. References rpmdb_s::_dbi, rpmdb_s::db_ndbi, and dbiSync(). Referenced by rpmtsRun(). |
|
Unreference a database instance.
|
|
Verify database components.
Definition at line 1142 of file rpmdb.c. References rpmdb_s::_dbi, db, rpmdb_s::db_ndbi, dbiVerify(), openDatabase(), 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(). |