#include "system.h"
#include <rpmcli.h>
#include <rpmmacro.h>
#include "rpmdb.h"
#include "rpmds.h"
#include "rpmfi.h"
#include "rpmte.h"
#include "rpmts.h"
#include "debug.h"
Go to the source code of this file.
Data Structures | |
struct | orderListIndex_s |
struct | badDeps_s |
Defines | |
#define | _RPMTE_INTERNAL |
#define | _RPMTS_INTERNAL |
Typedefs | |
typedef orderListIndex_s * | orderListIndex |
Functions | |
static int | intcmp (const void *a, const void *b) |
Compare removed package instances (qsort/bsearch). | |
static int | removePackage (rpmts ts, Header h, int dboffset, alKey depends) |
Add removed package instance to ordered transaction set. | |
int | rpmtsAddInstallElement (rpmts ts, Header h, fnpyKey key, int upgrade, rpmRelocation *relocs) |
Add package to be installed to transaction set. | |
int | rpmtsAddEraseElement (rpmts ts, Header h, int dboffset) |
Add package to be erased to transaction set. | |
static int | unsatisfiedDepend (rpmts ts, rpmds dep, int adding) |
Check dep for an unsatisfied dependency. | |
static int | checkPackageDeps (rpmts ts, const char *pkgNEVRA, rpmds requires, rpmds conflicts, const char *depName, uint_32 tscolor, int adding) |
Check added requires/conflicts against against installed+added packages. | |
static int | checkPackageSet (rpmts ts, const char *dep, rpmdbMatchIterator mi, int adding) |
Check dependency against installed packages. | |
static int | checkDependentPackages (rpmts ts, const char *dep) |
Check to-be-erased dependencies against installed requires. | |
static int | checkDependentConflicts (rpmts ts, const char *dep) |
Check to-be-added dependencies against installed conflicts. | |
static void | freeBadDeps (void) |
static int | ignoreDep (const rpmts ts, const rpmte p, const rpmte q) |
Check for dependency relations to be ignored. | |
static void | markLoop (tsortInfo tsi, rpmte q) |
Recursively mark all nodes with their predecessors. | |
static const char *const | identifyDepend (int_32 f) |
static const char * | zapRelation (rpmte q, rpmte p, rpmds requires, int zap, int *nzaps, int msglvl) |
Find (and eliminate co-requisites) "q <- p" relation in dependency loop. | |
static int | addRelation (rpmts ts, rpmte p, unsigned char *selected, rpmds requires) |
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 (rpmte p, rpmte *qp, rpmte *rp, uint_32 prefcolor) |
Add element to list sorting by tsi_qcnt. | |
int | rpmtsOrder (rpmts ts) |
Determine package order in a transaction set according to dependencies. | |
int | rpmtsCheck (rpmts ts) |
Check that all dependencies can be resolved. | |
Variables | |
int | _cacheDependsRC = 1 |
const char * | rpmNAME = PACKAGE |
const char * | rpmEVR = VERSION |
int | rpmFLAGS = RPMSENSE_EQUAL |
static int | badDepsInitialized = 0 |
static struct badDeps_s * | badDeps = NULL |
Definition in file depends.c.
typedef struct orderListIndex_s* orderListIndex |
Add element to list sorting by tsi_qcnt.
p | new element |
qp | address of first element | |
rp | address of last element |
Definition at line 1161 of file depends.c.
References rpmteColor(), and rpmteTSI().
Referenced by rpmtsOrder().
static int addRelation | ( | rpmts | ts, | |
rpmte | p, | |||
unsigned char * | selected, | |||
rpmds | requires | |||
) | [inline, static] |
Record next "q <- p" relation (i.e.
"p" requires "q").
ts | transaction set | |
p | predecessor (i.e. package that "Requires: q") | |
selected | boolean package selected array | |
requires | relation |
Definition at line 1056 of file depends.c.
References ignoreDep(), RPMAL_NOMATCH, rpmalSatisfiesDepend(), rpmdsIx(), rpmdsN(), rpmteAddedKey(), rpmteDepth(), rpmteSetDepth(), rpmteTSI(), rpmteType(), rpmtsiFree, rpmtsiInit, rpmtsiNext(), TR_REMOVED, and xcalloc().
Referenced by rpmtsOrder().
static int checkDependentConflicts | ( | rpmts | ts, | |
const char * | dep | |||
) | [static] |
Check to-be-added dependencies against installed conflicts.
ts | transaction set | |
dep | conflicts name |
Definition at line 806 of file depends.c.
References checkPackageSet(), RPMTAG_CONFLICTNAME, rpmtsGetRdb(), and rpmtsInitIterator().
Referenced by rpmtsCheck().
static int checkDependentPackages | ( | rpmts | ts, | |
const char * | dep | |||
) | [static] |
Check to-be-erased dependencies against installed requires.
ts | transaction set | |
dep | requires name |
Definition at line 791 of file depends.c.
References checkPackageSet(), RPMTAG_REQUIRENAME, and rpmtsInitIterator().
Referenced by rpmtsCheck().
static int checkPackageDeps | ( | rpmts | ts, | |
const char * | pkgNEVRA, | |||
rpmds | requires, | |||
rpmds | conflicts, | |||
const char * | depName, | |||
uint_32 | tscolor, | |||
int | adding | |||
) | [static] |
Check added requires/conflicts against against installed+added packages.
ts | transaction set | |
pkgNEVRA | package name-version-release.arch | |
requires | Requires: dependencies (or NULL) | |
conflicts | Conflicts: dependencies (or NULL) | |
depName | dependency name to filter (or NULL) | |
tscolor | color bits for transaction set (0 disables) | |
adding | dependency is from added package set? |
Definition at line 649 of file depends.c.
References rpmalAllSatisfiesDepend(), rpmdsColor(), rpmdsInit(), rpmdsN(), rpmdsNext(), rpmdsProblem(), and unsatisfiedDepend().
Referenced by checkPackageSet(), and rpmtsCheck().
static int checkPackageSet | ( | rpmts | ts, | |
const char * | dep, | |||
rpmdbMatchIterator | mi, | |||
int | adding | |||
) | [static] |
Check dependency against installed packages.
Adding: check name/provides dep against each conflict match, Erasing: check name/provides/filename dep against each requiredby match.
ts | transaction set | |
dep | dependency name | |
mi | rpm database iterator | |
adding | dependency is from added package set? |
Definition at line 749 of file depends.c.
References _free(), _rpmds_nopromote, checkPackageDeps(), hGetNEVRA(), rpmdbFreeIterator(), rpmdbNextIterator(), rpmdbPruneIterator(), rpmdsFree(), rpmdsNew(), rpmdsSetNoPromote(), RPMTAG_CONFLICTNAME, and RPMTAG_REQUIRENAME.
Referenced by checkDependentConflicts(), and checkDependentPackages().
static void freeBadDeps | ( | void | ) | [static] |
Definition at line 846 of file depends.c.
References _free(), badDeps, badDepsInitialized, badDeps_s::pname, and badDeps_s::qname.
Referenced by rpmtsOrder().
static const char* const identifyDepend | ( | int_32 | f | ) | [inline, static] |
Definition at line 952 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.
ts | transaction set | |
p | successor element (i.e. with Requires: ) | |
q | predecessor element (i.e. with Provides: ) |
Definition at line 869 of file depends.c.
References _, _free(), badDeps, badDepsInitialized, badDeps_s::pname, badDeps_s::qname, rpmExpand(), RPMMESS_DEBUG, RPMMESS_WARNING, rpmMessage, rpmteN(), RPMTRANS_FLAG_ANACONDA, RPMTRANS_FLAG_DEPLOOPS, rpmtsFlags(), xcalloc(), and xstrdup().
Referenced by addRelation().
static int intcmp | ( | const void * | a, | |
const void * | b | |||
) | [static] |
Compare removed package instances (qsort/bsearch).
a | 1st instance address | |
b | 2nd instance address |
Definition at line 62 of file depends.c.
Referenced by removePackage().
Recursively mark all nodes with their predecessors.
tsi | successor chain | |
q | predecessor |
Definition at line 931 of file depends.c.
References rpmteTSI().
Referenced by rpmtsOrder().
static int orderListIndexCmp | ( | const void * | one, | |
const void * | two | |||
) | [static] |
Compare ordered list entries by index (qsort/bsearch).
one | 1st ordered list entry | |
two | 2nd ordered list entry |
Definition at line 1144 of file depends.c.
Referenced by rpmtsOrder().
Add removed package instance to ordered transaction set.
ts | transaction set | |
h | header | |
dboffset | rpm database instance | |
depends | installed package of pair (or RPMAL_NOMATCH on erase) |
Definition at line 79 of file depends.c.
References intcmp(), rpmteNew(), TR_REMOVED, and xrealloc().
Referenced by rpmtsAddEraseElement(), and rpmtsAddInstallElement().
Check dep for an unsatisfied dependency.
ts | transaction set | |
dep | dependency | |
adding | dependency is from added package set? |
Definition at line 405 of file depends.c.
References _, _cacheDependsRC, _rpmds_nopromote, alloca(), _dbiIndex::dbi_txnid, dbiCclose(), dbiCopen(), dbiGet(), dbiOpen(), dbiPut(), rpmalMakeIndex(), rpmalSatisfiesDepend(), rpmCheckRpmlibProvides(), rpmdbFreeIterator(), RPMDBI_DEPENDS, rpmdbNextIterator(), rpmdbPruneIterator(), rpmdsAnyMatchesDep(), rpmdsDNEVR(), rpmdsFlags(), rpmdsN(), rpmdsNotify(), rpmGetVar(), RPMSENSE_SENSEMASK, RPMTAG_BASENAMES, RPMTAG_NAME, RPMTAG_PROVIDENAME, RPMTRANS_FLAG_NOSUGGEST, rpmtsFlags(), rpmtsGetRdb(), rpmtsInitIterator(), RPMVAR_PROVIDES, and xisspace().
Referenced by checkPackageDeps().
static const char* zapRelation | ( | rpmte | q, | |
rpmte | p, | |||
rpmds | requires, | |||
int | zap, | |||
int * | nzaps, | |||
int | msglvl | |||
) | [static] |
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).
q | sucessor (i.e. package required by p) | |
p | predecessor (i.e. package that "Requires: q") | |
requires | relation | |
zap | max. no. of co-requisites to remove (-1 is all)? |
nzaps | address of no. of relations removed |
msglvl | message level at which to spew |
Definition at line 989 of file depends.c.
References _, _free(), identifyDepend(), rpmdsFlags(), rpmdsNewDNEVR(), rpmdsSetIx(), rpmMessage, RPMSENSE_PREREQ, rpmteNEVRA(), and rpmteTSI().
Referenced by rpmtsOrder().
int _cacheDependsRC = 1 |
int badDepsInitialized = 0 [static] |
const char* rpmEVR = VERSION |