#include "system.h"
#include <rpmlib.h>
#include <rpmmacro.h>
#include "depends.h"
#include "rpmdb.h"
#include "debug.h"
Go to the source code of this file.
Typedefs | |
typedef int(* | dbrecMatch_t )(Header h, const char *reqName, const char *reqEVR, int reqFlags) |
Functions | |
int | headerNVR (Header h, const char **np, const char **vp, const char **rp) |
static char * | printDepend (const char *depend, const char *key, const char *keyEVR, int keyFlags) |
Return formatted dependency string. | |
static void | alFreeIndex (availableList al) |
Destroy available item index. | |
static void | alCreate (availableList al) |
Initialize available packckages, items, and directories list. | |
static void | alFree (availableList al) |
Free available packages, items, and directories members. | |
static int | dirInfoCompare (const void *one, const void *two) |
Compare two directory info entries by name (qsort/bsearch). | |
static struct availablePackage * | alAddPackage (availableList al, Header h, const void *key, FD_t fd, rpmRelocation *relocs) |
Add package to available list. | |
static int | indexcmp (const void *one, const void *two) |
Compare two available index entries by name (qsort/bsearch). | |
static void | alMakeIndex (availableList al) |
Generate index for available list. | |
static void | parseEVR (char *evr, const char **ep, const char **vp, const char **rp) |
Split EVR into epoch, version, and release components. | |
int | rpmRangesOverlap (const char *AName, const char *AEVR, int AFlags, const char *BName, const char *BEVR, int BFlags) |
static int | rangeMatchesDepFlags (Header h, const char *reqName, const char *reqEVR, int reqFlags) |
int | headerMatchesDepFlags (Header h, const char *reqName, const char *reqEVR, int reqFlags) |
rpmTransactionSet | rpmtransCreateSet (rpmdb rpmdb, const char *rootDir) |
static int | intcmp (const void *a, const void *b) |
Compare removed package instances (qsort/bsearch). | |
static int | removePackage (rpmTransactionSet ts, int dboffset, int depends) |
Add removed package instance to ordered transaction set. | |
int | rpmtransAddPackage (rpmTransactionSet ts, Header h, FD_t fd, const void *key, int upgrade, rpmRelocation *relocs) |
void | rpmtransAvailablePackage (rpmTransactionSet ts, Header h, const void *key) |
int | rpmtransRemovePackage (rpmTransactionSet ts, int dboffset) |
rpmTransactionSet | rpmtransFree (rpmTransactionSet ts) |
rpmDependencyConflict | rpmdepFreeConflicts (rpmDependencyConflict conflicts, int numConflicts) |
static struct availablePackage ** | alAllFileSatisfiesDepend (const availableList al, const char *keyType, const char *fileName) |
Check added package file lists for package(s) that provide a file. | |
static struct availablePackage ** | alAllSatisfiesDepend (const availableList al, const char *keyType, const char *keyDepend, const char *keyName, const char *keyEVR, int keyFlags) |
Check added package file lists for package(s) that have a provide. | |
static struct availablePackage * | alSatisfiesDepend (const availableList al, const char *keyType, const char *keyDepend, const char *keyName, const char *keyEVR, int keyFlags) |
Check added package file lists for first package that has a provide. | |
static int | unsatisfiedDepend (rpmTransactionSet ts, const char *keyType, const char *keyDepend, const char *keyName, const char *keyEVR, int keyFlags, struct availablePackage ***suggestion) |
Check key for an unsatisfied dependency. | |
static int | checkPackageDeps (rpmTransactionSet ts, problemsSet psp, Header h, const char *keyName, uint_32 multiLib) |
Check header requires/conflicts against against installed+added packages. | |
static int | checkPackageSet (rpmTransactionSet ts, problemsSet psp, const char *key, rpmdbMatchIterator mi) |
Check dependency against installed packages. | |
static int | checkDependentPackages (rpmTransactionSet ts, problemsSet psp, const char *key) |
Erasing: check name/provides/filename key against requiredby matches. | |
static int | checkDependentConflicts (rpmTransactionSet ts, problemsSet psp, const char *key) |
Adding: check name/provides key against conflicts matches. | |
static int | ignoreDep (const struct availablePackage *p, const struct availablePackage *q) |
Check for dependency relations to be ignored. | |
static void | markLoop (tsortInfo tsi, struct availablePackage *q) |
Recursively mark all nodes with their predecessors. | |
static const char *const | identifyDepend (int_32 f) |
static const char * | zapRelation (struct availablePackage *q, struct availablePackage *p, int zap, int *nzaps) |
Find (and eliminate co-requisites) "q <- p" relation in dependency loop. | |
static int | addRelation (const rpmTransactionSet ts, struct availablePackage *p, unsigned char *selected, int j) |
Record next "q <- p" relation (i.e. | |
static int | orderListIndexCmp (const void *one, const void *two) |
Compare ordered list entries by index (qsort/bsearch). | |
static void | addQ (struct availablePackage *p, struct availablePackage **qp, struct availablePackage **rp) |
Add element to list sorting by initial successor count. | |
int | rpmdepOrder (rpmTransactionSet ts) |
static int | rpmdbCloseDBI (rpmdb db, int rpmtag) |
Close a single database index. | |
int | rpmdepCheck (rpmTransactionSet ts, rpmDependencyConflict *conflicts, int *numConflicts) |
Variables | |
static int | _depends_debug = 0 |
static int | _cacheDependsRC = 1 |
const char * | rpmNAME = PACKAGE |
const char * | rpmEVR = VERSION |
int | rpmFLAGS = RPMSENSE_EQUAL |
static struct badDeps_s * | badDeps = NULL |
Definition in file depends.c.
|
|
|
Add element to list sorting by initial successor count.
Definition at line 1884 of file depends.c. References availablePackage::tsi, tsortInfo_s::tsi_qcnt, and tsortInfo_s::tsi_reqx. Referenced by rpmdepOrder(). |
|
Record next "q <- p" relation (i.e. "p" requires "q").
Definition at line 1818 of file depends.c. References rpmTransactionSet_s::addedPackages, alSatisfiesDepend(), availablePackage::depth, ignoreDep(), availableList_s::list, availablePackage::tsi, tsortInfo_s::tsi_next, tsortInfo_s::tsi_qcnt, tsortInfo_s::tsi_reqx, and xmalloc(). Referenced by rpmdepOrder(). |
|
|
Check added package file lists for package(s) that provide a file.
Definition at line 963 of file depends.c. References _, _free(), dirInfoCompare(), dirInfo_s::dirName, dirInfo_s::dirNameLen, availableList_s::dirs, isFileMULTILIB, availableList_s::list, availablePackage::multiLib, availableList_s::numDirs, RPMMESS_DEBUG, rpmMessage, xrealloc(), and xstrdup(). Referenced by alAllSatisfiesDepend(). |
|
Check added package file lists for package(s) that have a provide.
Definition at line 1078 of file depends.c. References _, alAllFileSatisfiesDepend(), availableIndexEntry::entry, availableIndexEntry::entryIx, availableIndexEntry::entryLen, availableIndex::index, availableList_s::index, indexcmp(), availableIndexEntry::package, availablePackage::provideFlags, availablePackage::provides, availablePackage::providesEVR, RPMMESS_DEBUG, rpmMessage, rpmRangesOverlap(), availableIndex::size, availableIndexEntry::type, and xrealloc(). Referenced by alSatisfiesDepend(), and unsatisfiedDepend(). |
|
Initialize available packckages, items, and directories list.
Definition at line 144 of file depends.c. References availableList_s::alloced, availableList_s::delta, availableList_s::dirs, availableIndex::index, availableList_s::index, availableList_s::list, availableList_s::numDirs, availableIndex::size, availableList_s::size, and xcalloc(). Referenced by rpmtransCreateSet(). |
|
Free available packages, items, and directories members.
Definition at line 162 of file depends.c. References _free(), alFreeIndex(), availableList_s::alloced, availablePackage::baseNames, dirInfo_s::dirName, availableList_s::dirs, availablePackage::fd, fdFree, dirInfo_s::files, availablePackage::h, headerFree(), availableList_s::list, rpmRelocation_s::newPath, availableList_s::numDirs, rpmRelocation_s::oldPath, availablePackage::provides, availablePackage::providesEVR, availablePackage::relocs, availablePackage::requires, availablePackage::requiresEVR, availablePackage::tsi, and tsortInfo_s::tsi_next. Referenced by rpmtransFree(). |
|
Destroy available item index.
Definition at line 131 of file depends.c. References _free(), availableIndex::index, availableList_s::index, and availableIndex::size. Referenced by alAddPackage(), and alFree(). |
|
Generate index for available list.
Definition at line 444 of file depends.c. References availableIndexEntry::entry, availableIndexEntry::entryIx, availableIndexEntry::entryLen, availableIndex::index, availableList_s::index, indexcmp(), isDependsMULTILIB, availableList_s::list, availablePackage::multiLib, availableIndexEntry::package, availablePackage::provideFlags, availablePackage::provides, availablePackage::providesCount, availableIndex::size, availableIndexEntry::type, and xcalloc(). Referenced by rpmdepCheck(), and rpmdepOrder(). |
|
Check added package file lists for first package that has a provide.
Definition at line 1159 of file depends.c. References _free(), and alAllSatisfiesDepend(). Referenced by addRelation(), and unsatisfiedDepend(). |
|
Adding: check name/provides key against conflicts matches.
Definition at line 1599 of file depends.c. References checkPackageSet(), rpmTransactionSet_s::rpmdb, rpmdbInitIterator(), and RPMTAG_CONFLICTNAME. Referenced by rpmdepCheck(). |
|
Erasing: check name/provides/filename key against requiredby matches.
Definition at line 1583 of file depends.c. References checkPackageSet(), rpmTransactionSet_s::rpmdb, rpmdbInitIterator(), and RPMTAG_REQUIRENAME. Referenced by rpmdepCheck(). |
|
Check header requires/conflicts against against installed+added packages.
Definition at line 1371 of file depends.c. References _, _free(), problemsSet_s::alloced, rpmDependencyConflict_s::byHeader, rpmDependencyConflict_s::byName, rpmDependencyConflict_s::byRelease, rpmDependencyConflict_s::byVersion, headerLink(), headerNVR(), isDependsMULTILIB, availablePackage::key, rpmDependencyConflict_s::needsFlags, rpmDependencyConflict_s::needsName, rpmDependencyConflict_s::needsVersion, problemsSet_s::num, printDepend(), problemsSet_s::problems, RPM_STRING_ARRAY_TYPE, RPMMESS_DEBUG, rpmMessage, RPMTAG_CONFLICTFLAGS, RPMTAG_CONFLICTNAME, RPMTAG_CONFLICTVERSION, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, rpmDependencyConflict_s::sense, rpmDependencyConflict_s::suggestedPackages, unsatisfiedDepend(), xmalloc(), xrealloc(), and xstrdup(). Referenced by checkPackageSet(), and rpmdepCheck(). |
|
Check dependency against installed packages. Adding: check name/provides key against each conflict match, Erasing: check name/provides/filename key against each requiredby match.
Definition at line 1556 of file depends.c. References checkPackageDeps(), rpmTransactionSet_s::numRemovedPackages, rpmTransactionSet_s::removedPackages, rpmdbFreeIterator(), rpmdbNextIterator(), and rpmdbPruneIterator(). Referenced by checkDependentConflicts(), and checkDependentPackages(). |
|
Compare two directory info entries by name (qsort/bsearch).
Definition at line 218 of file depends.c. References dirInfo_s::dirName, and dirInfo_s::dirNameLen. Referenced by alAddPackage(), and alAllFileSatisfiesDepend(). |
|
Definition at line 1728 of file depends.c. References _notpre, isLegacyPreReq, RPMSENSE_FIND_REQUIRES, RPMSENSE_SCRIPT_POST, RPMSENSE_SCRIPT_POSTUN, RPMSENSE_SCRIPT_PRE, RPMSENSE_SCRIPT_PREUN, and RPMSENSE_SCRIPT_VERIFY. Referenced by zapRelation(). |
|
Check for dependency relations to be ignored.
Definition at line 1659 of file depends.c. References _, _free(), badDeps, badDeps_s::pname, poptParseArgvString(), badDeps_s::qname, rpmExpand(), RPMMESS_DEBUG, rpmMessage, xcalloc(), and xstrdup(). Referenced by addRelation(). |
|
Compare two available index entries by name (qsort/bsearch).
Definition at line 428 of file depends.c. References availableIndexEntry::entry, and availableIndexEntry::entryLen. Referenced by alAllSatisfiesDepend(), and alMakeIndex(). |
|
Compare removed package instances (qsort/bsearch).
Definition at line 748 of file depends.c. Referenced by removePackage(). |
|
Recursively mark all nodes with their predecessors.
Definition at line 1711 of file depends.c. References availablePackage::tsi, tsortInfo_s::tsi_next, and tsortInfo_s::tsi_pkg. Referenced by rpmdepOrder(). |
|
Compare ordered list entries by index (qsort/bsearch).
Definition at line 1871 of file depends.c. Referenced by rpmdepOrder(). |
|
Split EVR into epoch, version, and release components.
Definition at line 489 of file depends.c. References xisdigit(). Referenced by rpmRangesOverlap(). |
|
Return formatted dependency string.
Definition at line 62 of file depends.c. References RPMSENSE_EQUAL, RPMSENSE_GREATER, RPMSENSE_LESS, RPMSENSE_SENSEMASK, and xmalloc(). Referenced by checkPackageDeps(), rpmRangesOverlap(), and zapRelation(). |
|
Definition at line 609 of file depends.c. References rpmRangesOverlap(), RPMSENSE_SENSEMASK, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, and RPMTAG_PROVIDEVERSION. Referenced by unsatisfiedDepend(). |
|
Add removed package instance to ordered transaction set.
Definition at line 763 of file depends.c. References rpmTransactionSet_s::allocedRemovedPackages, transactionElement_s::dboffset, rpmTransactionSet_s::delta, transactionElement_s::dependsOnIndex, intcmp(), rpmTransactionSet_s::numRemovedPackages, rpmTransactionSet_s::order, rpmTransactionSet_s::orderAlloced, rpmTransactionSet_s::orderCount, transactionElement_s::removed, rpmTransactionSet_s::removedPackages, transactionElement_s::type, transactionElement_s::u, and xrealloc(). Referenced by rpmtransAddPackage(), and rpmtransRemovePackage(). |
|
Close a single database index.
Definition at line 2231 of file depends.c. References dbiClose(), dbiTags, and dbiTagsMax. Referenced by rpmdepCheck(). |
|
Check key for an unsatisfied dependency.
Definition at line 1188 of file depends.c. References _, _cacheDependsRC, rpmTransactionSet_s::addedPackages, alAllSatisfiesDepend(), alSatisfiesDepend(), rpmTransactionSet_s::availablePackages, DBC, DBI_WRITECURSOR, dbiCclose(), dbiCopen(), dbiGet(), dbiOpen(), dbiPut(), rpmTransactionSet_s::numRemovedPackages, rangeMatchesDepFlags(), rpmTransactionSet_s::removedPackages, rpmCheckRpmlibProvides(), rpmTransactionSet_s::rpmdb, rpmdbFreeIterator(), RPMDBI_DEPENDS, rpmdbInitIterator(), rpmdbNextIterator(), rpmdbPruneIterator(), rpmGetVar(), RPMMESS_DEBUG, rpmMessage, RPMSENSE_SENSEMASK, RPMTAG_BASENAMES, RPMTAG_NAME, RPMTAG_PROVIDENAME, RPMVAR_PROVIDES, and xisspace(). Referenced by checkPackageDeps(). |
|
Find (and eliminate co-requisites) "q <- p" relation in dependency loop. Search all successors of q for instance of p. Format the specific relation, (e.g. p contains "Requires: q"). Unlink and free co-requisite (i.e. pure Requires: dependencies) successor node(s).
Definition at line 1760 of file depends.c. References _, _free(), identifyDepend(), printDepend(), RPMMESS_DEBUG, rpmMessage, RPMSENSE_PREREQ, tsortInfo_s::tsi_next, and tsortInfo_s::tsi_reqx. Referenced by rpmdepOrder(). |
|
Definition at line 29 of file depends.c. Referenced by rpmdepCheck(), and unsatisfiedDepend(). |
|
|
|
Definition at line 1649 of file depends.c. Referenced by ignoreDep(). |
|
Definition at line 526 of file depends.c. Referenced by printVersion(). |
|
|
|
|