rpm
4.5
|
#include "system.h"
#include <sys/file.h>
#include <rpmio.h>
#include <rpmpgp.h>
#include <rpmurl.h>
#include <rpmmacro.h>
#include <rpmsq.h>
#include <rpmevr.h>
#include "rpmdb.h"
#include "fprint.h"
#include "legacy.h"
#include "header_internal.h"
#include "debug.h"
Go to the source code of this file.
Data Structures | |
struct | pbm_set |
union | _dbswap |
struct | _rpmdbMatchIterator |
Macros | |
#define | _USE_COPY_LOAD /* XXX don't use DB_DBT_MALLOC (yet) */ |
#define | _RPMEVR_INTERNAL /* XXX isInstallPrereq */ |
#define | _RPMDB_INTERNAL |
#define | _MIRE_INTERNAL |
#define | _DB_TAGGED_FILE_INDICES 1 |
#define | _DBI_FLAGS 0 |
#define | _DBI_PERMS 0644 |
#define | _DBI_MAJOR -1 |
#define | __PBM_NBITS (8 * sizeof (__pbm_bits)) |
#define | __PBM_IX(d) ((d) / __PBM_NBITS) |
#define | __PBM_MASK(d) ((__pbm_bits) 1 << (((unsigned)(d)) % __PBM_NBITS)) |
#define | __PBM_BITS(set) ((set)->bits) |
#define | PBM_FREE(s) _free(s); |
#define | PBM_SET(d, s) (__PBM_BITS (s)[__PBM_IX (d)] |= __PBM_MASK (d)) |
#define | PBM_CLR(d, s) (__PBM_BITS (s)[__PBM_IX (d)] &= ~__PBM_MASK (d)) |
#define | PBM_ISSET(d, s) ((__PBM_BITS (s)[__PBM_IX (d)] & __PBM_MASK (d)) != 0) |
#define | PBM_ALLOC(d) xcalloc(__PBM_IX (d) + 1, sizeof(__pbm_bits)) |
#define | DB1vec NULL |
#define | DB2vec NULL |
#define | DB3vec NULL |
#define | SQLITEvec 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 | _VARLIBRPM "/var/lib/rpm" |
#define | _RECNUM rpmdbGetIteratorOffset(mi) |
Typedefs | |
typedef unsigned int | __pbm_bits |
Functions | |
static pbm_set * | PBM_REALLOC (pbm_set **sp, int *odp, int nd) |
Reallocate a bit map. More... | |
static unsigned char | nibble (char c) |
Convert hex to binary nibble. More... | |
static int | dbiTagToDbix (rpmdb db, int rpmtag) |
Return dbi index used for rpm tag. More... | |
static void | dbiTagsInit (int **dbiTagsP, int *dbiTagsMaxP) |
Initialize database (index, tag) tuple from configuration. More... | |
static const char * | mapTagName (int value) |
Return (possibly renamed) tagName. More... | |
dbiIndex | dbiOpen (rpmdb db, rpmTag rpmtag, unsigned int flags) |
static dbiIndexItem | dbiIndexNewItem (unsigned int hdrNum, unsigned int tagNum) |
Create and initialize item for index database set. More... | |
static int | dbt2set (dbiIndex dbi, DBT *data, dbiIndexSet *setp) |
Convert retrieved data to index set. More... | |
static int | set2dbt (dbiIndex dbi, DBT *data, dbiIndexSet set) |
Convert index set to database representation. More... | |
static int | hdrNumCmp (const void *one, const void *two) |
static int | dbiAppendSet (dbiIndexSet set, const void *recs, int nrecs, size_t recsize, int sortset) |
Append element(s) to set of index database items. More... | |
static int | dbiPruneSet (dbiIndexSet set, void *recs, int nrecs, size_t recsize, int sorted) |
Remove element(s) from set of index database items. More... | |
unsigned int | dbiIndexSetCount (dbiIndexSet set) |
unsigned int | dbiIndexRecordOffset (dbiIndexSet set, int recno) |
unsigned int | dbiIndexRecordFileNumber (dbiIndexSet set, int recno) |
dbiIndexSet | dbiFreeIndexSet (dbiIndexSet set) |
int | rpmdbCheckTerminate (int terminate) |
Check rpmdb signal handler for trapped signal and/or requested exit. More... | |
int | rpmdbCheckSignals (void) |
Check for and exit on termination signals. More... | |
static int | blockSignals (rpmdb db, sigset_t *oldMask) |
Block all signals, returning previous signal mask. More... | |
static int | unblockSignals (rpmdb db, sigset_t *oldMask) |
Restore signal mask. More... | |
static const char * | queryHeader (Header h, const char *qfmt) |
Return header query string. More... | |
static int | rpmdbExportInfo (rpmdb db, Header h, int adding) |
Write added/removed header info. More... | |
int | rpmdbOpenAll (rpmdb db) |
Open all database indices. More... | |
int | rpmdbBlockDBI (rpmdb db, int rpmtag) |
Block access to a single database index. More... | |
int | rpmdbCloseDBI (rpmdb db, int rpmtag) |
Close a single database index. More... | |
int | rpmdbClose (rpmdb db) |
Close all database indices and free rpmdb. More... | |
int | rpmdbSync (rpmdb db) |
Sync all database indices. More... | |
static const char * | rpmdbURIPath (const char *uri) |
Return macro expanded absolute path to rpmdb. More... | |
rpmdb | rpmdbNew (const char *root, const char *home, int mode, int perms, int flags) |
int | rpmdbOpenDatabase (const char *prefix, const char *dbpath, int _dbapi, rpmdb *dbp, int mode, int perms, int flags) |
rpmdb | XrpmdbUnlink (rpmdb db, const char *msg, const char *fn, unsigned ln) |
rpmdb | XrpmdbLink (rpmdb db, const char *msg, const char *fn, unsigned ln) |
int | rpmdbOpen (const char *prefix, rpmdb *dbp, int mode, int perms) |
Open rpm database. More... | |
int | rpmdbInit (const char *prefix, int perms) |
Initialize database. More... | |
int | rpmdbVerifyAllDBI (rpmdb db) |
Verify all database components. More... | |
int | rpmdbVerify (const char *prefix) |
Open and verify all database components. More... | |
static unsigned | taghash (const char *s) |
Return a tagnum with hash on the (directory) path in upper 16 bits. More... | |
static int | rpmdbFindByFile (rpmdb db, const char *filespec, DBT *key, DBT *data, dbiIndexSet *matches) |
Find file matches in database. More... | |
int | rpmdbCount (rpmdb db, rpmTag tag, const void *keyp, size_t keylen) |
Return number of instances of key in a tag index. More... | |
int | rpmdbCountPackages (rpmdb db, const char *name) |
Return number of instances of package in Name index. More... | |
static rpmRC | dbiFindMatches (dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *data, const char *name, const char *version, const char *release, dbiIndexSet *matches) |
Attempt partial matches on name[-version[-release]] strings. More... | |
static rpmRC | dbiFindByLabel (dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *data, const char *arg, dbiIndexSet *matches) |
Lookup by name, name-version, and finally by name-version-release. More... | |
void * | dbiStatsAccumulator (dbiIndex dbi, int opx) |
static int | miFreeHeader (rpmdbMatchIterator mi, dbiIndex dbi) |
Rewrite a header into packages (if necessary) and free the header. More... | |
rpmdbMatchIterator | rpmdbFreeIterator (rpmdbMatchIterator mi) |
Destroy rpm database iterator. More... | |
unsigned int | rpmdbGetIteratorOffset (rpmdbMatchIterator mi) |
Return header join key for current position of rpm database iterator. More... | |
unsigned int | rpmdbGetIteratorFileNum (rpmdbMatchIterator mi) |
int | rpmdbGetIteratorCount (rpmdbMatchIterator mi) |
Return number of elements in rpm database iterator. More... | |
static int | mireCmp (const void *a, const void *b) |
Compare iterator selectors by rpm tag (qsort/bsearch). More... | |
static char * | mireDup (rpmTag tag, rpmMireMode *modep, const char *pattern) |
Copy pattern, escaping for appropriate mode. More... | |
int | rpmdbSetIteratorRE (rpmdbMatchIterator mi, rpmTag tag, rpmMireMode mode, const char *pattern) |
Add pattern to iterator selector. More... | |
static int | mireSkip (const rpmdbMatchIterator mi) |
Return iterator selector match. More... | |
int | rpmdbSetIteratorRewrite (rpmdbMatchIterator mi, int rewrite) |
Prepare iterator for lazy writes. More... | |
int | rpmdbSetIteratorModified (rpmdbMatchIterator mi, int modified) |
Modify iterator to mark header for lazy write on release. More... | |
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. More... | |
Header | rpmdbNextIterator (rpmdbMatchIterator mi) |
Return next package header from iteration. More... | |
static void | rpmdbSortIterator (rpmdbMatchIterator mi) |
static int | rpmdbGrowIterator (rpmdbMatchIterator mi, int fpNum, unsigned int exclude, unsigned int tag) |
int | rpmdbPruneIterator (rpmdbMatchIterator mi, int *hdrNums, int nHdrNums, int sorted) |
Remove items from set of package instances to iterate. More... | |
int | rpmdbAppendIterator (rpmdbMatchIterator mi, const int *hdrNums, int nHdrNums) |
Append items to set of package instances to iterate. More... | |
rpmdbMatchIterator | rpmdbInitIterator (rpmdb db, rpmTag rpmtag, const void *keyp, size_t keylen) |
Return database iterator. More... | |
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. More... | |
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. More... | |
int | rpmdbFindFpList (rpmdb db, fingerPrint *fpList, dbiIndexSet *matchList, int numItems, unsigned int exclude) |
Find fingerprint matches in database. More... | |
static int | rpmioFileExists (const char *urlfn) |
Check if file esists using stat(2). More... | |
static int | rpmdbRemoveDatabase (const char *prefix, const char *dbpath, int _dbapi, const int *dbiTags, int dbiTagsMax) |
static int | rpmdbMoveDatabase (const char *prefix, const char *olddbpath, int _olddbapi, const char *newdbpath, int _newdbapi, const int *dbiTags, int dbiTagsMax) |
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. More... | |
Variables | |
int | _rpmdb_debug = 0 |
static int | _rebuildinprogress = 0 |
static int | _db_filter_dups = 0 |
static int | _db_tagged_file_indices = 1 |
static struct _dbiVec * | mydbvecs [] |
static rpmdb | rpmdbRock |
static rpmdbMatchIterator | rpmmiRock |
static struct rpmdb_s | dbTemplate |
#define __PBM_BITS | ( | set | ) | ((set)->bits) |
Definition at line 65 of file rpmdb.c.
Referenced by PBM_REALLOC().
#define __PBM_IX | ( | d | ) | ((d) / __PBM_NBITS) |
Definition at line 58 of file rpmdb.c.
Referenced by PBM_REALLOC().
#define __PBM_MASK | ( | d | ) | ((__pbm_bits) 1 << (((unsigned)(d)) % __PBM_NBITS)) |
#define __PBM_NBITS (8 * sizeof (__pbm_bits)) |
#define _DB_ERRPFX "rpmdb" |
Definition at line 874 of file rpmdb.c.
Referenced by rpmdbNew().
#define _DB_HOME "%{?_dbpath}" |
Definition at line 868 of file rpmdb.c.
Referenced by rpmdbNew().
#define _DB_ROOT "/" |
Definition at line 867 of file rpmdb.c.
Referenced by rpmdbNew().
#define _DBSWAP | ( | _a | ) |
Definition at line 407 of file rpmdb.c.
Referenced by dbt2set(), rpmdbAdd(), rpmdbInitIterator(), rpmdbNextIterator(), rpmdbRemove(), and set2dbt().
#define _RECNUM rpmdbGetIteratorOffset(mi) |
Referenced by rpmdbRebuild().
#define _USE_COPY_LOAD /* XXX don't use DB_DBT_MALLOC (yet) */ |
Definition at line 7 of file rpmdb.c.
Referenced by rpmdbNextIterator().
#define _VARLIBRPM "/var/lib/rpm" |
Referenced by rpmdbNew().
#define PBM_ALLOC | ( | d | ) | xcalloc(__PBM_IX (d) + 1, sizeof(__pbm_bits)) |
#define PBM_CLR | ( | d, | |
s | |||
) | (__PBM_BITS (s)[__PBM_IX (d)] &= ~__PBM_MASK (d)) |
#define PBM_FREE | ( | s | ) | _free(s); |
Definition at line 67 of file rpmdb.c.
Referenced by rpmdbClose().
#define PBM_ISSET | ( | d, | |
s | |||
) | ((__PBM_BITS (s)[__PBM_IX (d)] & __PBM_MASK (d)) != 0) |
Definition at line 70 of file rpmdb.c.
Referenced by rpmdbNextIterator().
#define PBM_SET | ( | d, | |
s | |||
) | (__PBM_BITS (s)[__PBM_IX (d)] |= __PBM_MASK (d)) |
Definition at line 68 of file rpmdb.c.
Referenced by rpmdbNextIterator().
typedef unsigned int __pbm_bits |
|
static |
Block all signals, returning previous signal mask.
db | rpm database |
*oldMask | previous sigset |
Definition at line 762 of file rpmdb.c.
Referenced by miFreeHeader(), rpmdbAdd(), rpmdbMoveDatabase(), and rpmdbRemove().
|
static |
Append element(s) to set of index database items.
set | set of index database items |
recs | array of items to append to set |
nrecs | number of items |
recsize | size of an array item |
sortset | should resulting set be sorted? |
Definition at line 569 of file rpmdb.c.
References hdrNumCmp(), recs, and xrealloc().
Referenced by rpmdbAdd(), rpmdbAppendIterator(), rpmdbFindByFile(), and rpmdbFindFpList().
|
static |
Lookup by name, name-version, and finally by name-version-release.
Both version and release can be patterns.
dbi | index database handle (always RPMTAG_NAME) |
dbcursor | index database cursor |
key | search key/length/flags |
data | search data/length/flags |
arg | name[-version[-release]] string |
matches | set of header instances that match |
Definition at line 1717 of file rpmdb.c.
References alloca(), dbiFindMatches(), dbiFreeIndexSet(), RPMRC_NOTFOUND, and stpcpy().
Referenced by rpmdbInitIterator().
|
static |
Attempt partial matches on name[-version[-release]] strings.
dbi | index database handle (always RPMTAG_NAME) |
dbcursor | index database cursor |
key | search key/length/flags |
data | search data/length/flags |
name | package name |
version | package version (can be a pattern) |
release | package release (can be a pattern) |
matches | set of header instances that match |
Definition at line 1617 of file rpmdb.c.
References _, dbiFreeIndexSet(), dbiIndexRecordOffset(), dbiIndexSetCount(), dbt2set(), mapTagName(), rpmdbFreeIterator(), RPMDBI_PACKAGES, rpmdbInitIterator(), rpmdbNextIterator(), rpmdbSetIteratorRE(), RPMERR_DBGETINDEX, rpmError, RPMRC_FAIL, RPMRC_NOTFOUND, RPMRC_OK, RPMTAG_RELEASE, and RPMTAG_VERSION.
Referenced by dbiFindByLabel().
dbiIndexSet dbiFreeIndexSet | ( | dbiIndexSet | set | ) |
Definition at line 650 of file rpmdb.c.
References _free().
Referenced by dbiFindByLabel(), dbiFindMatches(), rpmdbAdd(), rpmdbCount(), rpmdbFindByFile(), rpmdbFreeIterator(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbRemove(), and rpmtsRun().
|
static |
Create and initialize item for index database set.
hdrNum | header instance in db |
tagNum | tag index in header |
Definition at line 393 of file rpmdb.c.
References xcalloc().
Referenced by rpmdbAdd(), rpmdbFindByFile(), and rpmdbRemove().
unsigned int dbiIndexRecordFileNumber | ( | dbiIndexSet | set, |
int | recno | ||
) |
Definition at line 645 of file rpmdb.c.
Referenced by rpmdbFindByFile(), rpmdbNextIterator(), and rpmtsRun().
unsigned int dbiIndexRecordOffset | ( | dbiIndexSet | set, |
int | recno | ||
) |
Definition at line 640 of file rpmdb.c.
Referenced by dbiFindMatches(), rpmdbFindByFile(), rpmdbNextIterator(), and rpmtsRun().
unsigned int dbiIndexSetCount | ( | dbiIndexSet | set | ) |
Definition at line 635 of file rpmdb.c.
Referenced by dbiFindMatches(), rpmdbCount(), and rpmtsRun().
Definition at line 286 of file rpmdb.c.
References _, _rebuildinprogress, _rpmdb_debug, D_, dbiTagToDbix(), errno, mapTagName(), PBM_ALLOC, RPMDBI_PACKAGES, RPMERR_DBOPEN, rpmError, rpmExpandNumeric(), RPMMESS_DEBUG, and rpmMessage.
Referenced by rpmdbAdd(), rpmdbCount(), rpmdbFindByFile(), rpmdbFreeIterator(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbNextIterator(), rpmdbOpenAll(), rpmdbOpenDatabase(), rpmdbRemove(), rpmpsmStage(), and unsatisfiedDepend().
|
static |
Remove element(s) from set of index database items.
set | set of index database items |
recs | array of items to remove from set |
nrecs | number of items |
recsize | size of an array item |
sorted | array is already sorted? |
Definition at line 608 of file rpmdb.c.
References hdrNumCmp().
Referenced by rpmdbPruneIterator(), and rpmdbRemove().
|
static |
Initialize database (index, tag) tuple from configuration.
Definition at line 163 of file rpmdb.c.
References _, _free(), RPMDBI_PACKAGES, rpmExpand(), RPMMESS_WARNING, rpmMessage, tagValue(), xcalloc(), xisspace(), xrealloc(), and xstrdup().
Referenced by rpmdbNew(), and rpmdbRebuild().
|
static |
|
static |
Convert retrieved data to index set.
dbi | index database handle |
data | retrieved data |
setp | (malloc'ed) index set |
Definition at line 422 of file rpmdb.c.
References _DBSWAP, _dbswap::ui, and xmalloc().
Referenced by dbiFindMatches(), rpmdbAdd(), rpmdbCount(), rpmdbFindByFile(), rpmdbGrowIterator(), rpmdbInitIterator(), and rpmdbRemove().
|
static |
Definition at line 553 of file rpmdb.c.
Referenced by dbiAppendSet(), dbiPruneSet(), and rpmdbSortIterator().
|
static |
Return (possibly renamed) tagName.
Handles Filedigests -> Filemd5s renaming.
value | tag value |
Definition at line 275 of file rpmdb.c.
References tagName().
Referenced by dbiFindMatches(), dbiOpen(), miFreeHeader(), rpmdbAdd(), rpmdbCount(), rpmdbFindByFile(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbMoveDatabase(), rpmdbRemove(), and rpmdbRemoveDatabase().
|
static |
Rewrite a header into packages (if necessary) and free the header.
Note: this is called from a markReplacedFiles iteration, and must preserve the "join key" (i.e. offset) for the header.
mi | database iterator |
dbi | index database handle |
Definition at line 1831 of file rpmdb.c.
References _, _free(), blockSignals(), HEADER_MAGIC_NO, headerFree(), headerSizeof(), headerUnload(), mapTagName(), _rpmdbMatchIterator::mi_data, _rpmdbMatchIterator::mi_dbc, _rpmdbMatchIterator::mi_h, _rpmdbMatchIterator::mi_hdrchk, _rpmdbMatchIterator::mi_key, _rpmdbMatchIterator::mi_modified, _rpmdbMatchIterator::mi_prevoffset, _rpmdbMatchIterator::mi_ts, RPMERR_DBPUTINDEX, rpmError, RPMMESS_DEBUG, RPMMESS_ERROR, rpmMessage, RPMRC_FAIL, RPMRC_NOTFOUND, and unblockSignals().
Referenced by rpmdbFreeIterator(), and rpmdbNextIterator().
|
static |
Compare iterator selectors by rpm tag (qsort/bsearch).
a | 1st iterator selector |
b | 2nd iterator selector |
Definition at line 1951 of file rpmdb.c.
Referenced by rpmdbSetIteratorRE().
|
static |
Copy pattern, escaping for appropriate mode.
tag | rpm tag |
modep | type of pattern match |
pattern | pattern to duplicate |
Definition at line 1965 of file rpmdb.c.
References RPMTAG_BASENAMES, RPMTAG_DIRNAMES, xmalloc(), and xstrdup().
Referenced by rpmdbSetIteratorRE().
|
static |
Return iterator selector match.
mi | rpm database iterator |
Definition at line 2135 of file rpmdb.c.
References headerFreeData(), headerGetEntryMinMemory(), _rpmdbMatchIterator::mi_h, _rpmdbMatchIterator::mi_nre, _rpmdbMatchIterator::mi_re, 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, and RPMTAG_EPOCH.
Referenced by rpmdbNextIterator().
|
inlinestatic |
Convert hex to binary nibble.
c | hex character |
Definition at line 108 of file rpmdb.c.
Referenced by rpmdbAdd(), and rpmdbRemove().
Reallocate a bit map.
sp | address of bit map pointer |
odp | no. of bits in map |
nd | desired no. of bits |
Definition at line 81 of file rpmdb.c.
References __PBM_BITS, __PBM_IX, and xrealloc().
Referenced by rpmdbNextIterator().
|
inlinestatic |
Return header query string.
h | header |
qfmt | header sprintf format |
Definition at line 800 of file rpmdb.c.
References _, headerDefaultFormats, headerSprintf(), RPMERR_QFMT, rpmError, and rpmTagTable.
Referenced by rpmdbExportInfo().
int rpmdbBlockDBI | ( | rpmdb | db, |
int | rpmtag | ||
) |
Block access to a single database index.
db | rpm database |
rpmtag | rpm tag (negative to block) |
Definition at line 912 of file rpmdb.c.
Referenced by rpmgiNext().
int rpmdbCloseDBI | ( | rpmdb | db, |
int | rpmtag | ||
) |
Close a single database index.
db | rpm database |
rpmtag | rpm tag |
Definition at line 930 of file rpmdb.c.
Referenced by rpmtsCheck().
Write added/removed header info.
db | rpm database |
h | header |
adding | adding an rpmdb header? |
Definition at line 822 of file rpmdb.c.
References _free(), Fclose(), Fopen(), headerGetEntry(), queryHeader(), rpmGetPath(), RPMMESS_DEBUG, rpmMessage, RPMTAG_INSTALLTIME, Unlink(), and Utime().
Referenced by rpmdbNew().
|
static |
Find file matches in database.
db | rpm database |
filespec | |
key | |
data | |
matches |
Definition at line 1383 of file rpmdb.c.
References _, _db_tagged_file_indices, _free(), alloca(), dbiAppendSet(), dbiFreeIndexSet(), dbiIndexNewItem(), dbiIndexRecordFileNumber(), dbiIndexRecordOffset(), dbiOpen(), dbt2set(), dirName, FP_EQUAL, fpCacheCreate(), fpCacheFree(), fpLookup(), headerFree(), headerFreeData(), headerGetEntryMinMemory(), headerLink(), mapTagName(), rpmdbFreeIterator(), RPMDBI_PACKAGES, rpmdbInitIterator(), rpmdbNextIterator(), RPMERR_DBGETINDEX, rpmError, RPMTAG_BASENAMES, RPMTAG_DIRINDEXES, RPMTAG_DIRNAMES, and xcalloc().
Referenced by rpmdbInitIterator().
unsigned int rpmdbGetIteratorFileNum | ( | rpmdbMatchIterator | mi | ) |
Definition at line 1937 of file rpmdb.c.
References _rpmdbMatchIterator::mi_filenum.
Referenced by rpmtsFindPubkey().
|
static |
Definition at line 2515 of file rpmdb.c.
References _, _db_tagged_file_indices, dbiFreeIndexSet(), dbiOpen(), dbt2set(), mapTagName(), _rpmdbMatchIterator::mi_data, _rpmdbMatchIterator::mi_db, _rpmdbMatchIterator::mi_dbc, _rpmdbMatchIterator::mi_key, _rpmdbMatchIterator::mi_rpmtag, _rpmdbMatchIterator::mi_set, RPMERR_DBGETINDEX, rpmError, and xrealloc().
Referenced by rpmdbFindFpList().
|
static |
Definition at line 3771 of file rpmdb.c.
References alloca(), blockSignals(), freecon, is_selinux_enabled, mapTagName(), matchpathcon, matchpathcon_init, rpmCleanPath(), RPMDBI_ADDED, RPMDBI_AVAILABLE, RPMDBI_DEPENDS, RPMDBI_REMOVED, rpmioFileExists(), setfilecon, and unblockSignals().
Referenced by rpmdbRebuild().
rpmdb rpmdbNew | ( | const char * | root, |
const char * | home, | ||
int | mode, | ||
int | perms, | ||
int | flags | ||
) |
Definition at line 1094 of file rpmdb.c.
References _, _DB_ERRPFX, _db_filter_dups, _DB_HOME, _DB_ROOT, _free(), _rpmdb_debug, _VARLIBRPM, dbiTagsInit(), dbTemplate, rpmdbExportInfo(), rpmdbLink(), rpmdbURIPath(), RPMERR_DBOPEN, rpmError, rpmExpand(), rpmExpandNumeric(), rpmGetPath(), urlPath(), and xcalloc().
Referenced by rpmdbOpenDatabase().
int rpmdbOpenDatabase | ( | const char * | prefix, |
const char * | dbpath, | ||
int | _dbapi, | ||
rpmdb * | dbp, | ||
int | mode, | ||
int | perms, | ||
int | flags | ||
) |
Definition at line 1168 of file rpmdb.c.
References dbiOpen(), RPMDB_FLAG_JUSTCHECK, RPMDB_FLAG_MINIMAL, rpmdbClose(), RPMDBI_ADDED, RPMDBI_AVAILABLE, RPMDBI_DEPENDS, RPMDBI_PACKAGES, RPMDBI_REMOVED, rpmdbNew(), rpmdbRock, rpmsqEnable(), and RPMTAG_NAME.
Referenced by rpmdbInit(), rpmdbOpen(), rpmdbRebuild(), and rpmdbVerify().
|
static |
Definition at line 3710 of file rpmdb.c.
References alloca(), mapTagName(), rpmCleanPath(), rpmioFileExists(), and Unlink().
Referenced by rpmdbRebuild().
|
static |
Definition at line 2493 of file rpmdb.c.
References hdrNumCmp(), mergesort(), _rpmdbMatchIterator::mi_set, and _rpmdbMatchIterator::mi_sorted.
Referenced by rpmdbFindFpList().
|
static |
Return macro expanded absolute path to rpmdb.
uri | desired path |
Definition at line 1042 of file rpmdb.c.
References _free(), PATH_MAX, realpath(), rpmGetPath(), stpncpy(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by rpmdbNew().
|
static |
Check if file esists using stat(2).
urlfn | file name (may be URL) |
Definition at line 3675 of file rpmdb.c.
References errno, Stat(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by rpmdbMoveDatabase(), and rpmdbRemoveDatabase().
|
static |
Convert index set to database representation.
dbi | index database handle |
data | retrieved data |
set | index set |
Definition at line 492 of file rpmdb.c.
References _DBSWAP, _dbswap::ui, and xmalloc().
Referenced by rpmdbAdd(), and rpmdbRemove().
|
inlinestatic |
Return a tagnum with hash on the (directory) path in upper 16 bits.
s | (directory) path |
Definition at line 1362 of file rpmdb.c.
Referenced by rpmdbAdd(), and rpmdbFindFpList().
|
static |
Restore signal mask.
db | rpm database |
oldMask | previous sigset |
Definition at line 785 of file rpmdb.c.
References rpmdbCheckSignals().
Referenced by miFreeHeader(), rpmdbAdd(), rpmdbMoveDatabase(), and rpmdbRemove().
Definition at line 1277 of file rpmdb.c.
References _rpmdb_debug.
Definition at line 1267 of file rpmdb.c.
References _rpmdb_debug.
|
static |
Definition at line 40 of file rpmdb.c.
Referenced by rpmdbNew(), and rpmdbRebuild().
|
static |
Definition at line 47 of file rpmdb.c.
Referenced by rpmdbAdd(), rpmdbFindByFile(), rpmdbFindFpList(), and rpmdbGrowIterator().
|
static |
Definition at line 38 of file rpmdb.c.
Referenced by dbiOpen(), and rpmdbRebuild().
int _rpmdb_debug = 0 |
Definition at line 35 of file rpmdb.c.
Referenced by dbiOpen(), rpmdbNew(), XrpmdbLink(), and XrpmdbUnlink().
|
static |
Definition at line 878 of file rpmdb.c.
Referenced by rpmdbNew().
|
static |
|
static |
Definition at line 692 of file rpmdb.c.
Referenced by rpmdbClose(), and rpmdbOpenDatabase().
|
static |
Definition at line 695 of file rpmdb.c.
Referenced by rpmdbFreeIterator(), and rpmdbInitIterator().