Database API.


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_srpmdb
 Database of headers and tag value indices.
typedef _rpmdbMatchIteratorrpmdbMatchIterator
 Database iterator.
typedef _dbiIndexSetdbiIndexSet
 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.

Typedef Documentation

typedef struct _dbiIndexSet* dbiIndexSet

A single element (i.e.

inverted list from tag values) of a database.

Definition at line 49 of file rpmdb.h.

typedef struct rpmdb_s* rpmdb

Database of headers and tag value indices.

Definition at line 108 of file rpmlib.h.

typedef struct _rpmdbMatchIterator* rpmdbMatchIterator

Database iterator.

Definition at line 113 of file rpmlib.h.


Enumeration Type Documentation

enum rpmdbFlags

Enumerator:
RPMDB_FLAG_JUSTCHECK 
RPMDB_FLAG_MINIMAL 
RPMDB_FLAG_CHROOT 

Definition at line 444 of file rpmdb.h.


Function Documentation

int rpmdbAdd ( rpmdb  db,
int  iid,
Header  h,
rpmts  ts,
rpmRC(*)(rpmts ts, const void *uh, size_t uc, const char **msg)  hdrchk 
)

Add package header to rpm database and indices.

Parameters:
db rpm database
iid install transaction id (iid = 0 or -1 to skip)
h header
ts (unused) transaction set (or NULL)
(*hdrchk) (unused) headerCheck() vector (or NULL)
Returns:
0 on success

Definition at line 2910 of file rpmdb.c.

References _, _DBSWAP, _free(), _noDirTokens, alloca(), blockSignals(), _dbiIndex::dbi_no_dbsync, _dbiIndex::dbi_permit_dups, _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_txnid, dbiAppendSet(), dbiByteSwapped(), dbiCclose(), dbiCopen(), dbiFreeIndexSet(), dbiGet(), dbiIndexNewItem(), dbiOpen(), dbiPut(), dbiSync(), dbiTags, dbiTagsMax, dbt2set(), expandFilelist(), HEADER_MAGIC_NO, headerAddEntry(), headerFreeData(), headerGetEntryMinMemory(), headerIsEntry(), headerRemoveEntry(), headerSizeof(), headerUnload(), isInstallPreReq, myinstall_instance, 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, RPMERR_DBGETINDEX, RPMERR_DBPUTINDEX, rpmError, RPMMESS_DEBUG, RPMMESS_ERROR, rpmMessage, RPMRC_FAIL, RPMRC_NOTFOUND, RPMTAG_BASENAMES, RPMTAG_FILEMD5S, RPMTAG_GROUP, RPMTAG_INSTALLTID, RPMTAG_PUBKEYS, RPMTAG_REMOVETID, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIRENAME, RPMTAG_TRIGGERNAME, set2dbt(), tagName(), _dbiIndexItem::tagNum, _dbswap::ui, and xcalloc().

Referenced by ftsCacheUpdate(), rpmcliImportPubkey(), rpmdbRebuild(), and rpmpsmStage().

int rpmdbAppendIterator ( rpmdbMatchIterator  mi,
const int *  hdrNums,
int  nHdrNums 
)

Append items to set of package instances to iterate.

Parameters:
mi rpm database iterator
hdrNums array of package instances
nHdrNums number of elements in array
Returns:
0 on success, 1 on failure (bad args)

Definition at line 2447 of file rpmdb.c.

References dbiAppendSet(), _rpmdbMatchIterator::mi_set, and xcalloc().

Referenced by markReplacedFiles().

int rpmdbCheckSignals ( void   ) 

Check rpmdb signal handler for trapped signal exit.

Definition at line 703 of file rpmdb.c.

References rpmdb_s::db_next, EXIT_FAILURE, _rpmdbMatchIterator::mi_next, rpmdbClose(), rpmdbFreeIterator(), rpmdbRock, RPMMESS_DEBUG, rpmMessage, rpmmiRock, and rpmsqCaught.

Referenced by rpmdbInitIterator(), rpmQueryVerify(), rpmtsRun(), and unblockSignals().

int rpmdbClose ( rpmdb  db  ) 

Close all database indices and free rpmdb.

Parameters:
db rpm database
Returns:
0 on success

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_root, dbiClose(), next, rpmdb_s::nrefs, PBM_FREE, rpmdbRock, rpmdbUnlink, and rpmsqEnable().

