rpm
5.4.15
|
#include "system.h"
#include <rpmio.h>
#include <rpmlog.h>
#include <rpmmacro.h>
#include <popt.h>
#include <rpmtypes.h>
#include <rpmtag.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 | scc_s |
struct | badDeps_s |
struct | sccData_s |
Macros | |
#define | _RPMEVR_INTERNAL |
#define | _RPMTE_INTERNAL |
#define | _RPMTS_ORDER_INTERNAL |
#define | _RPMTS_INTERNAL |
#define | isLegacyPreReq(_x) (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ) |
#define | isAuto(_x) ((_x) & _autobits) |
Typedefs | |
typedef rpmuint32_t | rpm_color_t |
typedef struct orderListIndex_s * | orderListIndex |
typedef struct scc_s * | scc |
typedef struct sccData_s * | sccData |
Functions | |
static void | freeBadDeps (void) |
static int | ignoreDep (const rpmts ts, const rpmte p, const rpmte q) |
Check for dependency relations to be ignored. More... | |
static void | markLoop (tsortInfo tsi, rpmte q) |
Recursively mark all nodes with their predecessors. More... | |
static const char * | identifyDepend (rpmuint32_t f) |
static const char * | zapRelation (rpmte q, rpmte p, int zap, int *nzaps, int msglvl) |
Find (and eliminate co-requisites) "q <- p" relation in dependency loop. More... | |
static int | orgrpmAddRelation (rpmts ts, rpmal al, rpmte p, rpmds requires) |
Record next "q <- p" relation (i.e. More... | |
static int | addRelation (rpmts ts, rpmal al, rpmte p, unsigned char *selected, rpmds requires) |
Record next "q <- p" relation (i.e. More... | |
static int | orderListIndexCmp (const void *one, const void *two) |
Compare ordered list entries by index (qsort/bsearch). More... | |
static void | addQ (rpmte p, rpmte *qp, rpmte *rp, rpmuint32_t prefcolor) |
Add element to list sorting by tsi_qcnt. More... | |
static void | tarjan (sccData sd, rpmte p) |
static scc | detectSCCs (rpmts ts) |
static void | collectTE (rpm_color_t prefcolor, rpmte q, rpmte *newOrder, int *newOrderCount, scc SCCs, rpmte *queue_end, rpmte *outer_queue, rpmte *outer_queue_end) |
static void | collectSCC (rpm_color_t prefcolor, rpmte p, rpmte *newOrder, int *newOrderCount, scc SCCs, rpmte *queue_end) |
int | _orgrpmtsOrder (rpmts ts) |
int | _rpmtsOrder (rpmts ts) |
Variables | |
static int | badDepsInitialized |
static struct badDeps_s * | badDeps |
static rpmuint32_t | _autobits = 0xffffffff |
int(* | rpmtsOrder )(rpmts ts) = _rpmtsOrder |
Determine package order in a transaction set according to dependencies. More... | |
#define isAuto | ( | _x | ) | ((_x) & _autobits) |
Definition at line 863 of file order.c.
Referenced by _rpmtsOrder().
#define isLegacyPreReq | ( | _x | ) | (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ) |
Referenced by orgrpmAddRelation().
typedef struct orderListIndex_s* orderListIndex |
typedef rpmuint32_t rpm_color_t |
int _orgrpmtsOrder | ( | rpmts | ts | ) |
Definition at line 1568 of file order.c.
References _free(), addQ(), collectSCC(), collectTE(), scc_s::count, detectSCCs(), freeBadDeps(), i, j, key, scc_s::members, orgrpmAddRelation(), RPMAL_NOMATCH, rpmalAdd(), rpmalFree(), rpmalMakeIndex(), rpmdsFromPRCO(), rpmdsInit(), rpmdsN(), rpmdsNext(), rpmlog(), RPMLOG_DEBUG, rpmswEnter(), rpmswExit(), RPMTAG_BASENAMES, RPMTAG_DIRNAMES, RPMTAG_FILELINKTOS, RPMTAG_NAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, rpmteDS(), rpmteFI(), rpmteFreeTSI(), rpmteNewTSI(), rpmteSetAddedKey(), rpmteSetDepth(), rpmteSetNpreds(), rpmteSetTree(), rpmteTSI(), rpmteType(), RPMTS_OP_ORDER, rpmtsColor(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), rpmtsOp(), rpmtsPrefColor(), TR_ADDED, TR_REMOVED, and xcalloc().
int _rpmtsOrder | ( | rpmts | ts | ) |
Definition at line 1777 of file order.c.
References _, _free(), _rpmts_debug, addQ(), addRelation(), alloca(), D_, depth, detectSCCs(), freeBadDeps(), i, isAuto, j, key, markLoop(), scc_s::members, orderListIndexCmp(), orgrpmAddRelation(), orderListIndex_s::orIndex, orderListIndex_s::pkgKey, RPMAL_NOMATCH, rpmalAdd(), rpmalFree(), rpmalMakeIndex(), RPMDEPS_FLAG_ANACONDA, RPMDEPS_FLAG_DEPLOOPS, rpmdsFlags(), rpmdsFromPRCO(), rpmdsInit(), rpmdsNext(), rpmExpandNumeric(), rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, RPMLOG_WARNING, RPMPROB_FILTER_NONE, rpmswEnter(), rpmswExit(), RPMTAG_BASENAMES, RPMTAG_DIRNAMES, RPMTAG_FILELINKTOS, RPMTAG_NAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, rpmteAddedKey(), rpmteDegree(), rpmteDepth(), rpmteDS(), rpmteFI(), rpmteFreeTSI(), rpmteNEVRA(), rpmteNewTSI(), rpmteNpreds(), rpmtePkgFileSize(), rpmteSetAddedKey(), rpmteSetBreadth(), rpmteSetDegree(), rpmteSetDepth(), rpmteSetNpreds(), rpmteSetParent(), rpmteSetTree(), rpmteTree(), rpmteTSI(), rpmteType(), RPMTS_OP_ORDER, rpmtsClean(), rpmtsColor(), rpmtsDFlags(), rpmtsFlags(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), rpmtsiOc(), rpmtsOp(), rpmtsPrefColor(), rpmtsRollback(), rpmtsUnorderedSuccessors(), TR_ADDED, TR_REMOVED, xcalloc(), and zapRelation().
|
static |
Add element to list sorting by tsi_qcnt.
p | new element |
*qp | first element |
*rp | last element |
prefcolor | preferred color |
Definition at line 802 of file order.c.
References rpmteColor(), rpmteTSI(), rpmteType(), and TR_REMOVED.
Referenced by _orgrpmtsOrder(), _rpmtsOrder(), collectSCC(), and collectTE().
|
inlinestatic |
Record next "q <- p" relation (i.e.
"p" requires "q").
ts | transaction set |
al | added/erased package index |
p | predecessor (i.e. package that "Requires: q") |
selected | boolean package selected array |
requires | relation |
Definition at line 623 of file order.c.
References fi, i, ignoreDep(), key, RPMAL_NOMATCH, rpmalSatisfiesDepend(), rpmbfChk(), rpmdsIx(), rpmdsN(), rpmdsNSType(), rpmdsTagN(), rpmfiFNBF(), RPMNS_TYPE_ACCESS, RPMNS_TYPE_CONFIG, RPMNS_TYPE_CPUINFO, RPMNS_TYPE_DIGEST, RPMNS_TYPE_DISKSPACE, RPMNS_TYPE_ENVVAR, RPMNS_TYPE_GETCONF, RPMNS_TYPE_GNUPG, RPMNS_TYPE_GROUP, RPMNS_TYPE_MACRO, RPMNS_TYPE_MOUNTED, RPMNS_TYPE_RPMLIB, RPMNS_TYPE_RUNNING, RPMNS_TYPE_SANITY, RPMNS_TYPE_SIGNATURE, RPMNS_TYPE_SONAME, RPMNS_TYPE_UNAME, RPMNS_TYPE_USER, RPMNS_TYPE_VCHECK, RPMTAG_BASENAMES, rpmteAddedKey(), rpmteDepth(), rpmteFI(), rpmteSetDepth(), rpmteTSI(), rpmteType(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), TR_REMOVED, and xcalloc().
Referenced by _rpmtsOrder().
|
static |
Definition at line 1345 of file order.c.
References _free(), addQ(), collectTE(), i, scc_s::members, rpmteTSI(), scc_s::size, and xmalloc.
Referenced by _orgrpmtsOrder().
|
static |
Definition at line 1166 of file order.c.
References addQ(), scc_s::count, rpmlog(), RPMLOG_DEBUG, rpmteDegree(), rpmteDepth(), rpmteNEVRA(), rpmteNpreds(), rpmteSetDegree(), rpmteSetDepth(), rpmteSetParent(), rpmteSetTree(), rpmteTree(), rpmteTSI(), rpmteType(), and TR_REMOVED.
Referenced by _orgrpmtsOrder(), and collectSCC().
Definition at line 1023 of file order.c.
References _free(), scc_s::count, i, j, scc_s::members, RPMDEPS_FLAG_ANACONDA, RPMDEPS_FLAG_DEPLOOPS, rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, RPMLOG_WARNING, rpmteNEVRA(), rpmteTSI(), rpmtsDFlags(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), sccData_s::sccCnt, sccData_s::SCCs, scc_s::size, sccData_s::stack, tarjan(), xcalloc(), and xrealloc.
Referenced by _orgrpmtsOrder(), and _rpmtsOrder().
|
static |
Definition at line 106 of file order.c.
References _free(), badDeps_s::pname, and badDeps_s::qname.
Referenced by _orgrpmtsOrder(), and _rpmtsOrder().
|
inlinestatic |
Definition at line 304 of file order.c.
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 129 of file order.c.
References _, _free(), i, badDeps_s::pname, badDeps_s::qname, RPMDEPS_FLAG_ANACONDA, RPMDEPS_FLAG_DEPLOOPS, rpmExpand(), rpmlog(), RPMLOG_DEBUG, RPMLOG_WARNING, rpmteN(), rpmtsDFlags(), xcalloc(), and xstrdup().
Referenced by addRelation(), and orgrpmAddRelation().
Recursively mark all nodes with their predecessors.
tsi | successor chain |
q | predecessor |
Definition at line 280 of file order.c.
References rpmteTSI().
Referenced by _rpmtsOrder().
|
static |
Compare ordered list entries by index (qsort/bsearch).
one | 1st ordered list entry |
two | 2nd ordered list entry |
Definition at line 738 of file order.c.
Referenced by _rpmtsOrder().
Record next "q <- p" relation (i.e.
"p" requires "q").
ts | transaction set |
al | |
p | predecessor (i.e. package that "Requires: q") |
requires | relation |
Definition at line 454 of file order.c.
References fi, flags, i, ignoreDep(), isLegacyPreReq, key, RPMAL_NOMATCH, rpmalSatisfiesDepend(), rpmbfChk(), rpmdsFlags(), rpmdsN(), rpmdsNSType(), rpmfiFNBF(), RPMNS_TYPE_ACCESS, RPMNS_TYPE_CONFIG, RPMNS_TYPE_CPUINFO, RPMNS_TYPE_DIGEST, RPMNS_TYPE_DISKSPACE, RPMNS_TYPE_ENVVAR, RPMNS_TYPE_GETCONF, RPMNS_TYPE_GNUPG, RPMNS_TYPE_GROUP, RPMNS_TYPE_MACRO, RPMNS_TYPE_MOUNTED, RPMNS_TYPE_RPMLIB, RPMNS_TYPE_RUNNING, RPMNS_TYPE_SANITY, RPMNS_TYPE_SIGNATURE, RPMNS_TYPE_SONAME, RPMNS_TYPE_UNAME, RPMNS_TYPE_USER, RPMNS_TYPE_VCHECK, RPMTAG_BASENAMES, rpmteAddedKey(), rpmteDepth(), rpmteFI(), rpmteSetDepth(), rpmteTSI(), rpmteType(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), TR_ADDED, TR_REMOVED, and xcalloc().
Referenced by _orgrpmtsOrder(), and _rpmtsOrder().
Definition at line 945 of file order.c.
References scc_s::count, sccData_s::index, scc_s::members, rpmteTSI(), sccData_s::sccCnt, sccData_s::SCCs, scc_s::size, sccData_s::stack, sccData_s::stackcnt, and xcalloc().
Referenced by detectSCCs().
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 | successor (i.e. package required by p) |
p | predecessor (i.e. package that "Requires: q") |
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 339 of file order.c.
References _, _free(), identifyDepend(), rpmdsFlags(), rpmdsNewDNEVR(), rpmdsSetIx(), rpmlog(), rpmteDS(), rpmteNEVRA(), rpmteTSI(), rpmteType(), and TR_REMOVED.
Referenced by _rpmtsOrder().
|
static |
int(* rpmtsOrder)(rpmts ts) = _rpmtsOrder |
Determine package order in a transaction set according to dependencies.
Order packages, returning error if circular dependencies cannot be eliminated by removing Requires's from the loop(s). Only dependencies from added or removed packages are used to determine ordering using a topological sort (Knuth vol. 1, p. 262). Use rpmtsCheck() to verify that all dependencies can be resolved.
The final order ends up as installed packages followed by removed packages, with packages removed for upgrades immediately following the new package to be installed.
ts | transaction set |
Definition at line 2311 of file order.c.
Referenced by rpmcliInstallOrder(), and rpmts_Order().