#include "system.h"
#include <sys/file.h>
#include <signal.h>
#include <sys/signal.h>
#include <fnmatch.h>
#include <regex.h>
#include "rpmcli.h"
#include "rpmdb.h"
#include "fprint.h"
#include "misc.h"
#include "debug.h"
Go to the source code of this file.
Data Structures | |
| union | _dbswap |
| struct | _rpmdbMatchIterator |
| struct | miRE_s |
Defines | |
| #define | INLINE |
| #define | _DBI_FLAGS 0 |
| #define | _DBI_PERMS 0644 |
| #define | _DBI_MAJOR -1 |
| #define | DB1vec NULL |
| #define | DB2vec NULL |
| #define | DB3vec NULL |
| #define | _DBSWAP(_a) |
| #define | _DB_ROOT "/" |
| #define | _DB_HOME "%{_dbpath}" |
| #define | _DB_FLAGS 0 |
| #define | _DB_MODE 0 |
| #define | _DB_PERMS 0644 |
| #define | _DB_MAJOR -1 |
| #define | _DB_ERRPFX "rpmdb" |
| #define | _RECNUM rpmdbGetIteratorOffset(mi) |
Typedefs | |
| typedef miRE_s * | miRE |
Functions | |
| unsigned char | nibble (char c) |
| Convert hex to binary nibble. | |
| int | printable (const void *ptr, size_t len) |
| Check key for printable characters. | |
| int | dbiTagToDbix (int rpmtag) |
| Return dbi index used for rpm tag. | |
| void | dbiTagsInit (void) |
| Initialize database (index, tag) tuple from configuration. | |
| int | dbiSync (dbiIndex dbi, unsigned int flags) |
| int | dbiByteSwapped (dbiIndex dbi) |
| int | dbiCopen (dbiIndex dbi, void **dbcp, unsigned int flags) |
| int | dbiCclose (dbiIndex dbi, void *dbcursor, unsigned int flags) |
| int | dbiDel (dbiIndex dbi, void *dbcursor, const void *keyp, size_t keylen, unsigned int flags) |
| int | dbiGet (dbiIndex dbi, void *dbcursor, void **keypp, size_t *keylenp, void **datapp, size_t *datalenp, unsigned int flags) |
| int | dbiPut (dbiIndex dbi, void *dbcursor, const void *keyp, size_t keylen, const void *datap, size_t datalen, unsigned int flags) |
| int | dbiCount (dbiIndex dbi, void *dbcursor, unsigned int *countp, unsigned int flags) |
| int | dbiVerify (dbiIndex dbi, unsigned int flags) |
| int | dbiClose (dbiIndex dbi, unsigned int flags) |
| dbiIndex | dbiOpen (rpmdb db, int rpmtag, unsigned int flags) |
| dbiIndexItem | dbiIndexNewItem (unsigned int hdrNum, unsigned int tagNum) |
| Create and initialize item for index database set. | |
| int | dbiSearch (dbiIndex dbi, void *dbcursor, const char *keyp, size_t keylen, dbiIndexSet *setp) |
| Return items that match criteria. | |
| int | dbiUpdateIndex (dbiIndex dbi, void *dbcursor, const void *keyp, size_t keylen, dbiIndexSet set) |
| Change/delete items that match criteria. | |
| int | hdrNumCmp (const void *one, const void *two) |
| int | dbiAppendSet (dbiIndexSet set, const void *recs, int nrecs, size_t recsize, int sortset) |
| Append element(s) to set of index database items. | |
| int | dbiPruneSet (dbiIndexSet set, void *recs, int nrecs, size_t recsize, int sorted) |
| Remove element(s) from set of index database items. | |
| unsigned int | dbiIndexSetCount (dbiIndexSet set) |
| unsigned int | dbiIndexRecordOffset (dbiIndexSet set, int recno) |
| unsigned int | dbiIndexRecordFileNumber (dbiIndexSet set, int recno) |
| dbiIndexSet | dbiFreeIndexSet (dbiIndexSet set) |
| int | blockSignals (rpmdb db, sigset_t *oldMask) |
| Disable all signals, returning previous signal mask. | |
| int | unblockSignals (rpmdb db, sigset_t *oldMask) |
| Restore signal mask. | |
| int | rpmdbOpenAll (rpmdb db) |
| int | rpmdbClose (rpmdb db) |
| int | rpmdbSync (rpmdb db) |
| rpmdb | newRpmdb (const char *root, const char *home, int mode, int perms, int flags) |
| int | openDatabase (const char *prefix, const char *dbpath, int _dbapi, rpmdb *dbp, int mode, int perms, int flags) |
| int | rpmdbOpen (const char *prefix, rpmdb *dbp, int mode, int perms) |
| int | rpmdbInit (const char *prefix, int perms) |
| int | rpmdbVerify (const char *prefix) |
| int | rpmdbFindByFile (rpmdb db, const char *filespec, dbiIndexSet *matches) |
| int | rpmdbCountPackages (rpmdb db, const char *name) |
| int | dbiFindMatches (dbiIndex dbi, void *dbcursor, const char *name, const char *version, const char *release, dbiIndexSet *matches) |
| Attempt partial matches on name[-version[-release]] strings. | |
| int | dbiFindByLabel (dbiIndex dbi, void *dbcursor, const char *arg, dbiIndexSet *matches) |
| Lookup by name, name-version, and finally by name-version-release. | |
| int | dbiUpdateRecord (dbiIndex dbi, void *dbcursor, int offset, Header h) |
| Rewrite a header in the database. | |
| rpmdbMatchIterator | rpmdbFreeIterator (rpmdbMatchIterator mi) |
| rpmdb | rpmdbGetIteratorRpmDB (rpmdbMatchIterator mi) |
| unsigned int | rpmdbGetIteratorOffset (rpmdbMatchIterator mi) |
| unsigned int | rpmdbGetIteratorFileNum (rpmdbMatchIterator mi) |
| int | rpmdbGetIteratorCount (rpmdbMatchIterator mi) |
| int | miregexec (miRE mire, const char *val) |
| Return pattern match. | |
| int | mireCmp (const void *a, const void *b) |
| Compare iterator selctors by rpm tag (qsort/bsearch). | |
| char * | mireDup (rpmTag tag, rpmMireMode *modep, const char *pattern) |
| Copy pattern, escaping for appropriate mode. | |
| int | rpmdbSetIteratorRE (rpmdbMatchIterator mi, rpmTag tag, rpmMireMode mode, const char *pattern) |
| int | mireSkip (const rpmdbMatchIterator mi) |
| Return iterator selector match. | |
| int | rpmdbSetIteratorRelease (rpmdbMatchIterator mi, const char *release) |
| int | rpmdbSetIteratorVersion (rpmdbMatchIterator mi, const char *version) |
| int | rpmdbSetIteratorRewrite (rpmdbMatchIterator mi, int rewrite) |
| int | rpmdbSetIteratorModified (rpmdbMatchIterator mi, int modified) |
| Header | XrpmdbNextIterator (rpmdbMatchIterator mi, const char *f, unsigned int l) |
| Header | rpmdbNextIterator (rpmdbMatchIterator mi) |
| void | rpmdbSortIterator (rpmdbMatchIterator mi) |
| int | rpmdbGrowIterator (rpmdbMatchIterator mi, const void *keyp, size_t keylen, int fpNum) |
| int | rpmdbPruneIterator (rpmdbMatchIterator mi, int *hdrNums, int nHdrNums, int sorted) |
| int | rpmdbAppendIterator (rpmdbMatchIterator mi, const int *hdrNums, int nHdrNums) |
| rpmdbMatchIterator | rpmdbInitIterator (rpmdb db, int rpmtag, const void *keyp, size_t keylen) |
| int | removeIndexEntry (dbiIndex dbi, void *dbcursor, const void *keyp, size_t keylen, dbiIndexItem rec) |
| Remove entry from database index. | |
| int | rpmdbRemove (rpmdb db, int rid, unsigned int hdrNum) |
| int | addIndexEntry (dbiIndex dbi, void *dbcursor, const char *keyp, size_t keylen, dbiIndexItem rec) |
| Add entry to database index. | |
| int | rpmdbAdd (rpmdb db, int iid, Header h) |
| int | rpmdbFindFpList (rpmdb db, fingerPrint *fpList, dbiIndexSet *matchList, int numItems) |
| char * | db1basename (int rpmtag) |
| int | rpmioFileExists (const char *urlfn) |
| Check if file esists using stat(2). | |
| int | rpmdbRemoveDatabase (const char *prefix, const char *dbpath, int _dbapi) |
| int | rpmdbMoveDatabase (const char *prefix, const char *olddbpath, int _olddbapi, const char *newdbpath, int _newdbapi) |
| int | rpmdbRebuild (const char *prefix) |
Variables | |
| int | _debug = 0 |
| int | _noDirTokens |
| int | _rebuildinprogress = 0 |
| int | _db_filter_dups = 0 |
| int * | dbiTags = NULL |
| int | dbiTagsMax = 0 |
| _dbiVec * | mydbvecs [] |
| rpmdb_s | dbTemplate |
Definition in file rpmdb.c.
|
|
Definition at line 831 of file rpmdb.c. Referenced by newRpmdb(). |
|
|
|
|
|
Definition at line 825 of file rpmdb.c. Referenced by newRpmdb(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 824 of file rpmdb.c. Referenced by newRpmdb(). |
|
|
|
|
|
|
|
|
|
|
|
Value: { unsigned char _b, *_c = (_a).uc; \
_b = _c[3]; _c[3] = _c[0]; _c[0] = _b; \
_b = _c[2]; _c[2] = _c[1]; _c[1] = _b; \
}Definition at line 507 of file rpmdb.c. Referenced by dbiSearch(), and dbiUpdateIndex(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 46 of file rpmdb.c. Referenced by addIndexEntry(), dbiAppendSet(), dbiByteSwapped(), dbiCclose(), dbiClose(), dbiCopen(), dbiCount(), dbiDel(), dbiGet(), dbiIndexNewItem(), dbiPruneSet(), dbiPut(), dbiSync(), dbiVerify(), and removeIndexEntry(). |
|
|
|
|
||||||||||||||||||||||||
|
Add entry to database index.
Definition at line 2657 of file rpmdb.c. References DBC, _dbiIndex::dbi_permit_dups, dbiAppendSet(), dbiFreeIndexSet(), dbiSearch(), dbiUpdateIndex(), INLINE, and xcalloc(). Referenced by rpmdbAdd(). |
|
||||||||||||
|
Disable all signals, returning previous signal mask.
Definition at line 804 of file rpmdb.c. Referenced by dbiUpdateRecord(), rpmdbAdd(), and rpmdbRemove(). |
|
||||||||||||||||||||||||
|
Append element(s) to set of index database items.
Definition at line 710 of file rpmdb.c. References _dbiIndexSet::count, hdrNumCmp(), INLINE, _dbiIndexSet::recs, and xrealloc(). Referenced by addIndexEntry(), rpmdbAppendIterator(), rpmdbFindByFile(), and rpmdbFindFpList(). |
|
||||||||||||||||||||
|
Lookup by name, name-version, and finally by name-version-release. Both version and release can be patterns.
Definition at line 1441 of file rpmdb.c. References alloca(), DBC, dbiFindMatches(), dbiFreeIndexSet(), and stpcpy(). Referenced by rpmdbInitIterator(). |
|
||||||||||||||||||||||||||||
|
Attempt partial matches on name[-version[-release]] strings.
Definition at line 1348 of file rpmdb.c. References DBC, _dbiIndex::dbi_rpmdb, dbiFreeIndexSet(), dbiIndexRecordOffset(), dbiIndexSetCount(), dbiSearch(), headerFree(), headerLink(), rpmdbFreeIterator(), RPMDBI_PACKAGES, rpmdbInitIterator(), rpmdbNextIterator(), rpmdbSetIteratorRE(), RPMMIRE_DEFAULT, RPMTAG_RELEASE, and RPMTAG_VERSION. Referenced by dbiFindByLabel(). |
|
||||||||||||
|
Create and initialize item for index database set.
Definition at line 493 of file rpmdb.c. References _dbiIndexItem::hdrNum, INLINE, _dbiIndexItem::tagNum, and xcalloc(). Referenced by rpmdbAdd(), rpmdbFindByFile(), and rpmdbRemove(). |
|
||||||||||||||||||||||||
|
Remove element(s) from set of index database items.
Definition at line 751 of file rpmdb.c. References _dbiIndexSet::count, hdrNumCmp(), INLINE, and _dbiIndexSet::recs. Referenced by removeIndexEntry(), and rpmdbPruneIterator(). |
|
||||||||||||||||||||||||
|
Return items that match criteria.
Definition at line 522 of file rpmdb.c. References _, _DBSWAP, _dbiIndexSet::count, DBC, _dbiIndex::dbi_jlen, _dbiIndex::dbi_rpmtag, dbiByteSwapped(), dbiGet(), _dbiIndexItem::dbNum, _dbiIndexItem::fpNum, _dbiIndexItem::hdrNum, _dbiIndexSet::recs, RPMERR_DBGETINDEX, rpmError, tagName(), _dbiIndexItem::tagNum, _dbswap::ui, and xmalloc(). Referenced by addIndexEntry(), dbiFindMatches(), removeIndexEntry(), rpmdbCountPackages(), rpmdbFindByFile(), rpmdbGrowIterator(), and rpmdbInitIterator(). |
|
|
Initialize database (index, tag) tuple from configuration.
Definition at line 118 of file rpmdb.c. References _, _free(), dbiTags, dbiTagsMax, dbiTagToDbix(), RPMDBI_PACKAGES, rpmExpand(), tagValue(), xcalloc(), xisspace(), xrealloc(), and xstrdup(). Referenced by openDatabase(). |
|
|
Return dbi index used for rpm tag.
Definition at line 102 of file rpmdb.c. References dbiTags, and dbiTagsMax. Referenced by dbiOpen(), and dbiTagsInit(). |
|
||||||||||||||||||||||||
|
Change/delete items that match criteria.
Definition at line 612 of file rpmdb.c. References _, _DBSWAP, alloca(), _dbiIndexSet::count, DBC, _dbiIndex::dbi_jlen, _dbiIndex::dbi_rpmtag, dbiByteSwapped(), dbiDel(), dbiPut(), _dbiIndexItem::hdrNum, _dbiIndexSet::recs, RPMERR_DBPUTINDEX, rpmError, tagName(), _dbiIndexItem::tagNum, and _dbswap::ui. Referenced by addIndexEntry(), and removeIndexEntry(). |
|
||||||||||||||||||||
|
Rewrite a header in the database. Note: this is called from a markReplacedFiles iteration, and *must* preserve the "join key" (i.e. offset) for the header.
Definition at line 1531 of file rpmdb.c. References _free(), blockSignals(), DBC, _dbiIndex::dbi_rpmdb, dbiPut(), dbiSync(), expandFilelist(), HEADER_MAGIC_NO, headerSizeof(), headerUnload(), and unblockSignals(). Referenced by rpmdbAdd(), rpmdbFreeIterator(), and rpmdbNextIterator(). |
|
||||||||||||
|
Definition at line 694 of file rpmdb.c. Referenced by dbiAppendSet(), dbiPruneSet(), and rpmdbSortIterator(). |
|
||||||||||||
|
Compare iterator selctors by rpm tag (qsort/bsearch).
Definition at line 1719 of file rpmdb.c. References miRE_s::tag. Referenced by rpmdbSetIteratorRE(). |
|
||||||||||||||||
|
Copy pattern, escaping for appropriate mode.
Definition at line 1733 of file rpmdb.c. References RPMMIRE_DEFAULT, RPMMIRE_GLOB, RPMMIRE_REGEX, RPMMIRE_STRCMP, rpmMireMode, rpmTag, RPMTAG_BASENAMES, RPMTAG_DIRNAMES, xmalloc(), and xstrdup(). Referenced by rpmdbSetIteratorRE(). |
|
||||||||||||
|
Return pattern match.
Definition at line 1675 of file rpmdb.c. References miRE_s::eflags, miRE_s::fnflags, miRE_s::mode, miRE_s::pattern, miRE_s::preg, RPMERR_REGEXEC, rpmError, RPMMIRE_DEFAULT, RPMMIRE_GLOB, RPMMIRE_REGEX, and RPMMIRE_STRCMP. Referenced by mireSkip(). |
|
|
Return iterator selector match.
Definition at line 1932 of file rpmdb.c. References HFD_t, HGE_t, int_16, int_32, int_8, _rpmdbMatchIterator::mi_h, _rpmdbMatchIterator::mi_nre, _rpmdbMatchIterator::mi_re, miregexec(), miRE_s::notmatch, RPM_BIN_TYPE, RPM_CHAR_TYPE, RPM_I18NSTRING_TYPE, RPM_INT16_TYPE, RPM_INT32_TYPE, RPM_INT8_TYPE, RPM_NULL_TYPE, RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, rpmTagType, and miRE_s::tag. Referenced by rpmdbNextIterator(). |
|
||||||||||||||||||||||||
|
Definition at line 903 of file rpmdb.c. References _, _DB_ERRPFX, _db_filter_dups, _DB_HOME, _DB_ROOT, rpmdb_s::_dbi, _free(), rpmdb_s::db_errpfx, rpmdb_s::db_filter_dups, rpmdb_s::db_flags, rpmdb_s::db_home, rpmdb_s::db_mode, rpmdb_s::db_ndbi, rpmdb_s::db_perms, rpmdb_s::db_remove_env, rpmdb_s::db_root, dbiTagsMax, RPMERR_DBOPEN, rpmError, rpmExpand(), rpmExpandNumeric(), rpmGetPath(), and xcalloc(). Referenced by openDatabase(). |
|
|
Convert hex to binary nibble.
Definition at line 70 of file rpmdb.c. Referenced by rpmdbAdd(), rpmdbRemove(), and rpmQueryVerify(). |
|
||||||||||||||||||||||||||||||||
|
Definition at line 951 of file rpmdb.c. References _, alloca(), rpmdb_s::db_api, rpmdb_s::db_home, rpmdb_s::db_root, DBC, dbiCclose(), dbiCopen(), dbiGet(), dbiOpen(), dbiTags, dbiTagsInit(), dbiTagsMax, newRpmdb(), rpmCleanPath(), RPMDB_FLAG_JUSTCHECK, RPMDB_FLAG_MINIMAL, rpmdbClose(), RPMDBI_ADDED, RPMDBI_AVAILABLE, RPMDBI_DEPENDS, RPMDBI_PACKAGES, RPMDBI_REMOVED, RPMERR_OLDDB, rpmError, rpmExpandNumeric(), RPMTAG_BASENAMES, and RPMTAG_NAME. Referenced by rpmdbInit(), rpmdbOpen(), rpmdbRebuild(), and rpmdbVerify(). |
|
||||||||||||
|
Check key for printable characters.
|
|
||||||||||||||||||||||||
|
Remove entry from database index.
Definition at line 2394 of file rpmdb.c. References DBC, dbiFreeIndexSet(), dbiPruneSet(), dbiSearch(), dbiUpdateIndex(), and INLINE. Referenced by rpmdbRemove(). |
|
||||||||||||||||
|
||||||||||||||||
|
Append items to set of package instances to iterate.
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.
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.
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(). |
|
||||||||||||||||
|
Definition at line 1169 of file rpmdb.c. References _free(), alloca(), _dbiIndexSet::count, DBC, dbiAppendSet(), dbiCclose(), dbiCopen(), dbiFreeIndexSet(), dbiIndexNewItem(), dbiIndexRecordFileNumber(), dbiIndexRecordOffset(), dbiOpen(), dbiSearch(), FP_EQUAL, fpCacheCreate(), fpCacheFree(), fpLookup(), _dbiIndexItem::hdrNum, headerFree(), headerLink(), HFD_t, HGE_t, int_32, rpmdbFreeIterator(), RPMDBI_PACKAGES, rpmdbInitIterator(), rpmdbNextIterator(), RPMTAG_BASENAMES, RPMTAG_DIRINDEXES, RPMTAG_DIRNAMES, rpmTagType, _dbiIndexItem::tagNum, and xcalloc(). Referenced by rpmdbInitIterator(). |
|
||||||||||||||||||||
|
Find fingerprint matches in database.
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.
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.
Definition at line 1663 of file rpmdb.c. References _dbiIndexSet::count, and _rpmdbMatchIterator::mi_set. Referenced by rpmdbFindFpList(), rpmErase(), rpmInstall(), and rpmtransRemove(). |
|
|
Return join key for current position of rpm database iterator.
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.
Definition at line 1643 of file rpmdb.c. References _rpmdbMatchIterator::mi_db. Referenced by showMatches(). |
|
||||||||||||||||||||
|
Definition at line 2214 of file rpmdb.c. References _dbiIndexSet::count, DBC, dbiCclose(), dbiCopen(), dbiFreeIndexSet(), dbiOpen(), dbiSearch(), _dbiIndexItem::fpNum, _rpmdbMatchIterator::mi_db, _rpmdbMatchIterator::mi_rpmtag, _rpmdbMatchIterator::mi_set, _dbiIndexSet::recs, and xrealloc(). Referenced by rpmdbFindFpList(). |
|
||||||||||||
|
Initialize database.
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.
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(). |
|
||||||||||||||||||||||||
|
Definition at line 3237 of file rpmdb.c. References _, _free(), alloca(), db1basename(), dbiTags, dbiTagsMax, Rename(), rpmCleanPath(), RPMDBI_ADDED, RPMDBI_AVAILABLE, RPMDBI_DEPENDS, RPMDBI_REMOVED, rpmdbRemoveDatabase(), rpmioFileExists(), RPMMESS_DEBUG, rpmMessage, and tagName(). Referenced by rpmdbRebuild(). |
|
|
Return next package header from 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.
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.
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.
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.
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(). Referenced by main(). |
|
||||||||||||||||
|
Remove package header from rpm database and indices.
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(), pgpDig_s::pubkey, 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, pgpDigParams_s::signid, tagName(), and unblockSignals(). Referenced by psmStage(). |
|
||||||||||||||||
|
Definition at line 3173 of file rpmdb.c. References _free(), alloca(), db1basename(), dbiTags, dbiTagsMax, rpmCleanPath(), rpmioFileExists(), and tagName(). Referenced by rpmdbMoveDatabase(), and rpmdbRebuild(). |
|
||||||||||||
|
Modify iterator to mark header for lazy write.
Definition at line 2050 of file rpmdb.c. References _rpmdbMatchIterator::mi_modified. Referenced by markReplacedFiles(). |
|
||||||||||||||||||||
|
Add pattern to iterator selector.
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.
Definition at line 2030 of file rpmdb.c. References rpmdbSetIteratorRE(), RPMMIRE_DEFAULT, and RPMTAG_RELEASE. |
|
||||||||||||
|
Prepare iterator for lazy writes.
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.
Definition at line 2034 of file rpmdb.c. References rpmdbSetIteratorRE(), RPMMIRE_DEFAULT, and RPMTAG_VERSION. |
|
|
Definition at line 2195 of file rpmdb.c. References _dbiIndexSet::count, hdrNumCmp(), mergesort(), _rpmdbMatchIterator::mi_set, _rpmdbMatchIterator::mi_sorted, and _dbiIndexSet::recs. Referenced by rpmdbFindFpList(). |
|
|
Sync all database indices.
Definition at line 885 of file rpmdb.c. References rpmdb_s::_dbi, rpmdb_s::db_ndbi, and dbiSync(). Referenced by rpmRunTransactions(). |
|
|
Verify database components.
Definition at line 1133 of file rpmdb.c. References rpmdb_s::_dbi, rpmdb_s::db_ndbi, dbiVerify(), openDatabase(), rpmdbClose(), rpmdbOpenAll(), and rpmExpandNumeric(). Referenced by main(). |
|
|
Check if file esists using stat(2).
Definition at line 3140 of file rpmdb.c. References Stat(), URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), and urltype. Referenced by rpmdbMoveDatabase(), and rpmdbRemoveDatabase(). |
|
||||||||||||
|
Restore signal mask.
Definition at line 817 of file rpmdb.c. Referenced by dbiUpdateRecord(), rpmdbAdd(), and rpmdbRemove(). |
|
||||||||||||||||
|
Definition at line 2059 of file rpmdb.c. References rpmdbNextIterator(). |
|
|
Definition at line 54 of file rpmdb.c. Referenced by newRpmdb(), and rpmdbRebuild(). |
|
|
Definition at line 45 of file rpmdb.c. Referenced by dbiCclose(), dbiClose(), dbiCopen(), dbiDel(), dbiGet(), dbiPut(), dbiSync(), and dbiVerify(). |
|
|
Should version 3 packages be produced? |
|
|
Definition at line 52 of file rpmdb.c. Referenced by dbiOpen(), and rpmdbRebuild(). |
|
|
Tags for which rpmdb indices will be built. Definition at line 61 of file rpmdb.c. Referenced by dbiTagsInit(), dbiTagToDbix(), openDatabase(), rpmdbAdd(), rpmdbMoveDatabase(), rpmdbOpenAll(), rpmdbRemove(), and rpmdbRemoveDatabase(). |
|
|
Definition at line 63 of file rpmdb.c. Referenced by dbiOpen(), dbiTagsInit(), dbiTagToDbix(), newRpmdb(), openDatabase(), rpmdbAdd(), rpmdbMoveDatabase(), rpmdbOpenAll(), rpmdbRemove(), and rpmdbRemoveDatabase(). |
|
|
Initial value: {
"/" , "%{_dbpath}" , 0 , 0 , 0644 ,
-1 , "rpmdb"
} |
|
|
Initial value: {
NULL , NULL , NULL , NULL , NULL
} |
1.2.18