Referenced by main(), openDatabase(), rpmdb_dealloc(), rpmdbCheckSignals(), rpmdbInit(), rpmdbRebuild(), rpmdbVerify(), rpmtsCloseDB(), and rpmtsCloseSDB().

int rpmdbCountPackages ( rpmdb  db,
const char *  name 
)

Return number of instances of package in rpm database.

Parameters:
db rpm database
name rpm package name
Returns:
number of instances

Definition at line 1333 of file rpmdb.c.

References _, alloca(), _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().

int rpmdbFindFpList ( rpmdb  db,
fingerPrint fpList,
dbiIndexSet matchList,
int  numItems 
)

Find fingerprint matches in database.

Parameters:
db rpm database
fpList fingerprint array
Return values:
matchList returned fingerprint matches
Parameters:
numItems number of fingerprint items
Returns:
0 always

Definition at line 3393 of file rpmdb.c.

References _free(), _dbiIndexSet::count, 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, skipDir(), _dbiIndexItem::tagNum, and xcalloc().

Referenced by rpmtsRun().

rpmdbMatchIterator rpmdbFreeIterator ( rpmdbMatchIterator  mi  ) 

Destroy rpm database iterator.

Parameters:
mi rpm database iterator
Returns:
NULL always

Definition at line 1656 of file rpmdb.c.

References _free(), dbiCclose(), dbiOpen(), _rpmdbMatchIterator::mi_db, _rpmdbMatchIterator::mi_dbc, _rpmdbMatchIterator::mi_nre, _rpmdbMatchIterator::mi_re, miFreeHeader(), next, miRE_s::pattern, RPMDBI_PACKAGES, and rpmmiRock.

