rpm
5.4.10
|
#include "system.h"
#include <rpmio.h>
#include <rpmiotypes.h>
#include <rpmcb.h>
#include <rpmbf.h>
#include <rpmmacro.h>
#include <envvar.h>
#include <ugid.h>
#include <rpmtag.h>
#include <rpmdb.h>
#include <rpmds.h>
#include <rpmfi.h>
#include <rpmte.h>
#include <rpmcli.h>
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | _RPMDB_INTERNAL /* XXX response cache needs dbiOpen et al. */ |
#define | _RPMEVR_INTERNAL |
#define | _RPMTE_INTERNAL |
#define | _RPMTS_INTERNAL |
#define | CACHE_DEPENDENCY_RESULT 1 |
Functions | |
static int | uintcmp (const void *a, const void *b) |
Compare removed package instances (qsort/bsearch). More... | |
static int | removePackage (rpmts ts, Header h, uint32_t hdrNum, int *indexp, alKey depends) |
Add removed package instance to ordered transaction set. More... | |
static int | rpmHeadersIdentical (Header first, Header second) |
Are two headers identical? More... | |
static int | rpmtsAddUpgrades (rpmts ts, rpmte p, rpmuint32_t hcolor, Header h) |
Add upgrade erasures to a transaction set. More... | |
static int | chkSuffix (const char *fn, const char *suffix) |
Check string for a suffix. More... | |
static int | rpmtsEraseDebuginfo (rpmts ts, rpmte p, Header h, alKey pkgKey) |
Add unreferenced debuginfo erasures to a transaction set. More... | |
static int | rpmtsAddObsoletes (rpmts ts, rpmte p, rpmuint32_t hcolor) |
Add Obsoletes: erasures to a transaction set. More... | |
int | rpmtsAddInstallElement (rpmts ts, Header h, fnpyKey key, int upgrade, rpmRelocation relocs) |
Add package to be installed to transaction set. More... | |
int | rpmtsAddEraseElement (rpmts ts, Header h, uint32_t hdrNum) |
Add package to be erased to transaction set. More... | |
void | rpmnsClean (void) |
Clean global name space dependency sets. More... | |
static int | unsatisfiedDepend (rpmts ts, rpmds dep, int adding) |
Check dep for an unsatisfied dependency. More... | |
static int | checkPackageDeps (rpmts ts, const char *pkgNEVRA, rpmds requires, rpmds conflicts, rpmds dirnames, rpmds linktos, const char *depName, rpmuint32_t tscolor, int adding) |
Check added requires/conflicts against against installed+added packages. More... | |
static int | checkPackageSet (rpmts ts, const char *depName, rpmmi mi, int adding) |
Check dependency against installed packages. More... | |
static int | checkDependentPackages (rpmts ts, const char *depName) |
Check to-be-erased dependencies against installed requires. More... | |
static int | checkDependentConflicts (rpmts ts, const char *depName) |
Check to-be-added dependencies against installed conflicts. More... | |
int | _rpmtsCheck (rpmts ts) |
Variables | |
int | _cacheDependsRC = 1 |
const char * | rpmNAME = PACKAGE |
const char * | rpmEVR = VERSION |
int | rpmFLAGS = RPMSENSE_EQUAL |
static rpmTag | _upgrade_tag |
static rpmTag | _debuginfo_tag |
static rpmTag | _obsolete_tag |
static char * | sysinfo_path = NULL |
static rpmds | rpmlibP = NULL |
rpmds | cpuinfoP = NULL |
static rpmds | getconfP = NULL |
static rpmds | unameP = NULL |
int(* | rpmtsCheck )(rpmts ts) = _rpmtsCheck |
Perform dependency resolution on the transaction set. More... | |
#define _RPMDB_INTERNAL /* XXX response cache needs dbiOpen et al. */ |
int _rpmtsCheck | ( | rpmts | ts | ) |
Definition at line 1891 of file depends.c.
References _cacheDependsRC, _free(), _rpmts_debug, checkDependentConflicts(), checkDependentPackages(), checkPackageDeps(), L, rpmalMakeIndex(), rpmdbCloseDBI(), RPMDBI_DEPCACHE, RPMDEPS_FLAG_NOCONFLICTS, RPMDEPS_FLAG_NOLINKTOS, RPMDEPS_FLAG_NOPARENTDIRS, RPMDEPS_FLAG_NOREQUIRES, rpmdsEVR(), rpmdsFromPRCO(), rpmdsInit(), rpmdsN(), rpmdsNegateRC(), rpmdsNext(), rpmdsNSType(), rpmfiFN(), rpmfiInit(), rpmfiNext(), rpmlog(), RPMLOG_DEBUG, rpmmiFree(), RPMNS_TYPE_ENVVAR, RPMPROB_FILTER_NONE, rpmpsFree(), rpmpsNumProblems(), rpmswEnter(), rpmswExit(), RPMTAG_BASENAMES, RPMTAG_CONFLICTNAME, RPMTAG_DIRNAMES, RPMTAG_FILELINKTOS, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, rpmteA(), rpmteColor(), rpmteDS(), rpmteFI(), rpmteNEVR(), rpmteNEVRA(), rpmteO(), RPMTS_OP_CHECK, rpmtsCloseDB(), rpmtsColor(), rpmtsDBMode(), rpmtsDFlags(), rpmtsFlags(), rpmtsGetRdb(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), rpmtsOp(), rpmtsOpenDB(), rpmtsPRCO(), rpmtsProblems(), rpmtsRollback(), TR_ADDED, TR_REMOVED, and xstrdup().
|
static |
Check to-be-added dependencies against installed conflicts.
ts | transaction set |
depName | conflicts name |
Definition at line 1875 of file depends.c.
References checkPackageSet(), RPMTAG_CONFLICTNAME, rpmtsGetRdb(), and rpmtsInitIterator().
Referenced by _rpmtsCheck().
|
static |
Check to-be-erased dependencies against installed requires.
ts | transaction set |
depName | requires name |
Definition at line 1854 of file depends.c.
References checkPackageSet(), RPMTAG_REQUIRENAME, rpmtsGetRdb(), and rpmtsInitIterator().
Referenced by _rpmtsCheck().
|
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) |
dirnames | Dirnames: dependencies (or NULL) |
linktos | Filelinktos: 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 1574 of file depends.c.
References rpmalAllSatisfiesDepend(), rpmdsColor(), rpmdsInit(), rpmdsN(), rpmdsNext(), rpmdsProblem(), rpmExpandNumeric(), rpmpsFree(), rpmtsProblems(), and unsatisfiedDepend().
Referenced by _rpmtsCheck(), and checkPackageSet().
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 |
depName | dependency name |
mi | rpm database iterator |
adding | dependency is from added package set? |
Definition at line 1781 of file depends.c.
References _free(), _rpmds_nopromote, alloca(), checkPackageDeps(), headerGet(), _HE_s::p, RPMDEPS_FLAG_NOCONFLICTS, RPMDEPS_FLAG_NOLINKTOS, RPMDEPS_FLAG_NOPARENTDIRS, RPMDEPS_FLAG_NOREQUIRES, rpmdsFree(), rpmdsNew(), rpmdsSetNoPromote(), rpmmiFree(), rpmmiNext(), rpmmiPrune(), RPMTAG_CONFLICTNAME, RPMTAG_DIRNAMES, RPMTAG_FILELINKTOS, RPMTAG_NVRA, RPMTAG_REQUIRENAME, rpmtsColor(), rpmtsDFlags(), rpmDataType_u::str, and _HE_s::tag.
Referenced by checkDependentConflicts(), and checkDependentPackages().
|
inlinestatic |
Check string for a suffix.
fn | string |
suffix | suffix |
Definition at line 318 of file depends.c.
Referenced by dsort(), mtreeCWalk(), mtreeVWalk(), rpmtsAddInstallElement(), and rpmtsEraseDebuginfo().
|
static |
Add removed package instance to ordered transaction set.
ts | transaction set |
h | header |
hdrNum | rpm database instance |
*indexp | removed element index (if not NULL) |
depends | installed package of pair (or RPMAL_NOMATCH on erase) |
Definition at line 80 of file depends.c.
References rpmfiFC(), RPMTAG_BASENAMES, rpmteFI(), rpmteNew(), TR_REMOVED, uintcmp(), and xrealloc.
Referenced by rpmtsAddEraseElement(), rpmtsAddObsoletes(), rpmtsAddUpgrades(), and rpmtsEraseDebuginfo().
Are two headers identical?
first | first header |
second | second header |
Definition at line 153 of file depends.c.
References _free(), alloca(), headerGet(), _HE_s::p, rpmdsCompare(), rpmdsFree(), rpmdsThis(), RPMSENSE_EQUAL, RPMTAG_HDRID, RPMTAG_REQUIRENAME, rpmDataType_u::str, and _HE_s::tag.
Referenced by rpmtsAddUpgrades(), and rpmtsEraseDebuginfo().
void rpmnsClean | ( | void | ) |
Clean global name space dependency sets.
Definition at line 863 of file depends.c.
References _free(), _sysinfo_path, cpuinfoP, getconfP, rpmdsFree(), rpmlibP, sysinfo_path, and unameP.
Referenced by rpmcliFini().
Add package to be erased to transaction set.
ts | transaction set |
h | header |
hdrNum | rpm database instance |
Definition at line 839 of file depends.c.
References removePackage(), RPMAL_NOMATCH, and rpmtsEraseDebuginfo().
Referenced by findErases(), rpmcliEraseElement(), rpmErase(), rpmgiNext(), rpmts_AddErase(), and verifyDependencies().
int rpmtsAddInstallElement | ( | rpmts | ts, |
Header | h, | ||
const fnpyKey | key, | ||
int | upgrade, | ||
rpmRelocation | relocs | ||
) |
Add package to be installed to transaction set.
The transaction set is checked for duplicate package names. If found, the package with the "newest" EVR will be replaced.
ts | transaction set |
h | header |
key | package retrieval key (e.g. file name) |
upgrade | is package being upgraded? |
relocs | package file relocations |
Definition at line 552 of file depends.c.
References _, _free(), alloca(), chkSuffix(), headerGet(), headerIsEntry(), hGetColor(), nplatpat, _HE_s::p, platform, platpat, rpmDataType_u::ptr, RPMAL_NOMATCH, rpmalAdd(), rpmcliPackagesTotal, RPMDEPS_FLAG_NOOBSOLETES, RPMDEPS_FLAG_NOUPGRADE, rpmdsCompare(), rpmdsDNEVR(), rpmdsFree(), rpmdsThis(), rpmExpand(), rpmExpandNumeric(), rpmfiFC(), rpmIsVerbose, rpmlog(), RPMLOG_WARNING, rpmPlatformScore(), RPMPROB_BADPLATFORM, rpmProblemString(), rpmpsAppend(), rpmpsFree(), rpmpsGetProblem(), RPMSENSE_EQUAL, RPMSENSE_GREATER, RPMSENSE_LESS, RPMTAG_ARCH, RPMTAG_BASENAMES, RPMTAG_NAME, RPMTAG_NVRA, RPMTAG_OS, RPMTAG_PLATFORM, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, RPMTAG_SOURCERPM, rpmteA(), rpmteAddedKey(), rpmteDS(), rpmteFI(), rpmteFree(), rpmteIsSource(), rpmteKey(), rpmteN(), rpmteNew(), rpmteO(), rpmteSetAddedKey(), rpmteSetHeader(), rpmteType(), rpmtsAddObsoletes(), rpmtsAddUpgrades(), rpmtsColor(), rpmtsDBMode(), rpmtsDFlags(), rpmtsEraseDebuginfo(), rpmtsGetRdb(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), rpmtsOpenDB(), rpmtsProblems(), rpmDataType_u::str, _HE_s::tag, TR_ADDED, TR_REMOVED, and xrealloc.
Referenced by rpmcliInstall(), rpmgiNext(), rpmInstallSourcePackage(), rpmRollback(), rpmts_AddInstall(), rpmtsSolve(), and verifyDependencies().
|
static |
Add Obsoletes: erasures to a transaction set.
ts | transaction set |
p | transaction element |
hcolor | header color |
Definition at line 422 of file depends.c.
References _free(), _obsolete_tag, _rpmds_nopromote, D_, hGetColor(), removePackage(), rpmdsAnyMatchesDep(), rpmdsColor(), rpmdsDNEVR(), rpmdsEVR(), rpmdsFree(), rpmdsInit(), rpmdsLink(), rpmdsN(), rpmdsNext(), rpmExpand(), rpmlog(), RPMLOG_DEBUG, rpmmiFree(), rpmmiInstance(), rpmmiNext(), rpmmiPrune(), RPMTAG_BASENAMES, RPMTAG_NAME, RPMTAG_OBSOLETENAME, RPMTAG_PROVIDENAME, rpmteAddedKey(), rpmteChain(), rpmteDS(), rpmteN(), rpmteNEVRA(), rpmtsColor(), rpmtsInitIterator(), and xisspace().
Referenced by rpmtsAddInstallElement().
|
static |
Add upgrade erasures to a transaction set.
ts | transaction set |
p | transaction element |
hcolor | header color |
h | header |
Definition at line 205 of file depends.c.
References _free(), _upgrade_tag, alloca(), _HE_s::c, D_, headerGet(), hGetColor(), _HE_s::p, rpmDataType_u::ptr, removePackage(), rpmExpand(), rpmHeadersIdentical(), rpmlog(), RPMLOG_DEBUG, rpmmiFree(), rpmmiInstance(), rpmmiNext(), RPMTAG_ARCH, RPMTAG_NAME, RPMTAG_ORIGINTID, RPMTAG_ORIGINTIME, RPMTAG_PROVIDENAME, rpmteAddedKey(), rpmteChain(), rpmteN(), rpmteNEVRA(), rpmtsColor(), rpmtsInitIterator(), rpmDataType_u::str, _HE_s::tag, and rpmDataType_u::ui32p.
Referenced by rpmtsAddInstallElement().
Add unreferenced debuginfo erasures to a transaction set.
ts | transaction set |
p | transaction element |
h | header |
pkgKey | added package key (erasure uses RPMAL_NOKEY) |
Definition at line 334 of file depends.c.
References _debuginfo_tag, _free(), alloca(), chkSuffix(), D_, headerFree(), headerGet(), headerLink(), _HE_s::p, removePackage(), RPMAL_NOMATCH, rpmExpand(), rpmHeadersIdentical(), rpmlog(), RPMLOG_DEBUG, rpmmiFree(), rpmmiInstance(), rpmmiNext(), rpmmiPrune(), RPMTAG_NAME, RPMTAG_SOURCEPKGID, RPMTAG_SOURCERPM, rpmteChain(), rpmteNEVRA(), rpmteSourcerpm(), rpmtsInitIterator(), rpmDataType_u::str, and _HE_s::tag.
Referenced by rpmtsAddEraseElement(), and rpmtsAddInstallElement().
|
static |
Compare removed package instances (qsort/bsearch).
a | 1st instance address |
b | 2nd instance address |
Definition at line 56 of file depends.c.
Referenced by removePackage().
Check dep for an unsatisfied dependency.
ts | transaction set |
dep | dependency |
adding | dependency is from added package set? |
Definition at line 888 of file depends.c.
References _, _cacheDependsRC, _free(), _rpmds_nopromote, alloca(), argvAdd(), argvFree(), argvSplit(), cpuinfoP, __db_dbt::data, DB_SET, DB_WRITECURSOR, dbiOpen(), errno, Fclose(), OpenFileInfo::fd, Ferror(), Fopen(), Fread(), getconfP, gidToGname(), gnameToGid(), headerIsEntry(), PGPHASHALGO_ERROR, PGPHASHALGO_MD5, pgpHashAlgoStringToNumber(), rpmQVKArguments_s::qva_flags, rpmQVKArguments_s::qva_mode, R_OK, rpmalMakeIndex(), rpmalSatisfiesDepend(), RPMDBI_DEPCACHE, RPMDBI_PACKAGES, RPMDEPS_FLAG_NOSUGGEST, RPMDIGEST_NONE, rpmDigestFinal(), rpmDigestInit(), rpmDigestUpdate(), rpmdsAnyMatchesDep(), rpmdsCpuinfo(), rpmdsDNEVR(), rpmdsELF(), rpmdsEVR(), rpmdsFlags(), rpmdsFree(), rpmdsFreePRCO(), rpmdsFromPRCO(), rpmdsGetconf(), rpmdsMergePRCO(), rpmdsN(), rpmdsNegateRC(), rpmdsNewPRCO(), rpmdsNotify(), rpmdsNSType(), rpmdsRpmlib(), rpmdsSearch(), rpmdsSingle(), rpmdsTagN(), rpmdsUname(), rpmExpand(), rpmExpandNumeric(), rpmGetPath(), rpmioAccess(), rpmlibP, rpmmiFree(), rpmmiNext(), rpmmiPrune(), RPMNS_TYPE_ACCESS, RPMNS_TYPE_CPUINFO, RPMNS_TYPE_DIGEST, RPMNS_TYPE_DISKSPACE, RPMNS_TYPE_ENVVAR, RPMNS_TYPE_FUNCTION, 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, RPMNS_TYPE_VERIFY, rpmnsProbeSignature(), RPMRC_OK, RPMSENSE_EQUAL, RPMSENSE_GREATER, RPMSENSE_LESS, RPMSENSE_NOTEQUAL, RPMSENSE_SENSEMASK, RPMTAG_BASENAMES, RPMTAG_DIRNAMES, RPMTAG_PROVIDENAME, RPMTAG_SANITYCHECK, RPMTAG_TRACK, rpmtsDFlags(), rpmtsGetRdb(), rpmtsInitDSI(), rpmtsInitIterator(), rpmtsPRCO(), showVerifyPackage(), __db_dbt::size, SYSCONFIGDIR, sysinfo_path, uidToUname(), unameP, unameToUid(), VERIFY_ALL, VERIFY_DEPS, VERIFY_SCRIPT, X_OK, xisdigit(), and xstrdup().
Referenced by checkPackageDeps().
int _cacheDependsRC = 1 |
Definition at line 38 of file depends.c.
Referenced by _rpmtsCheck(), and unsatisfiedDepend().
|
static |
Definition at line 193 of file depends.c.
Referenced by rpmtsEraseDebuginfo().
|
static |
Definition at line 195 of file depends.c.
Referenced by rpmtsAddObsoletes().
|
static |
Definition at line 191 of file depends.c.
Referenced by rpmtsAddUpgrades().
rpmds cpuinfoP = NULL |
Definition at line 857 of file depends.c.
Referenced by rpmnsClean(), rpmPlatform(), rpmShowRC(), and unsatisfiedDepend().
|
static |
Definition at line 859 of file depends.c.
Referenced by rpmnsClean(), and unsatisfiedDepend().
const char* rpmEVR = VERSION |
Definition at line 45 of file depends.c.
Referenced by argerror(), and printVersion().
int rpmFLAGS = RPMSENSE_EQUAL |
|
static |
Definition at line 855 of file depends.c.
Referenced by rpmnsClean(), and unsatisfiedDepend().
int(* rpmtsCheck) (rpmts ts) = _rpmtsCheck |
Perform dependency resolution on the transaction set.
Any problems found by rpmtsCheck() can be examined by retrieving the problem set with rpmtsProblems(), success here only means that the resolution was successfully attempted for all packages in the set.
ts | transaction set |
Definition at line 2080 of file depends.c.
Referenced by rpmcliInstallCheck(), rpmts_Check(), and verifyDependencies().
|
static |
Definition at line 852 of file depends.c.
Referenced by rpmnsClean(), and unsatisfiedDepend().
|
static |
Definition at line 861 of file depends.c.
Referenced by rpmnsClean(), and unsatisfiedDepend().