#include "system.h"
#include <rpmlib.h>
#include "rpmds.h"
#include "debug.h"
Go to the source code of this file.
Defines | |
#define | _RPMDS_INTERNAL |
Functions | |
rpmds | XrpmdsUnlink (rpmds ds, const char *msg, const char *fn, unsigned ln) |
rpmds | XrpmdsLink (rpmds ds, const char *msg, const char *fn, unsigned ln) |
rpmds | rpmdsFree (rpmds ds) |
Destroy a dependency set. | |
static int | archFilter (const char *arch) |
Return archScore filter boolean. | |
static rpmds | rpmdsFilter (rpmds ds, const char *token) |
Filter dependency set, removing "foo(bar,i386,=s390,!sparcv8)" wrapper. | |
rpmds | rpmdsNew (Header h, rpmTag tagN, int flags) |
Create and load a dependency set. | |
char * | rpmdsNewDNEVR (const char *dspfx, const rpmds ds) |
Return new formatted dependency string. | |
rpmds | rpmdsThis (Header h, rpmTag tagN, int_32 Flags) |
Create, load and initialize a dependency for this header. | |
rpmds | rpmdsSingle (rpmTag tagN, const char *N, const char *EVR, int_32 Flags) |
Create, load and initialize a dependency set of size 1. | |
int | rpmdsCount (const rpmds ds) |
Return dependency set count. | |
int | rpmdsIx (const rpmds ds) |
Return dependency set index. | |
int | rpmdsSetIx (rpmds ds, int ix) |
Set dependency set index. | |
const char * | rpmdsDNEVR (const rpmds ds) |
Return current formatted dependency string. | |
const char * | rpmdsN (const rpmds ds) |
Return current dependency name. | |
const char * | rpmdsEVR (const rpmds ds) |
Return current dependency epoch-version-release. | |
int_32 | rpmdsFlags (const rpmds ds) |
Return current dependency flags. | |
rpmTag | rpmdsTagN (const rpmds ds) |
Return current dependency type. | |
time_t | rpmdsBT (const rpmds ds) |
Return dependency build time. | |
time_t | rpmdsSetBT (const rpmds ds, time_t BT) |
Set dependency build time. | |
int | rpmdsNoPromote (const rpmds ds) |
Return current "Don't promote Epoch:" flag. | |
int | rpmdsSetNoPromote (rpmds ds, int nopromote) |
Set "Don't promote Epoch:" flag. | |
uint_32 | rpmdsColor (const rpmds ds) |
Return current dependency color. | |
uint_32 | rpmdsSetColor (const rpmds ds, uint_32 color) |
Return current dependency color. | |
int_32 | rpmdsRefs (const rpmds ds) |
Return current dependency file refs. | |
int_32 | rpmdsSetRefs (const rpmds ds, int_32 refs) |
Return current dependency color. | |
void | rpmdsNotify (rpmds ds, const char *where, int rc) |
Notify of results of dependency match. | |
int | rpmdsNext (rpmds ds) |
Return next dependency set iterator index. | |
rpmds | rpmdsInit (rpmds ds) |
Initialize dependency set iterator. | |
static const char ** | rpmdsDupArgv (const char **argv, int argc) |
static rpmds | rpmdsDup (const rpmds ods) |
int | rpmdsFind (rpmds ds, const rpmds ods) |
Find a dependency set element using binary search. | |
int | rpmdsMerge (rpmds *dsp, rpmds ods) |
Merge a dependency set maintaining (N,EVR,Flags) sorted order. | |
static void | parseEVR (char *evr, const char **ep, const char **vp, const char **rp) |
Split EVR into epoch, version, and release components. | |
int | rpmdsCompare (const rpmds A, const rpmds B) |
Compare two versioned dependency ranges, looking for overlap. | |
void | rpmdsProblem (rpmps ps, const char *pkgNEVR, const rpmds ds, const fnpyKey *suggestedKeys, int adding) |
Report a Requires: or Conflicts: dependency problem. | |
int | rpmdsAnyMatchesDep (const Header h, const rpmds req, int nopromote) |
Compare package provides dependencies from header with a single dependency. | |
int | rpmdsNVRMatchesDep (const Header h, const rpmds req, int nopromote) |
Compare package name-version-release from header with a single dependency. | |
Variables | |
static int | _noisy_range_comparison_debug_message = 0 |
Enable noisy range comparison debugging message? | |
int | _rpmds_debug = 0 |
int | _rpmds_nopromote = 1 |
int | _rpmds_unspecified_epoch_noise = 0 |
static const char * | beehiveToken = "redhatbuilddependency" |
Definition in file rpmds.c.
static int archFilter | ( | const char * | arch | ) | [static] |
Return archScore filter boolean.
arch | beehive arch score token |
Definition at line 125 of file rpmds.c.
References _rpmds_debug, archScore(), RPM_MACHTABLE_INSTARCH, RPM_MACHTABLE_INSTOS, rpmGetMachine(), rpmMachineScore(), rpmSetMachine(), and rpmSetTables().
Referenced by rpmdsFilter().
static void parseEVR | ( | char * | evr, | |
const char ** | ep, | |||
const char ** | vp, | |||
const char ** | rp | |||
) | [static] |
Split EVR into epoch, version, and release components.
evr | [epoch:]version[-release] string |
*ep | pointer to epoch | |
*vp | pointer to version | |
*rp | pointer to release |
Definition at line 977 of file rpmds.c.
References xisdigit().
Referenced by rpmdsCompare().
Compare package provides dependencies from header with a single dependency.
h | header | |
req | dependency set | |
nopromote | Don't promote Epoch: in comparison? |
Definition at line 1138 of file rpmds.c.
References rpmdsCompare(), rpmdsFree(), rpmdsInit(), rpmdsNew(), rpmdsNext(), rpmdsSetNoPromote(), RPMSENSE_SENSEMASK, and RPMTAG_PROVIDENAME.
Referenced by handleOneTrigger(), rpmtsAddInstallElement(), rpmtsSolve(), and unsatisfiedDepend().
time_t rpmdsBT | ( | const rpmds | ds | ) |
Return dependency build time.
ds | dependency set |
Definition at line 635 of file rpmds.c.
Referenced by rpmds_BT().
Return current dependency color.
ds | dependency set |
Definition at line 673 of file rpmds.c.
Referenced by checkPackageDeps(), rpmalAddProvides(), rpmds_Color(), and rpmtsAddInstallElement().
Compare two versioned dependency ranges, looking for overlap.
A | 1st dependency | |
B | 2nd dependency |
Definition at line 1018 of file rpmds.c.
References _, _free(), _noisy_range_comparison_debug_message, _rpmds_unspecified_epoch_noise, parseEVR(), RPMMESS_DEBUG, RPMMESS_WARNING, rpmMessage, RPMSENSE_EQUAL, RPMSENSE_GREATER, RPMSENSE_LESS, RPMSENSE_SENSEMASK, rpmvercmp(), and xstrdup().
Referenced by ftsStashLatest(), rpmalAllSatisfiesDepend(), rpmCheckRpmlibProvides(), rpmds_richcompare(), rpmdsAnyMatchesDep(), rpmdsNVRMatchesDep(), and rpmtsAddInstallElement().
int rpmdsCount | ( | const rpmds | ds | ) |
Return dependency set count.
ds | dependency set |
Definition at line 553 of file rpmds.c.
Referenced by rpmalMakeIndex(), rpmds_Count(), rpmds_length(), rpmdsFilter(), rpmfcGenerateDepends(), rpmfcPrint(), and rpmteColorDS().
const char* rpmdsDNEVR | ( | const rpmds | ds | ) |
Return current formatted dependency string.
ds | dependency set |
Definition at line 574 of file rpmds.c.
Referenced by printDeps(), rpmds_DNEVR(), rpmds_print(), rpmds_subscript(), rpmdsPrint(), rpmdsProblem(), rpmfcPrint(), rpmfiBuildFDeps(), rpmShowRpmlibProvides(), rpmts_SolveCallback(), rpmtsAddInstallElement(), and unsatisfiedDepend().
Definition at line 813 of file rpmds.c.
References headerLink(), rpmdsDupArgv(), rpmdsLink, xcalloc(), and xmalloc().
Referenced by rpmdsMerge().
static const char** rpmdsDupArgv | ( | const char ** | argv, | |
int | argc | |||
) | [static] |
Definition at line 783 of file rpmds.c.
References stpcpy(), and xmalloc().
Referenced by rpmdsDup(), and rpmdsMerge().
const char* rpmdsEVR | ( | const rpmds | ds | ) |
Return current dependency epoch-version-release.
ds | dependency set |
Definition at line 600 of file rpmds.c.
Referenced by rpmds_compare(), rpmds_EVR(), rpmds_iternext(), rpmdsProblem(), rpmfcFileDep(), rpmfcGenerateDepends(), rpmts_SolveCallback(), and rpmtsAddInstallElement().
Filter dependency set, removing "foo(bar,i386,=s390,!sparcv8)" wrapper.
ds | dependency set | |
token | namespace string |
Definition at line 178 of file rpmds.c.
References _free(), _rpmds_debug, archFilter(), rpmdsCount(), rpmdsFree(), rpmdsInit(), rpmdsLink, rpmdsN(), rpmdsNext(), and xstrdup().
Referenced by rpmdsNew().
Find a dependency set element using binary search.
ds | dependency set to search | |
ods | dependency set element to find. |
Definition at line 857 of file rpmds.c.
Referenced by rpmds_Find(), rpmdsMerge(), and rpmfcApply().
Return current dependency flags.
ds | dependency set |
Definition at line 613 of file rpmds.c.
Referenced by handleOneTrigger(), printDeps(), rpmds_Flags(), rpmds_iternext(), rpmfcFileDep(), rpmts_SolveCallback(), rpmtsOrder(), unsatisfiedDepend(), and zapRelation().
Destroy a dependency set.
ds | dependency set |
Definition at line 54 of file rpmds.c.
References _free(), _rpmds_debug, headerFree(), headerFreeData(), rpmdsUnlink, RPMTAG_CONFLICTFLAGS, RPMTAG_CONFLICTNAME, RPMTAG_CONFLICTVERSION, RPMTAG_OBSOLETEFLAGS, RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, RPMTAG_TRIGGERFLAGS, RPMTAG_TRIGGERNAME, and RPMTAG_TRIGGERVERSION.
Referenced by checkPackageSet(), ensureOlder(), freeItem(), freePackage(), ftsStashLatest(), handleOneTrigger(), printDeps(), rpmalFree(), rpmCheckRpmlibProvides(), rpmds_dealloc(), rpmds_free(), rpmdsAnyMatchesDep(), rpmdsFilter(), rpmdsNVRMatchesDep(), rpmfcApply(), rpmfcELF(), rpmfcFree(), rpmfcGenerateDepends(), rpmfcHelper(), rpmfcSCRIPT(), rpmfcSYMLINK(), rpmfiBuildFDeps(), rpmInstall(), rpmShowRpmlibProvides(), rpmteCleanDS(), rpmtsAddAvailableElement(), and rpmtsAddInstallElement().
Initialize dependency set iterator.
ds | dependency set |
Definition at line 771 of file rpmds.c.
Referenced by checkPackageDeps(), handleOneTrigger(), printDeps(), rpmalAddProvides(), rpmds_iternext(), rpmds_print(), rpmdsAnyMatchesDep(), rpmdsFilter(), rpmdsMerge(), rpmdsPrint(), rpmteColorDS(), rpmtsAddInstallElement(), rpmtsCheck(), and rpmtsOrder().
int rpmdsIx | ( | const rpmds | ds | ) |
Return dependency set index.
ds | dependency set |
Definition at line 558 of file rpmds.c.
Referenced by addRelation(), rpmalAddProvides(), rpmds_Find(), and rpmds_Ix().
Merge a dependency set maintaining (N,EVR,Flags) sorted order.
*dsp | (merged) dependency set |
ods | dependency set to merge |
Definition at line 889 of file rpmds.c.
References _free(), rpmdsDup(), rpmdsDupArgv(), rpmdsFind(), rpmdsInit(), rpmdsNext(), save, and xmalloc().
Referenced by rpmds_Merge(), rpmfcELF(), rpmfcGenerateDepends(), rpmfcHelper(), rpmfcSCRIPT(), and rpmfcSYMLINK().
const char* rpmdsN | ( | const rpmds | ds | ) |
Return current dependency name.
ds | dependency set |
Definition at line 587 of file rpmds.c.
Referenced by addRelation(), checkPackageDeps(), cmpItem(), handleOneTrigger(), rpmalAddProvides(), rpmalAllFileSatisfiesDepend(), rpmalAllSatisfiesDepend(), rpmds_iternext(), rpmds_N(), rpmdsFilter(), rpmdsProblem(), rpmfcFileDep(), rpmfcGenerateDepends(), rpmts_SolveCallback(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsSolve(), and unsatisfiedDepend().
Create and load a dependency set.
h | header | |
tagN | type of dependency | |
flags | scareMem(0x1), nofilter(0x2) |
Definition at line 282 of file rpmds.c.
References _rpmds_debug, _rpmds_nopromote, beehiveToken, headerGetEntry(), headerGetEntryMinMemory(), headerLink(), RPM_INT32_TYPE, rpmdsFilter(), rpmdsLink, RPMTAG_BUILDTIME, RPMTAG_CONFLICTFLAGS, RPMTAG_CONFLICTNAME, RPMTAG_CONFLICTVERSION, RPMTAG_OBSOLETEFLAGS, RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, RPMTAG_TRIGGERFLAGS, RPMTAG_TRIGGERNAME, RPMTAG_TRIGGERVERSION, xcalloc(), and xmalloc().
Referenced by addTE(), checkPackageSet(), handleOneTrigger(), hdr_dsFromHeader(), printDeps(), rpmds_init(), rpmdsAnyMatchesDep(), rpmfcGenerateDepends(), rpmfiBuildFDeps(), and rpmtsAddAvailableElement().
char* rpmdsNewDNEVR | ( | const char * | dspfx, | |
const rpmds | ds | |||
) |
Return new formatted dependency string.
dspfx | formatted dependency string prefix | |
ds | dependency set |
Definition at line 373 of file rpmds.c.
References RPMSENSE_EQUAL, RPMSENSE_GREATER, RPMSENSE_LESS, RPMSENSE_SENSEMASK, stpcpy(), and xmalloc().
Referenced by rpmdsNext(), rpmdsSingle(), rpmdsThis(), and zapRelation().
int rpmdsNext | ( | rpmds | ds | ) |
Return next dependency set iterator index.
ds | dependency set |
Definition at line 742 of file rpmds.c.
References _free(), _rpmds_debug, and rpmdsNewDNEVR().
Referenced by checkPackageDeps(), handleOneTrigger(), printDeps(), rpmalAddProvides(), rpmalAllSatisfiesDepend(), rpmds_iternext(), rpmds_print(), rpmds_subscript(), rpmdsAnyMatchesDep(), rpmdsFilter(), rpmdsMerge(), rpmdsPrint(), rpmfcPrint(), rpmfiBuildFDeps(), rpmteColorDS(), rpmtsAddInstallElement(), rpmtsCheck(), and rpmtsOrder().
int rpmdsNoPromote | ( | const rpmds | ds | ) |
Return current "Don't promote Epoch:" flag.
This flag controls for Epoch: promotion when a dependency set is compared. If the flag is set (for already installed packages), then an unspecified value will be treated as Epoch: 0. Otherwise (for added packages), the Epoch: portion of the comparison is skipped if the value is not specified, i.e. an unspecified Epoch: is assumed to be equal in dependency comparisons.
ds | dependency set |
void rpmdsNotify | ( | rpmds | ds, | |
const char * | where, | |||
int | rc | |||
) |
Notify of results of dependency match.
ds | dependency set | |
where | where dependency was resolved (or NULL) | |
rc | 0 == YES, otherwise NO |
Definition at line 729 of file rpmds.c.
References _, RPMMESS_DEBUG, and rpmMessage.
Referenced by rpmalAllFileSatisfiesDepend(), rpmalAllSatisfiesDepend(), rpmds_Notify(), and unsatisfiedDepend().
Compare package name-version-release from header with a single dependency.
h | header | |
req | dependency set | |
nopromote | Don't promote Epoch: in comparison? |
Definition at line 1193 of file rpmds.c.
References alloca(), headerGetEntryMinMemory(), headerNVR(), rpmdsCompare(), rpmdsFree(), rpmdsSetNoPromote(), rpmdsSingle(), RPMSENSE_EQUAL, RPMSENSE_SENSEMASK, RPMTAG_EPOCH, RPMTAG_PROVIDENAME, and stpcpy().
Referenced by ensureOlder().
void rpmdsProblem | ( | rpmps | ps, | |
const char * | pkgNEVR, | |||
const rpmds | ds, | |||
const fnpyKey * | suggestedKeys, | |||
int | adding | |||
) |
Report a Requires: or Conflicts: dependency problem.
ps | transaction set problems | |
pkgNEVR | package name/epoch/version/release | |
ds | dependency set | |
suggestedKeys | filename or python object address | |
adding | dependency problem is from added package set? |
Definition at line 1108 of file rpmds.c.
References _, rpmdsDNEVR(), rpmdsEVR(), rpmdsN(), RPMMESS_DEBUG, rpmMessage, RPMPROB_CONFLICT, RPMPROB_REQUIRES, and rpmpsAppend().
Referenced by checkPackageDeps().
Return current dependency file refs.
ds | dependency set |
Definition at line 701 of file rpmds.c.
Referenced by rpmds_Refs().
time_t rpmdsSetBT | ( | const rpmds | ds, | |
time_t | BT | |||
) |
Return current dependency color.
ds | dependency set | |
color | new dependency color |
Definition at line 686 of file rpmds.c.
Referenced by rpmteColorDS().
int rpmdsSetIx | ( | rpmds | ds, | |
int | ix | |||
) |
Set dependency set index.
ds | dependency set | |
ix | new index |
Definition at line 563 of file rpmds.c.
Referenced by rpmalAllSatisfiesDepend(), rpmds_Find(), rpmds_subscript(), rpmfcPrint(), rpmfiBuildFDeps(), and zapRelation().
int rpmdsSetNoPromote | ( | rpmds | ds, | |
int | nopromote | |||
) |
Set "Don't promote Epoch:" flag.
ds | dependency set | |
nopromote | Should an unspecified Epoch: be treated as Epoch: 0? |
Definition at line 662 of file rpmds.c.
Referenced by checkPackageSet(), handleOneTrigger(), rpmds_SetNoPromote(), rpmdsAnyMatchesDep(), and rpmdsNVRMatchesDep().
Return current dependency color.
ds | dependency set | |
refs | new dependency refs |
Definition at line 714 of file rpmds.c.
Referenced by rpmteColorDS().
Create, load and initialize a dependency set of size 1.
tagN | type of dependency | |
N | name | |
EVR | epoch:version-release | |
Flags | comparison flags |
Definition at line 501 of file rpmds.c.
References rpmdsLink, rpmdsNewDNEVR(), RPMTAG_CONFLICTNAME, RPMTAG_OBSOLETENAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, RPMTAG_TRIGGERNAME, xcalloc(), and xmalloc().
Referenced by ensureOlder(), rpmCheckRpmlibProvides(), rpmds_iternext(), rpmds_Single(), rpmdsNVRMatchesDep(), rpmfcApply(), rpmfcELF(), rpmfcGenerateDepends(), rpmfcHelper(), rpmfcSCRIPT(), rpmfcSYMLINK(), rpmInstall(), and rpmShowRpmlibProvides().
Return current dependency type.
ds | dependency set |
Definition at line 626 of file rpmds.c.
Referenced by rpmds_iternext(), rpmds_TagN(), rpmfcFileDep(), rpmts_SolveCallback(), and rpmtsSolve().
Create, load and initialize a dependency for this header.
h | header | |
tagN | type of dependency | |
Flags | comparison flags |
Definition at line 421 of file rpmds.c.
References headerGetEntryMinMemory(), headerNVR(), rpmdsLink, rpmdsNewDNEVR(), RPMTAG_CONFLICTNAME, RPMTAG_EPOCH, RPMTAG_OBSOLETENAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, RPMTAG_TRIGGERNAME, stpcpy(), xcalloc(), and xmalloc().
Referenced by addTE(), ftsStashLatest(), hdr_dsOfHeader(), parseSpec(), and rpmtsAddInstallElement().
Definition at line 41 of file rpmds.c.
References _rpmds_debug.
Definition at line 30 of file rpmds.c.
References _rpmds_debug.
int _noisy_range_comparison_debug_message = 0 [static] |
Enable noisy range comparison debugging message?
Definition at line 17 of file rpmds.c.
Referenced by rpmdsCompare().
int _rpmds_debug = 0 |
int _rpmds_nopromote = 1 |
int _rpmds_unspecified_epoch_noise = 0 |
const char* beehiveToken = "redhatbuilddependency" [static] |