Referenced by _rpmtsAddRollbackElement(), checkPackageSet(), dbiFindMatches(), ftsCacheUpdate(), handleInstInstalledFiles(), handleRmvdInstalledFiles(), IDTXload(), main(), markReplacedFiles(), rpmcliShowMatches(), rpmdb_length(), rpmdb_subscript(), rpmdbCheckSignals(), rpmdbFindByFile(), rpmdbFindFpList(), rpmdbRebuild(), rpmdbRemove(), rpmErase(), rpmgiFree(), rpmgiInitFilter(), rpmgiNext(), rpmInstall(), rpmmi_dealloc(), rpmmi_iternext(), rpmpsmStage(), rpmts_AddErase(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsFindPubkey(), rpmtsRun(), rpmtsSolve(), runImmedTriggers(), runTriggers(), and unsatisfiedDepend().

int rpmdbGetIteratorCount ( rpmdbMatchIterator  mi  ) 

Return number of elements in rpm database iterator.

Parameters:
mi rpm database iterator
Returns:
number of elements

Definition at line 1718 of file rpmdb.c.

References _dbiIndexSet::count, and _rpmdbMatchIterator::mi_set.

Referenced by ftsCacheUpdate(), rpmdbFindFpList(), rpmInstall(), rpmmi_Count(), rpmts_AddErase(), and runImmedTriggers().

unsigned int rpmdbGetIteratorFileNum ( rpmdbMatchIterator  mi  ) 

Definition at line 1714 of file rpmdb.c.

References _rpmdbMatchIterator::mi_filenum.

Referenced by rpmtsFindPubkey().

unsigned int rpmdbGetIteratorOffset ( rpmdbMatchIterator  mi  ) 

Return header join key for current position of rpm database iterator.

Parameters:
mi rpm database iterator
Returns:
current header join key

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().

int rpmdbInit ( const char *  prefix,
int  perms 
)

Initialize database.

Parameters:
prefix path to top of install tree
perms database permissions
Returns:
0 on success

Definition at line 1121 of file rpmdb.c.

References openDatabase(), RPMDB_FLAG_JUSTCHECK, rpmdbClose(), rpmdbOpenAll(), and rpmExpandNumeric().

Referenced by rpmtsInitDB().

rpmdbMatchIterator rpmdbInitIterator ( rpmdb  db,
rpmTag  rpmtag,
const void *  keyp,
size_t  keylen 
)

Return database iterator.

Parameters:
db rpm database
rpmtag rpm tag
keyp key data (NULL for sequential access)
keylen key data length (0 will use strlen(keyp))
Returns:
NULL on failure

Definition at line 2458 of file rpmdb.c.

References _, _DBSWAP, _free(), _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_txnid, dbiByteSwapped(), dbiCclose(), dbiCopen(), dbiFindByLabel(), dbiFreeIndexSet(), dbiGet(), dbiOpen(), dbt2set(), _rpmdbMatchIterator::mi_key, _rpmdbMatchIterator::mi_next, rpmdbCheckSignals(), rpmdbFindByFile(), RPMDBI_LABEL, RPMDBI_PACKAGES, rpmdbLink, RPMERR_DBGETINDEX, rpmError, rpmmiRock, RPMTAG_BASENAMES, RPMTAG_NAME, tagName(), _dbswap::ui, xcalloc(), and xmalloc().

Referenced by dbiFindMatches(), main(), rpmdb_length(), rpmdb_Match(), rpmdb_subscript(), rpmdbFindByFile(), rpmdbFindFpList(), rpmdbRebuild(), rpmdbRemove(), rpmtsInitIterator(), and rpmtsSolve().

rpmdb rpmdbLink ( rpmdb  db,
const char *  msg 
)

Reference a database instance.

Parameters:
db rpm database
msg 
Returns:
new rpm database reference

Header rpmdbNextIterator ( rpmdbMatchIterator  mi  ) 

Return next package header from iteration.

Parameters:
mi rpm database iterator
Returns:
NULL on end of iteration.

Definition at line 2134 of file rpmdb.c.

References _, _DBSWAP, _free(), _USE_COPY_LOAD, _dbiIndexSet::count, rpmdb_s::db_bits, rpmdb_s::db_nbits, _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(), handleInstInstalledFiles(), handleRmvdInstalledFiles(), IDTXload(), main(), markReplacedFiles(), rpmcliShowMatches(), rpmdb_length(), rpmdb_subscript(), rpmdbFindByFile(), rpmdbFindFpList(), rpmdbRebuild(), rpmdbRemove(), rpmErase(), rpmgiNext(), rpmInstall(), rpmmi_iternext(), rpmpsmStage(), rpmts_AddErase(), rpmtsAddInstallElement(), rpmtsFindPubkey(), rpmtsRun(), rpmtsSolve(), runImmedTriggers(), runTriggers(), and unsatisfiedDepend().

int rpmdbOpen ( const char *  prefix,
rpmdb dbp,
int  mode,
int  perms 
)

Open rpm database.

Parameters:
prefix path to top of install tree
Return values:
dbp address of rpm database
Parameters:
mode open(2) flags: O_RDWR or O_RDONLY (O_CREAT also)
perms database permissions
Returns:
0 on success

Definition at line 1113 of file rpmdb.c.

References openDatabase(), and rpmExpandNumeric().

Referenced by main(), rpmtsOpenDB(), and rpmtsOpenSDB().

int rpmdbOpenAll ( rpmdb  db  ) 

Open all database indices.

Parameters:
db rpm database
Returns:
0 on success

Definition at line 798 of file rpmdb.c.

References rpmdb_s::_dbi, dbiOpen(), dbiTags, and dbiTagsMax.

Referenced by rpmdbInit(), and rpmdbVerify().

int rpmdbPruneIterator ( rpmdbMatchIterator  mi,
int *  hdrNums,
int  nHdrNums,
int  sorted 
)

Remove items from set of package instances to iterate.

Note:
Sorted hdrNums are always passed in rpmlib.
Parameters:
mi rpm database iterator
hdrNums array of package instances
nHdrNums number of elements in array
sorted is the array sorted? (array will be sorted on return)
Returns:
0 on success, 1 on failure (bad args)

Definition at line 2436 of file rpmdb.c.

References dbiPruneSet(), and _rpmdbMatchIterator::mi_set.

Referenced by checkPackageSet(), rpmtsAddInstallElement(), and unsatisfiedDepend().

int rpmdbRebuild ( const char *  prefix,
rpmts  ts,
rpmRC(*)(rpmts ts, const void *uh, size_t uc, const char **msg)  hdrchk 
)

Rebuild database indices from package headers.

Parameters:
prefix path to top of install tree
ts transaction set (or NULL)
(*hdrchk) headerCheck() vector (or NULL)
Returns:
0 on success

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(), 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().

int rpmdbRemove ( rpmdb  db,
int  rid,
unsigned int  hdrNum,
rpmts  ts,
rpmRC(*)(rpmts ts, const void *uh, size_t uc, const char **msg)  hdrchk 
)

Remove package header from rpm database and indices.

Parameters:
db rpm database
rid (unused) remove transaction id (rid = 0 or -1 to skip)
hdrNum package instance number in database
ts (unused) transaction set (or NULL)
(*hdrchk) (unused) headerCheck() vector (or NULL)
Returns:
0 on success

Definition at line 2600 of file rpmdb.c.

References _, _DBSWAP, _free(), alloca(), blockSignals(), dbiByteSwapped(), dbiCclose(), dbiCopen(), dbiDel(), dbiFreeIndexSet(), dbiGet(), dbiIndexNewItem(), dbiOpen(), dbiPruneSet(), dbiPut(), dbiSync(), dbiTags, dbiTagsMax, dbt2set(), headerAddEntry(), headerFreeData(), headerGetEntryMinMemory(), headerLink(), headerNVR(), 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, 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(), tagName(), and _dbswap::ui.

Referenced by rpmpsmStage().

int rpmdbSetHdrChk ( rpmdbMatchIterator  mi,
rpmts  ts,
rpmRC(*)(rpmts ts, const void *uh, size_t uc, const char **msg)  hdrchk 
)

Modify iterator to verify retrieved header blobs.

Parameters:
mi rpm database iterator
ts transaction set
(*hdrchk) headerCheck() vector
Returns:
0 always

Definition at line 2119 of file rpmdb.c.

References _rpmdbMatchIterator::mi_hdrchk, and _rpmdbMatchIterator::mi_ts.

Referenced by rpmdbRebuild(), and rpmtsInitIterator().

int rpmdbSetIteratorModified ( rpmdbMatchIterator  mi,
int  modified 
)

Modify iterator to mark header for lazy write on release.

Parameters:
mi rpm database iterator
modified new value of modified
Returns:
previous value

Definition at line 2109 of file rpmdb.c.

References _rpmdbMatchIterator::mi_modified.

Referenced by markReplacedFiles().

int rpmdbSetIteratorRE ( rpmdbMatchIterator  mi,
rpmTag  tag,
rpmMireMode  mode,
const char *  pattern 
)

Add pattern to iterator selector.

Parameters:
mi rpm database iterator
tag rpm tag
mode type of pattern match
pattern pattern to match
Returns:
0 on success

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(), rpmdbRebuild(), rpmgiInitFilter(), rpmmi_Pattern(), rpmpsmStage(), rpmtsInitIterator(), and rpmtsRun().

int rpmdbSetIteratorRewrite ( rpmdbMatchIterator  mi,
int  rewrite 
)

Prepare iterator for lazy writes.

Note:
Must be called before rpmdbNextIterator() with CDB model database.
Parameters:
mi rpm database iterator
rewrite new value of rewrite
Returns:
previous value

Definition at line 2096 of file rpmdb.c.

References _rpmdbMatchIterator::mi_cflags.

Referenced by markReplacedFiles().

int rpmdbSync ( rpmdb  db  ) 

Sync all database indices.

Parameters:
db rpm database
Returns:
0 on success

Definition at line 899 of file rpmdb.c.

References rpmdb_s::_dbi, rpmdb_s::db_ndbi, and dbiSync().

Referenced by rpmtsRun().

rpmdb rpmdbUnlink ( rpmdb  db,
const char *  msg 
)

Unreference a database instance.

Parameters:
db rpm database
msg 
Returns:
NULL always

int rpmdbVerify ( const char *  prefix  ) 

Verify database components.

Parameters:
prefix path to top of install tree
Returns:
0 on success

Definition at line 1142 of file rpmdb.c.

References rpmdb_s::_dbi, rpmdb_s::db_ndbi, dbiVerify(), openDatabase(), rpmdbClose(), rpmdbOpenAll(), and rpmExpandNumeric().

Referenced by rpmtsVerifyDB().


Variable Documentation

int* dbiTags

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().


Generated on Wed Jan 28 12:45:29 2009 for rpm by  doxygen 1.4.7