RPMDB. -
file dbconfig.c
file rpmdb.c
file rpmdb.h
Access RPM indices using Berkeley DB interface(s).
typedef rpmdb_s * rpmdb
typedef _dbiIndexSet * dbiIndexSet
typedef _rpmdbMatchIterator * rpmdbMatchIterator
typedef enum rpmMireMode_e rpmMireMode
Tag value pattern match mode.
enum rpmMireMode_e { RPMMIRE_DEFAULT = 0, RPMMIRE_STRCMP = 1, RPMMIRE_REGEX = 2, RPMMIRE_GLOB = 3 }
Tag value pattern match mode.
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)
rpmdbMatchIterator rpmdbFreeIterator (rpmdbMatchIterator mi)
rpmdb rpmdbGetIteratorRpmDB (rpmdbMatchIterator mi)
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 rpmdbSetIteratorVersion (rpmdbMatchIterator mi, const char *version)
int rpmdbSetIteratorRelease (rpmdbMatchIterator mi, const char *release)
int rpmdbSetIteratorRewrite (rpmdbMatchIterator mi, int rewrite)
int rpmdbSetIteratorModified (rpmdbMatchIterator mi, int modified)
Header rpmdbNextIterator (rpmdbMatchIterator mi)
rpmdbMatchIterator rpmdbInitIterator (rpmdb db, int rpmtag, const void *keyp, size_t keylen)
int rpmdbAdd (rpmdb db, int iid, Header h)
int rpmdbRemove (rpmdb db, int rid, unsigned int hdrNum)
int rpmdbRebuild (const char *prefix)
Header XrpmdbNextIterator (rpmdbMatchIterator mi, const char *f, unsigned int l)
int * dbiTags
int dbiTagsMax
enum rpmdbFlags { RPMDB_FLAG_JUSTCHECK = (1 << 0), RPMDB_FLAG_MINIMAL = (1 << 1), RPMDB_FLAG_CHROOT = (1 << 2) }
int rpmdbFindFpList (rpmdb db, fingerPrint *fpList, dbiIndexSet *matchList, int numItems)
unsigned int rpmdbGetIteratorFileNum (rpmdbMatchIterator mi)
Definition at line 677 of file rpmlib.h.
Definition at line 673 of file rpmlib.h.
Definition at line 757 of file rpmlib.h.
Tag value pattern match mode.
Referenced by mireDup(), and rpmdbSetIteratorRE().
Enumeration values:
Definition at line 338 of file rpmdb.h.
Tag value pattern match mode.
Enumeration values:
Definition at line 821 of file rpmlib.h.
Add package header to rpm database and indices.
Parameters:
Returns: 0 on success
Definition at line 2691 of file rpmdb.c.
References _, _free(), addIndexEntry(), blockSignals(), DBC, _dbiIndex::dbi_no_dbsync, _dbiIndex::dbi_rpmtag, DBI_WRITECURSOR, dbiCclose(), dbiCopen(), dbiGet(), dbiIndexNewItem(), dbiOpen(), dbiPut(), dbiSync(), dbiTags, dbiTagsMax, dbiUpdateRecord(), expandFilelist(), HEADER_MAGIC_NO, headerAddEntry(), headerIsEntry(), headerNVR(), headerRemoveEntry(), headerSizeof(), HFD_t, HGE_t, int_32, isInstallPreReq, nibble(), pgpNewDig(), pgpPrtPkts(), 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, RPMDBI_ADDED, RPMDBI_AVAILABLE, RPMDBI_DEPENDS, RPMDBI_PACKAGES, RPMDBI_REMOVED, RPMERR_DBCORRUPT, rpmError, RPMMESS_DEBUG, rpmMessage, RPMTAG_BASENAMES, RPMTAG_FILEMD5S, RPMTAG_GROUP, RPMTAG_INSTALLTID, RPMTAG_PUBKEYS, RPMTAG_REMOVETID, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIRENAME, RPMTAG_TRIGGERNAME, rpmTagType, tagName(), _dbiIndexItem::tagNum, and unblockSignals().
Referenced by psmStage(), and rpmdbRebuild().
Append items to set of package instances to iterate.
Parameters:
Returns: 0 on success, 1 on failure (bad args)
Definition at line 2272 of file rpmdb.c.
References dbiAppendSet(), _rpmdbMatchIterator::mi_set, and xcalloc().
Referenced by markReplacedFiles(), rpmdepCheck(), and rpmRunTransactions().
Close all database indices and free rpmdb.
Parameters:
Returns: 0 on success
Definition at line 858 of file rpmdb.c.
References rpmdb_s::_dbi, _free(), rpmdb_s::db_errpfx, rpmdb_s::db_home, rpmdb_s::db_ndbi, rpmdb_s::db_root, and dbiClose().
Referenced by checkSpec(), main(), openDatabase(), rpmdbInit(), rpmdbRebuild(), rpmdbVerify(), rpmErase(), rpmInstall(), rpmQuery(), rpmRollback(), rpmVerify(), and ugFindUpgradePackages().
Return number of instances of package in rpm database.
Parameters:
Returns: number of instances
Definition at line 1294 of file rpmdb.c.
References _, DBC, dbiCclose(), dbiCopen(), dbiFreeIndexSet(), dbiIndexSetCount(), dbiOpen(), dbiSearch(), RPMERR_DBCORRUPT, rpmError, and RPMTAG_NAME.
Referenced by findPackagesWithObsoletes(), handleOneTrigger(), psmStage(), and runTriggers().
Find fingerprint matches in database.
Parameters:
Return values:
Parameters:
Returns: 0 always
Definition at line 3015 of file rpmdb.c.
References _free(), _dbiIndexSet::count, dbiAppendSet(), FP_EQUAL, fpCacheCreate(), fpCacheFree(), fpLookupList(), _dbiIndexItem::fpNum, _dbiIndexItem::hdrNum, HFD_t, HGE_t, int_32, _rpmdbMatchIterator::mi_set, _rpmdbMatchIterator::mi_setx, _dbiIndexSet::recs, rpmdbFreeIterator(), rpmdbGetIteratorCount(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbNextIterator(), rpmdbSortIterator(), RPMTAG_BASENAMES, RPMTAG_DIRINDEXES, RPMTAG_DIRNAMES, rpmTagType, _dbiIndexItem::tagNum, and xcalloc().
Referenced by rpmRunTransactions().
Destroy rpm database iterator.
Parameters:
Returns: NULL always
Definition at line 1593 of file rpmdb.c.
References _free(), DBI_ITERATOR, _dbiIndex::dbi_rmw, dbiCclose(), dbiFreeIndexSet(), dbiOpen(), dbiUpdateRecord(), headerFree(), _rpmdbMatchIterator::mi_db, _rpmdbMatchIterator::mi_dbc, _rpmdbMatchIterator::mi_h, _rpmdbMatchIterator::mi_keyp, _rpmdbMatchIterator::mi_modified, _rpmdbMatchIterator::mi_nre, _rpmdbMatchIterator::mi_prevoffset, _rpmdbMatchIterator::mi_re, _rpmdbMatchIterator::mi_release, _rpmdbMatchIterator::mi_set, _rpmdbMatchIterator::mi_version, miRE_s::pattern, miRE_s::preg, and RPMDBI_PACKAGES.
Referenced by addLostFiles(), checkPackageSet(), dbiFindMatches(), findUpgradePackages(), handleInstInstalledFiles(), handleRmvdInstalledFiles(), IDTXload(), main(), markReplacedFiles(), psmStage(), rpmdbFindByFile(), rpmdbFindFpList(), rpmdbRebuild(), rpmdbRemove(), rpmdepCheck(), rpmErase(), rpmInstall(), rpmQueryVerify(), rpmRunTransactions(), rpmtransAddPackage(), rpmtransRemove(), runImmedTriggers(), runTriggers(), showMatches(), unmarkPackagesAlreadyInstalled(), and unsatisfiedDepend().
Return number of elements in rpm database iterator.
Parameters:
Returns: number of elements
Definition at line 1663 of file rpmdb.c.
References _dbiIndexSet::count, and _rpmdbMatchIterator::mi_set.
Referenced by rpmdbFindFpList(), rpmErase(), rpmInstall(), and rpmtransRemove().
Definition at line 1657 of file rpmdb.c.
References _rpmdbMatchIterator::mi_filenum.
Return join key for current position of rpm database iterator.
Parameters:
Returns: current join key
Definition at line 1651 of file rpmdb.c.
References _rpmdbMatchIterator::mi_offset.
Referenced by IDTXload(), markReplacedFiles(), psmStage(), rpmErase(), rpmtransAddPackage(), and rpmtransRemove().
Return rpm database used by iterator.
Parameters:
Returns: rpm database handle
Definition at line 1643 of file rpmdb.c.
References _rpmdbMatchIterator::mi_db.
Initialize database.
Parameters:
Returns: 0 on success
Definition at line 1112 of file rpmdb.c.
References openDatabase(), RPMDB_FLAG_JUSTCHECK, rpmdbClose(), rpmdbOpenAll(), and rpmExpandNumeric().
Referenced by main(), and rpmInitDB().
Return database iterator.
Parameters:
Returns: NULL on failure
Definition at line 2283 of file rpmdb.c.
References DBC, _dbiIndex::dbi_lastoffset, _dbiIndex::dbi_rmw, dbiCclose(), dbiCopen(), dbiFindByLabel(), dbiFreeIndexSet(), dbiOpen(), dbiSearch(), _rpmdbMatchIterator::mi_cflags, _rpmdbMatchIterator::mi_db, _rpmdbMatchIterator::mi_dbc, _rpmdbMatchIterator::mi_dbnum, _rpmdbMatchIterator::mi_filenum, _rpmdbMatchIterator::mi_fpnum, _rpmdbMatchIterator::mi_h, _rpmdbMatchIterator::mi_keylen, _rpmdbMatchIterator::mi_keyp, _rpmdbMatchIterator::mi_modified, _rpmdbMatchIterator::mi_ndups, _rpmdbMatchIterator::mi_nre, _rpmdbMatchIterator::mi_offset, _rpmdbMatchIterator::mi_prevoffset, _rpmdbMatchIterator::mi_re, _rpmdbMatchIterator::mi_release, _rpmdbMatchIterator::mi_rpmtag, _rpmdbMatchIterator::mi_set, _rpmdbMatchIterator::mi_setx, _rpmdbMatchIterator::mi_sorted, _rpmdbMatchIterator::mi_version, rpmdbFindByFile(), RPMDBI_LABEL, RPMDBI_PACKAGES, RPMTAG_BASENAMES, RPMTAG_NAME, tagName(), xcalloc(), and xmalloc().
Referenced by addLostFiles(), checkDependentConflicts(), checkDependentPackages(), dbiFindMatches(), findUpgradePackages(), handleInstInstalledFiles(), handleRmvdInstalledFiles(), IDTXload(), main(), markReplacedFiles(), psmStage(), rpmdbFindByFile(), rpmdbFindFpList(), rpmdbRebuild(), rpmdbRemove(), rpmdepCheck(), rpmErase(), rpmInstall(), rpmQueryVerify(), rpmRunTransactions(), rpmtransAddPackage(), rpmtransRemove(), runImmedTriggers(), runTriggers(), unmarkPackagesAlreadyInstalled(), and unsatisfiedDepend().
Return next package header from iteration.
Parameters:
Returns: NULL on end of iteration.
Definition at line 2065 of file rpmdb.c.
References _, _free(), _dbiIndexSet::count, _dbiIndex::dbi_api, DBI_ITERATOR, _dbiIndex::dbi_lastoffset, _dbiIndex::dbi_rpmtag, dbiCopen(), dbiGet(), dbiIndexRecordFileNumber(), dbiIndexRecordOffset(), dbiOpen(), dbiUpdateRecord(), headerCopyLoad(), headerFree(), headerIsEntry(), headerNVR(), _rpmdbMatchIterator::mi_cflags, _rpmdbMatchIterator::mi_db, _rpmdbMatchIterator::mi_dbc, _rpmdbMatchIterator::mi_filenum, _rpmdbMatchIterator::mi_h, _rpmdbMatchIterator::mi_keylen, _rpmdbMatchIterator::mi_keyp, _rpmdbMatchIterator::mi_modified, _rpmdbMatchIterator::mi_offset, _rpmdbMatchIterator::mi_prevoffset, _rpmdbMatchIterator::mi_set, _rpmdbMatchIterator::mi_setx, mireSkip(), RPMDBI_PACKAGES, RPMERR_BADHEADER, RPMERR_INTERNAL, rpmError, RPMMESS_DEBUG, rpmMessage, and RPMTAG_NAME.
Referenced by addLostFiles(), checkPackageSet(), dbiFindMatches(), findUpgradePackages(), handleInstInstalledFiles(), handleRmvdInstalledFiles(), IDTXload(), main(), markReplacedFiles(), psmStage(), rpmdbFindByFile(), rpmdbFindFpList(), rpmdbRebuild(), rpmdbRemove(), rpmdepCheck(), rpmErase(), rpmInstall(), rpmRunTransactions(), rpmtransAddPackage(), rpmtransRemove(), runImmedTriggers(), runTriggers(), showMatches(), unmarkPackagesAlreadyInstalled(), unsatisfiedDepend(), and XrpmdbNextIterator().
Open rpm database.
Parameters:
Return values:
Parameters:
Returns: 0 on success
Definition at line 1104 of file rpmdb.c.
References openDatabase(), and rpmExpandNumeric().
Referenced by checkSpec(), main(), rpmErase(), rpmInstall(), rpmQuery(), rpmRollback(), rpmVerify(), and ugFindUpgradePackages().
Open all database indices.
Parameters:
Returns: 0 on success
Definition at line 841 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.
Note: Sorted hdrNums are always passed in rpmlib.
Parameters:
Returns: 0 on success, 1 on failure (bad args)
Definition at line 2261 of file rpmdb.c.
References dbiPruneSet(), and _rpmdbMatchIterator::mi_set.
Referenced by checkPackageSet(), rpmtransAddPackage(), and unsatisfiedDepend().
Rebuild database indices from package headers.
Parameters:
Returns: 0 on success
Definition at line 3369 of file rpmdb.c.
References _, _db_filter_dups, _free(), _rebuildinprogress, rpmdb_s::db_api, rpmdb_s::db_filter_dups, rpmdb_s::db_remove_env, errno, F_OK, headerCopy(), headerFree(), headerIsEntry(), headerNVR(), lchown, Mkdir(), openDatabase(), Rmdir(), RPMDB_FLAG_MINIMAL, rpmdbAdd(), rpmdbClose(), rpmdbFreeIterator(), RPMDBI_PACKAGES, rpmdbInitIterator(), rpmdbMoveDatabase(), rpmdbNextIterator(), rpmdbRemoveDatabase(), rpmdbSetIteratorRE(), rpmDefineMacro(), RPMERR_INTERNAL, RPMERR_MKDIR, rpmError, rpmExpandNumeric(), rpmGetPath(), RPMMESS_DEBUG, RPMMESS_ERROR, RPMMESS_NORMAL, RPMMESS_VERBOSE, rpmMessage, RPMMIRE_DEFAULT, RPMTAG_BUILDTIME, RPMTAG_HEADERIMAGE, RPMTAG_NAME, RPMTAG_RELEASE, RPMTAG_VERSION, stpcpy(), and xmalloc().
Remove package header from rpm database and indices.
Parameters:
Returns: 0 on success
Definition at line 2423 of file rpmdb.c.
References _, _free(), blockSignals(), DBC, _dbiIndex::dbi_no_dbsync, _dbiIndex::dbi_rpmtag, DBI_WRITECURSOR, dbiCclose(), dbiCopen(), dbiDel(), dbiIndexNewItem(), dbiOpen(), dbiSync(), dbiTags, dbiTagsMax, headerAddEntry(), headerFree(), headerLink(), headerNVR(), HFD_t, HGE_t, int_32, nibble(), pgpNewDig(), pgpPrtPkts(), removeIndexEntry(), 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, rpmError, RPMMESS_DEBUG, rpmMessage, RPMTAG_FILEMD5S, RPMTAG_PUBKEYS, RPMTAG_REMOVETID, rpmTagType, tagName(), and unblockSignals().
Modify iterator to mark header for lazy write.
Parameters:
Returns: previous value
Definition at line 2050 of file rpmdb.c.
References _rpmdbMatchIterator::mi_modified.
Referenced by markReplacedFiles().
Add pattern to iterator selector.
Parameters:
Returns: 0 on success
Definition at line 1820 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, rpmMireMode, rpmTag, miRE_s::tag, xcalloc(), and xrealloc().
Referenced by dbiFindMatches(), psmStage(), rpmdbRebuild(), rpmdbSetIteratorRelease(), rpmdbSetIteratorVersion(), rpmQueryVerify(), and rpmRunTransactions().
Modify iterator to filter out headers that do not match release.
Deprecated: Use rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_DEFAULT, release) instead.
Todo: Eliminate from API.
Parameters:
Returns: 0 on success
Definition at line 2030 of file rpmdb.c.
References rpmdbSetIteratorRE(), RPMMIRE_DEFAULT, and RPMTAG_RELEASE.
Prepare iterator for lazy writes.
Note: Must be called before rpmdbNextIterator() in CDB model database.
Parameters:
Returns: previous value
Definition at line 2038 of file rpmdb.c.
References DBI_WRITECURSOR, and _rpmdbMatchIterator::mi_cflags.
Referenced by markReplacedFiles().
Modify iterator to filter out headers that do not match version.
Deprecated: Use rpmdbSetIteratorRE(mi, RPMTAG_VERSION, RPMMIRE_DEFAULT, version) instead.
Todo: Eliminate from API.
Parameters:
Returns: 0 on success
Definition at line 2034 of file rpmdb.c.
References rpmdbSetIteratorRE(), RPMMIRE_DEFAULT, and RPMTAG_VERSION.
Sync all database indices.
Parameters:
Returns: 0 on success
Definition at line 885 of file rpmdb.c.
References rpmdb_s::_dbi, rpmdb_s::db_ndbi, and dbiSync().
Referenced by rpmRunTransactions().
Verify database components.
Parameters:
Returns: 0 on success
Definition at line 1133 of file rpmdb.c.
References rpmdb_s::_dbi, rpmdb_s::db_ndbi, dbiVerify(), openDatabase(), rpmdbClose(), rpmdbOpenAll(), and rpmExpandNumeric().
Todo:
Remove debugging entry from the ABI.
Definition at line 2059 of file rpmdb.c.
References rpmdbNextIterator().
Tags for which rpmdb indices will be built.
Definition at line 683 of file rpmlib.h.
Referenced by dbiTagsInit(), dbiTagToDbix(), openDatabase(), rpmdbAdd(), rpmdbMoveDatabase(), rpmdbOpenAll(), rpmdbRemove(), and rpmdbRemoveDatabase().
Definition at line 685 of file rpmlib.h.
Referenced by dbiOpen(), dbiTagsInit(), dbiTagToDbix(), newRpmdb(), openDatabase(), rpmdbAdd(), rpmdbMoveDatabase(), rpmdbOpenAll(), rpmdbRemove(), and rpmdbRemoveDatabase().
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |