Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

lib/rpmds.c File Reference

More...

#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.

rpmds rpmdsNew (Header h, rpmTag tagN, int scareMem)
 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.

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.

const char ** rpmdsDupArgv (const char **argv, int argc)
rpmds rpmdsDup (const rpmds ods)
int rpmdsFind (rpmds ds, 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.

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

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


Detailed Description

Definition in file rpmds.c.


Define Documentation

#define _RPMDS_INTERNAL
 

Definition at line 8 of file rpmds.c.


Function Documentation

void parseEVR char *    evr,
const char **    ep,
const char **    vp,
const char **    rp
[static]
 

Split EVR into epoch, version, and release components.

Parameters:
evr  [epoch:]version[-release] string
Return values:
ep  pointer to epoch
vp  pointer to version
rp  pointer to release

Definition at line 779 of file rpmds.c.

References xisdigit().

Referenced by rpmdsCompare().

int rpmdsAnyMatchesDep const Header    h,
const rpmds    req,
int    nopromote
 

Compare package provides dependencies from header with a single dependency.

Parameters:
h  header
req  dependency set
nopromote  Don't promote Epoch: in comparison?
Returns:
1 if any dependency overlaps, 0 otherwise

Definition at line 941 of file rpmds.c.

References rpmds, rpmdsCompare(), rpmdsFree(), rpmdsInit(), rpmdsNew(), rpmdsNext(), rpmdsSetNoPromote(), RPMSENSE_SENSEMASK, and RPMTAG_PROVIDENAME.

Referenced by handleOneTrigger(), rpmtsAddInstallElement(), rpmtsSolve(), and unsatisfiedDepend().

uint_32 rpmdsColor const rpmds    ds
 

Return current dependency color.

Parameters:
ds  dependency set
Returns:
current dependency color

Definition at line 475 of file rpmds.c.

References rpmds, and uint_32.

Referenced by checkPackageDeps(), rpmalAddProvides(), rpmds_Color(), and rpmtsAddInstallElement().

int rpmdsCompare const rpmds    A,
const rpmds    B
 

Compare two versioned dependency ranges, looking for overlap.

Parameters:
A  1st dependency
B  2nd dependency
Returns:
1 if dependencies overlap, 0 otherwise

Definition at line 820 of file rpmds.c.

References _, _free(), _rpmds_unspecified_epoch_noise, parseEVR(), rpmds, RPMMESS_DEBUG, RPMMESS_WARNING, rpmMessage, RPMSENSE_EQUAL, RPMSENSE_GREATER, RPMSENSE_LESS, RPMSENSE_SENSEMASK, rpmvercmp(), and xstrdup().

Referenced by ftsStashLatest(), rpmalAllSatisfiesDepend(), rpmCheckRpmlibProvides(), rpmds_compare(), rpmdsAnyMatchesDep(), rpmdsNVRMatchesDep(), and rpmtsAddInstallElement().

int rpmdsCount const rpmds    ds
 

Return dependency set count.

Parameters:
ds  dependency set
Returns:
current count

Definition at line 373 of file rpmds.c.

References rpmds.

Referenced by rpmalMakeIndex(), rpmds_Count(), rpmds_length(), rpmfcGenerateDepends(), rpmfcPrint(), and rpmteColorDS().

const char* rpmdsDNEVR const rpmds    ds
 

Return current formatted dependency string.

Parameters:
ds  dependency set
Returns:
current dependency DNEVR, NULL on invalid

Definition at line 394 of file rpmds.c.

References rpmds.

Referenced by printDeps(), rpmds_DNEVR(), rpmds_print(), rpmds_subscript(), rpmdsPrint(), rpmdsProblem(), rpmfcPrint(), rpmfiBuildFDeps(), rpmShowRpmlibProvides(), rpmts_SolveCallback(), rpmtsAddInstallElement(), and unsatisfiedDepend().

rpmds rpmdsDup const rpmds    ods [static]
 

Definition at line 615 of file rpmds.c.

References headerLink(), rpmds, rpmdsDupArgv(), rpmdsLink, xcalloc(), and xmalloc().

Referenced by rpmdsMerge().

const char** rpmdsDupArgv const char **    argv,
int    argc
[static]
 

Definition at line 585 of file rpmds.c.

References argv, stpcpy(), and xmalloc().

Referenced by rpmdsDup(), and rpmdsMerge().

const char* rpmdsEVR const rpmds    ds
 

Return current dependency epoch-version-release.

Parameters:
ds  dependency set
Returns:
current dependency EVR, NULL on invalid

Definition at line 420 of file rpmds.c.

References rpmds.

Referenced by rpmds_EVR(), rpmds_iternext(), rpmdsProblem(), rpmfcFileDep(), rpmfcGenerateDepends(), rpmts_SolveCallback(), and rpmtsAddInstallElement().

int rpmdsFind rpmds    ds,
rpmds    ods
 

Find a dependency set element using binary search.

Parameters:
ds  dependency set to search
ods  dependency set element to find.
Returns:
dependency index (or -1 if not found)

Definition at line 659 of file rpmds.c.

References rpmds.

Referenced by rpmdsMerge(), and rpmfcApply().

int_32 rpmdsFlags const rpmds    ds
 

Return current dependency flags.

Parameters:
ds  dependency set
Returns:
current dependency flags, 0 on invalid

Definition at line 433 of file rpmds.c.

References int_32, and rpmds.

Referenced by handleOneTrigger(), printDeps(), rpmds_Flags(), rpmds_iternext(), rpmfcFileDep(), rpmts_SolveCallback(), rpmtsOrder(), unsatisfiedDepend(), and zapRelation().

rpmds rpmdsFree rpmds    ds
 

Destroy a dependency set.

Parameters:
ds  dependency set
Returns:
NULL always

Definition at line 54 of file rpmds.c.

References _free(), _rpmds_debug, headerFree(), HFD_t, rpmds, rpmdsUnlink, rpmTag, 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(), rpmalDel(), rpmalFree(), rpmCheckRpmlibProvides(), rpmds_dealloc(), rpmdsAnyMatchesDep(), rpmdsNVRMatchesDep(), rpmfcApply(), rpmfcELF(), rpmfcFree(), rpmfcGenerateDepends(), rpmfcHelper(), rpmfcSCRIPT(), rpmfiBuildFDeps(), rpmInstall(), rpmShowRpmlibProvides(), rpmteCleanDS(), rpmtsAddAvailableElement(), and rpmtsAddInstallElement().

rpmds rpmdsInit rpmds    ds
 

Initialize dependency set iterator.

Parameters:
ds  dependency set
Returns:
dependency set

Definition at line 573 of file rpmds.c.

References rpmds.

Referenced by checkPackageDeps(), handleOneTrigger(), printDeps(), rpmalAddProvides(), rpmds_iternext(), rpmds_print(), rpmdsAnyMatchesDep(), rpmdsMerge(), rpmdsPrint(), rpmteColorDS(), rpmtsAddInstallElement(), rpmtsCheck(), and rpmtsOrder().

int rpmdsIx const rpmds    ds
 

Return dependency set index.

Parameters:
ds  dependency set
Returns:
current index

Definition at line 378 of file rpmds.c.

References rpmds.

Referenced by addRelation(), rpmalAddProvides(), and rpmds_Ix().

int rpmdsMerge rpmds   dsp,
rpmds    ods
 

Merge a dependency set maintaining (N,EVR,Flags) sorted order.

Return values:
dsp  (merged) dependency set
Parameters:
ods  dependency set to merge
Returns:
(merged) dependency index

Definition at line 691 of file rpmds.c.

References _free(), int_32, rpmds, rpmdsDup(), rpmdsDupArgv(), rpmdsFind(), rpmdsInit(), rpmdsNext(), and xmalloc().

Referenced by rpmfcELF(), rpmfcGenerateDepends(), rpmfcHelper(), and rpmfcSCRIPT().

const char* rpmdsN const rpmds    ds
 

Return current dependency name.

Parameters:
ds  dependency set
Returns:
current dependency name, NULL on invalid

Definition at line 407 of file rpmds.c.

References rpmds.

Referenced by addRelation(), checkPackageDeps(), cmpItem(), handleOneTrigger(), rpmalAddProvides(), rpmalAllFileSatisfiesDepend(), rpmalAllSatisfiesDepend(), rpmds_iternext(), rpmds_N(), rpmdsProblem(), rpmfcFileDep(), rpmfcGenerateDepends(), rpmts_SolveCallback(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsSolve(), and unsatisfiedDepend().

rpmds rpmdsNew Header    h,
rpmTag    tagN,
int    scareMem
 

Create and load a dependency set.

Parameters:
h  header
tagN  type of dependency
scareMem  Use pointers to refcounted header memory?
Returns:
new dependency set

Definition at line 117 of file rpmds.c.

References _rpmds_debug, _rpmds_nopromote, headerLink(), HGE_t, int_32, rpmds, rpmdsLink, rpmTag, 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, rpmTagType, xcalloc(), and xmalloc().

Referenced by addTE(), checkPackageSet(), handleOneTrigger(), hdr_dsFromHeader(), printDeps(), rpmdsAnyMatchesDep(), rpmfcGenerateDepends(), rpmfiBuildFDeps(), and rpmtsAddAvailableElement().

char* rpmdsNewDNEVR const char *    dspfx,
const rpmds    ds
 

Return new formatted dependency string.

Parameters:
dspfx  formatted dependency string prefix
ds  dependency set
Returns:
new formatted dependency (malloc'ed)

Definition at line 196 of file rpmds.c.

References rpmds, 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.

Parameters:
ds  dependency set
Returns:
dependency set iterator index, -1 on termination

Definition at line 544 of file rpmds.c.

References _free(), _rpmds_debug, rpmds, and rpmdsNewDNEVR().

Referenced by checkPackageDeps(), handleOneTrigger(), printDeps(), rpmalAddProvides(), rpmalAllSatisfiesDepend(), rpmds_iternext(), rpmds_print(), rpmds_subscript(), rpmdsAnyMatchesDep(), 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.

Parameters:
ds  dependency set
Returns:
current "Don't promote Epoch:" flag

Definition at line 455 of file rpmds.c.

References rpmds.

void rpmdsNotify rpmds    ds,
const char *    where,
int    rc
 

Notify of results of dependency match.

Parameters:
ds  dependency set
where  where dependency was resolved (or NULL)
rc  0 == YES, otherwise NO

Definition at line 531 of file rpmds.c.

References _, rpmds, RPMMESS_DEBUG, and rpmMessage.

Referenced by rpmalAllFileSatisfiesDepend(), rpmalAllSatisfiesDepend(), rpmds_Notify(), and unsatisfiedDepend().

int rpmdsNVRMatchesDep const Header    h,
const rpmds    req,
int    nopromote
 

Compare package name-version-release from header with a single dependency.

Parameters:
h  header
req  dependency set
nopromote  Don't promote Epoch: in comparison?
Returns:
1 if dependency overlaps, 0 otherwise

Definition at line 996 of file rpmds.c.

References alloca(), headerNVR(), HGE_t, int_32, rpmds, 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.

Parameters:
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 911 of file rpmds.c.

References _, fnpyKey, rpmds, rpmdsDNEVR(), rpmdsEVR(), rpmdsN(), RPMMESS_DEBUG, rpmMessage, RPMPROB_CONFLICT, RPMPROB_REQUIRES, rpmProblemType, and rpmpsAppend().

Referenced by checkPackageDeps().

int_32 rpmdsRefs const rpmds    ds
 

Return current dependency file refs.

Parameters:
ds  dependency set
Returns:
current dependency file refs, -1 on global

Definition at line 503 of file rpmds.c.

References int_32, and rpmds.

Referenced by rpmds_Refs().

uint_32 rpmdsSetColor const rpmds    ds,
uint_32    color
 

Return current dependency color.

Parameters:
ds  dependency set
color  new dependency color
Returns:
previous dependency color

Definition at line 488 of file rpmds.c.

References rpmds, and uint_32.

Referenced by rpmteColorDS().

int rpmdsSetIx rpmds    ds,
int    ix
 

Set dependency set index.

Parameters:
ds  dependency set
ix  new index
Returns:
current index

Definition at line 383 of file rpmds.c.

References rpmds.

Referenced by rpmalAllSatisfiesDepend(), rpmds_subscript(), rpmfcPrint(), rpmfiBuildFDeps(), and zapRelation().

int rpmdsSetNoPromote rpmds    ds,
int    nopromote
 

Set "Don't promote Epoch:" flag.

Parameters:
ds  dependency set
nopromote  Should an unspecified Epoch: be treated as Epoch: 0?
Returns:
previous "Don't promote Epoch:" flag

Definition at line 464 of file rpmds.c.

References rpmds.

Referenced by checkPackageSet(), handleOneTrigger(), rpmds_SetNoPromote(), rpmdsAnyMatchesDep(), and rpmdsNVRMatchesDep().

int_32 rpmdsSetRefs const rpmds    ds,
int_32    refs
 

Return current dependency color.

Parameters:
ds  dependency set
refs  new dependency refs
Returns:
previous dependency refs

Definition at line 516 of file rpmds.c.

References int_32, and rpmds.

Referenced by rpmteColorDS().

rpmds rpmdsSingle rpmTag    tagN,
const char *    N,
const char *    EVR,
int_32    Flags
 

Create, load and initialize a dependency set of size 1.

Parameters:
tagN  type of dependency
N  name
EVR  epoch:version-release
Flags  comparison flags
Returns:
new dependency set

Definition at line 324 of file rpmds.c.

References int_32, rpmds, rpmdsLink, rpmdsNewDNEVR(), rpmTag, RPMTAG_CONFLICTNAME, RPMTAG_OBSOLETENAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, RPMTAG_TRIGGERNAME, xcalloc(), and xmalloc().

Referenced by ensureOlder(), rpmCheckRpmlibProvides(), rpmds_Single(), rpmdsNVRMatchesDep(), rpmfcApply(), rpmfcELF(), rpmfcGenerateDepends(), rpmfcHelper(), rpmfcSCRIPT(), rpmInstall(), and rpmShowRpmlibProvides().

rpmTag rpmdsTagN const rpmds    ds
 

Return current dependency type.

Parameters:
ds  dependency set
Returns:
current dependency type, 0 on invalid

Definition at line 446 of file rpmds.c.

References rpmds, and rpmTag.

Referenced by rpmds_TagN(), rpmfcFileDep(), and rpmtsSolve().

rpmds rpmdsThis Header    h,
rpmTag    tagN,
int_32    Flags
 

Create, load and initialize a dependency for this header.

Parameters:
h  header
tagN  type of dependency
Flags  comparison flags
Returns:
new dependency set

Definition at line 244 of file rpmds.c.

References headerNVR(), HGE_t, int_32, rpmds, rpmdsLink, rpmdsNewDNEVR(), rpmTag, 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().

rpmds XrpmdsLink rpmds    ds,
const char *    msg,
const char *    fn,
unsigned    ln
 

Todo:
Remove debugging entry from the ABI.

Definition at line 41 of file rpmds.c.

References _rpmds_debug, and rpmds.

rpmds XrpmdsUnlink rpmds    ds,
const char *    msg,
const char *    fn,
unsigned    ln
 

Todo:
Remove debugging entry from the ABI.

Definition at line 30 of file rpmds.c.

References _rpmds_debug, and rpmds.


Variable Documentation

int _noisy_range_comparison_debug_message = 0 [static]
 

Enable noisy range comparison debugging message?

Definition at line 17 of file rpmds.c.

int _rpmds_debug = 0
 

Definition at line 20 of file rpmds.c.

Referenced by rpmdsFree(), rpmdsNew(), rpmdsNext(), XrpmdsLink(), and XrpmdsUnlink().

int _rpmds_nopromote = 1
 

Definition at line 23 of file rpmds.c.

Referenced by rpmdsNew().

int _rpmds_unspecified_epoch_noise = 0
 

Definition at line 27 of file rpmds.c.

Referenced by rpmdsCompare(), and showVerifyPackage().


Generated on Sun Oct 26 13:02:05 2003 for rpm by doxygen1.2.18