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

lib/rpmds.h File Reference

Structure(s) used for dependency tag sets. More...

#include "rpmevr.h"
#include "rpmns.h"
#include "rpmps.h"

Include dependency graph for rpmds.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

RPMDS

#define rpmdsUnlink(_ds, _msg)   XrpmdsUnlink(_ds, _msg, __FILE__, __LINE__)
#define rpmdsLink(_ds, _msg)   XrpmdsLink(_ds, _msg, __FILE__, __LINE__)
#define RPMELF_FLAG_SKIPPROVIDES   0x1
#define RPMELF_FLAG_SKIPREQUIRES   0x2
rpmds rpmdsUnlink (rpmds ds, const char *msg)
 Unreference a dependency set instance.
rpmds XrpmdsUnlink (rpmds ds, const char *msg, const char *fn, unsigned ln)
rpmds rpmdsLink (rpmds ds, const char *msg)
 Reference a dependency set instance.
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 flags)
 Create and load a dependency set.
const char * rpmdsNewN (rpmds ds)
 Return N string, expanded if necessary.
char * rpmdsNewDNEVR (const char *dspfx, 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 (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.
const char * rpmdsA (const rpmds ds)
 Return current dependency arch.
time_t rpmdsBT (const rpmds ds)
 Return dependency build time.
time_t rpmdsSetBT (const rpmds ds, time_t BT)
 Set dependency build time.
nsType rpmdsNSType (const rpmds ds)
 Return dependency class 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.
void * rpmdsSetEVRparse (rpmds ds, int(*EVRparse)(const char *everstr, EVR_t evr))
 Set EVR parsing function.
void * rpmdsSetEVRcmp (rpmds ds, int(*EVRcmp)(const char *a, const char *b))
 Set EVR comparison function.
uint_32 rpmdsColor (const rpmds ds)
 Return current dependency color.
uint_32 rpmdsSetColor (const rpmds ds, uint_32 color)
 Set current dependency color.
int_32 rpmdsRefs (const rpmds ds)
 Return current dependency file refs.
int_32 rpmdsSetRefs (const rpmds ds, int_32 refs)
 Set current dependency file refs.
int_32 rpmdsResult (const rpmds ds)
 Return current dependency comparison result.
int_32 rpmdsSetResult (const rpmds ds, int_32 result)
 Set current dependency comparison result.
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.
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.
int rpmdsSearch (rpmds ds, rpmds ods)
 Search a sorted dependency set for an element that overlaps.
int rpmdsCpuinfo (rpmds *dsp, const char *fn)
 Load /proc/cpuinfo provides into a dependency set.
int rpmdsRpmlib (rpmds *dsp, void *tblp)
 Load rpmlib provides into a dependency set.
int rpmdsSysinfo (rpmPRCO PRCO, const char *fn)
 Load sysinfo dependencies into a dependency set.
int rpmdsGetconf (rpmds *dsp, const char *path)
 Load getconf provides into a dependency set.
int rpmdsMergePRCO (void *context, rpmds ds)
 Merge provides/requires/conflicts/obsoletes dependencies.
rpmPRCO rpmdsFreePRCO (rpmPRCO PRCO)
 Free dependency set(s) container.
rpmPRCO rpmdsNewPRCO (Header h)
 Create dependency set(s) container.
rpmds rpmdsFromPRCO (rpmPRCO PRCO, rpmTag tagN)
 Retrieve a dependency set from container.
int rpmdsELF (const char *fn, int flags, int(*add)(void *context, rpmds ds), void *context)
 Extract ELF dependencies from a file.
int rpmdsLdconfig (rpmPRCO PRCO, const char *fn)
 Load /etc/ld.so.cache provides into a dependency set.
int rpmdsUname (rpmds *dsp, const struct utsname *un)
 Load uname(2) provides into a dependency set.
int rpmdsPipe (rpmds *dsp, int_32 tagN, const char *cmd)
 Load provides from a pipe into a dependency set.
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.
int rpmdsNegateRC (const rpmds ds, int rc)
 Negate return code for negated comparisons.
static const char * rpmdsTagName (const rpmds ds)
 Return current dependency type name.
static int rpmdsPrint (rpmds ds, FILE *fp)
 Print current dependency set contents.
static int rpmdsPrintResults (rpmds ds, FILE *fp)
 Print current dependency set results.
static int rpmdsPrintClosure (rpmds P, rpmds R, FILE *fp)
 Check Provides: against Requires: and print closure results.

Defines

#define _RPMNS_INTERNAL

Variables

int _rpmds_debug
int _rpmds_nopromote


Detailed Description

Structure(s) used for dependency tag sets.

Definition in file rpmds.h.


Define Documentation

#define _RPMNS_INTERNAL
 

Definition at line 10 of file rpmds.h.

#define rpmdsLink _ds,
_msg   )     XrpmdsLink(_ds, _msg, __FILE__, __LINE__)
 

Definition at line 149 of file rpmds.h.

Referenced by main(), rpmalAdd(), rpmds_Ldconfig(), rpmds_Sysinfo(), rpmdsDup(), rpmdsNew(), rpmdsSingle(), rpmdsThis(), rpmte_DS(), and rpmtsAddObsoletes().

#define rpmdsUnlink _ds,
_msg   )     XrpmdsUnlink(_ds, _msg, __FILE__, __LINE__)
 

Definition at line 132 of file rpmds.h.

Referenced by rpmdsFree().

#define RPMELF_FLAG_SKIPPROVIDES   0x1
 

Definition at line 561 of file rpmds.h.

Referenced by rpmdsELF(), and rpmfcELF().

#define RPMELF_FLAG_SKIPREQUIRES   0x2
 

Definition at line 562 of file rpmds.h.

Referenced by rpmdsELF(), and rpmfcELF().


Function Documentation

const char* rpmdsA const rpmds  ds  ) 
 

Return current dependency arch.

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

Definition at line 737 of file rpmds.c.

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 3751 of file rpmds.c.

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

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

time_t rpmdsBT const rpmds  ds  ) 
 

Return dependency build time.

Parameters:
ds dependency set
Returns:
dependency build time, 0 on invalid

Definition at line 746 of file rpmds.c.

Referenced by rpmds_BT().

uint_32 rpmdsColor const rpmds  ds  ) 
 

Return current dependency color.

Parameters:
ds dependency set
Returns:
current dependency color (0 if not set)

Definition at line 815 of file rpmds.c.

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

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 3627 of file rpmds.c.

References _, _free(), alloca(), D_, rpmdsFlags(), rpmdsNAcmp(), rpmEVRparse(), RPMMESS_DEBUG, RPMMESS_WARNING, rpmMessage, RPMSENSE_EQUAL, RPMSENSE_GREATER, RPMSENSE_LESS, RPMSENSE_NOTEQUAL, RPMSENSE_SENSEMASK, rpmvercmp, and xstrdup().

Referenced by rpmalAllSatisfiesDepend(), rpmds_richcompare(), rpmdsAnyMatchesDep(), rpmdsNVRMatchesDep(), rpmdsSearch(), rpmHeadersIdentical(), and rpmtsAddInstallElement().

int rpmdsCount const rpmds  ds  ) 
 

Return dependency set count.

Parameters:
ds dependency set
Returns:
current count

Definition at line 656 of file rpmds.c.

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

int rpmdsCpuinfo rpmds dsp,
const char *  fn
 

Load /proc/cpuinfo provides into a dependency set.

Return values:
*dsp (loaded) depedency set
Parameters:
fn path to file (NULL uses /proc/cpuinfo)
Returns:
0 on success

Definition at line 1281 of file rpmds.c.

References _free(), _isspace, _PROC_CPUINFO, cpuinfo_s::done, Fclose(), fdGetFILE, Ferror(), Fopen(), cpuinfo_s::name, rpmdsCpuinfoCtagFlags(), rpmdsNSAdd(), rpmExpand(), RPMSENSE_EQUAL, and xstrdup().

Referenced by main(), rpmds_Cpuinfo(), rpmShowRC(), and unsatisfiedDepend().

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 677 of file rpmds.c.

Referenced by missingokTag(), printDeps(), rpmdepPrint(), rpmds_DNEVR(), rpmds_print(), rpmds_subscript(), rpmdsPrint(), rpmdsPrintResults(), rpmdsProblem(), rpmfcPrint(), rpmfiBuildFDeps(), rpmShowRC(), rpmts_SolveCallback(), rpmtsAddInstallElement(), rpmtsAddObsoletes(), and unsatisfiedDepend().

int rpmdsELF const char *  fn,
int  flags,
int(*)(void *context, rpmds ds)  add,
void *  context
 

Extract ELF dependencies from a file.

Parameters:
fn file name
flags 1: skip provides 2: skip requires
*add add(arg, ds) saves next provide/require elf dependency.
context add() callback context
Returns:
0 on success

Definition at line 2826 of file rpmds.c.

References _free(), DT_GNU_HASH, rpmdsFree(), rpmdsSingle(), RPMELF_FLAG_SKIPPROVIDES, RPMELF_FLAG_SKIPREQUIRES, rpmExpandNumeric(), RPMTAG_PROVIDENAME, RPMTAG_PROVIDES, RPMTAG_REQUIRENAME, sonameDep(), stpcpy(), and xstrdup().

Referenced by main(), rpmdsLdconfig(), rpmfcELF(), and unsatisfiedDepend().

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 702 of file rpmds.c.

Referenced by rpmds_compare(), rpmds_EVR(), rpmds_iternext(), rpmdsProblem(), rpmfcFileDep(), rpmfcGenerateDepends(), rpmtsAddObsoletes(), rpmtsCheck(), and unsatisfiedDepend().

int rpmdsFind rpmds  ds,
const 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 1020 of file rpmds.c.

Referenced by rpmds_Find(), 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 715 of file rpmds.c.

Referenced by handleOneTrigger(), missingokTag(), printDeps(), rpmds_Flags(), rpmds_iternext(), rpmdsAnyMatchesDep(), rpmdsCompare(), rpmdsNVRMatchesDep(), rpmfcFileDep(), rpmtsOrder(), unsatisfiedDepend(), and zapRelation().

rpmds rpmdsFree rpmds  ds  ) 
 

Destroy a dependency set.

Parameters:
ds dependency set
Returns:
NULL always

Definition at line 138 of file rpmds.c.

References _free(), headerFree(), headerFreeData(), rpmdsUnlink, RPMTAG_CONFLICTFLAGS, RPMTAG_CONFLICTNAME, RPMTAG_CONFLICTVERSION, RPMTAG_DIRNAMES, RPMTAG_FILELINKTOS, 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(), freePackage(), handleOneTrigger(), main(), missingokTag(), printDeps(), rpmalDel(), rpmalFree(), rpmds_dealloc(), rpmds_free(), rpmds_Sort(), rpmdsAnyMatchesDep(), rpmdsELF(), rpmdsFreePRCO(), rpmdsLdconfig(), rpmdsNSAdd(), rpmdsNVRMatchesDep(), rpmdsPipe(), rpmdsRpmlib(), rpmdsSysinfoFile(), rpmfcApply(), rpmfcFindRequiredPackages(), rpmfcFree(), rpmfcGenerateDepends(), rpmfcHelper(), rpmfcSCRIPT(), rpmfiBuildFDeps(), rpmHeadersIdentical(), rpmInstall(), rpmShowRC(), rpmtsAddAvailableElement(), rpmtsAddInstallElement(), rpmtsAddObsoletes(), and unsatisfiedDepend().

rpmPRCO rpmdsFreePRCO rpmPRCO  PRCO  ) 
 

Free dependency set(s) container.

Parameters:
PRCO dependency set(s) container
Returns:
NULL

Definition at line 2731 of file rpmds.c.

References _free(), and rpmdsFree().

Referenced by main(), rpmds_Ldconfig(), rpmds_Sysinfo(), rpmShowRC(), rpmteCleanDS(), rpmtsFree(), and unsatisfiedDepend().

rpmds rpmdsFromPRCO rpmPRCO  PRCO,
rpmTag  tagN
 

Retrieve a dependency set from container.

Parameters:
PRCO dependency set(s) container
tagN type of dependency set
Returns:
dependency set (or NULL)

Definition at line 2779 of file rpmds.c.

References RPMTAG_CONFLICTNAME, RPMTAG_DIRNAMES, RPMTAG_FILELINKTOS, RPMTAG_NAME, RPMTAG_OBSOLETENAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, and RPMTAG_TRIGGERNAME.

Referenced by main(), rpmds_Ldconfig(), rpmds_Sysinfo(), rpmShowRC(), rpmteDS(), rpmtsCheck(), rpmtsOrder(), and unsatisfiedDepend().

int rpmdsGetconf rpmds dsp,
const char *  path
 

Load getconf provides into a dependency set.

Return values:
*dsp (loaded) depedency set
Parameters:
path getconf path (NULL uses /)
Returns:
0 on success

Definition at line 2596 of file rpmds.c.

References _free(), _GETCONF_PATH, conf::call, conf::call_name, conf::CONFSTR, errno, EXIT_FAILURE, conf::name, conf::PATHCONF, rpmdsNSAdd(), rpmExpand(), RPMSENSE_EQUAL, xmalloc(), and xstrdup().

Referenced by main(), rpmds_Getconf(), rpmShowRC(), and unsatisfiedDepend().

rpmds rpmdsInit rpmds  ds  ) 
 

Initialize dependency set iterator.

Parameters:
ds dependency set
Returns:
dependency set

Definition at line 961 of file rpmds.c.

Referenced by checkPackageDeps(), handleOneTrigger(), missingokTag(), printDeps(), rpmalAddProvides(), rpmdepPrint(), rpmds_iternext(), rpmds_print(), rpmdsAnyMatchesDep(), rpmdsMerge(), rpmdsPrint(), rpmdsPrintClosure(), rpmdsPrintResults(), rpmShowRC(), rpmteColorDS(), rpmtsAddObsoletes(), rpmtsCheck(), and rpmtsOrder().

int rpmdsIx const rpmds  ds  ) 
 

Return dependency set index.

Parameters:
ds dependency set
Returns:
current index

Definition at line 661 of file rpmds.c.

Referenced by addRelation(), rpmalAddProvides(), rpmdepPrint(), rpmds_Find(), rpmds_Ix(), rpmdsPrint(), rpmdsPrintResults(), and rpmdsSearch().

int rpmdsLdconfig rpmPRCO  PRCO,
const char *  fn
 

Load /etc/ld.so.cache provides into a dependency set.

Todo:
Add dependency colors, and attach to file.
Return values:
*PRCO provides/requires/conflicts/obsoletes depedency set(s)
Parameters:
fn cache file name (NULL uses /etc/ld.so.cache)
Returns:
0 on success

Definition at line 3112 of file rpmds.c.

References _free(), _isspace, _LD_SO_CACHE, _SBIN_LDCONFIG_P, rpmdsELF(), rpmdsFree(), rpmdsMerge(), rpmdsMergePRCO(), rpmdsSingle(), rpmExpand(), RPMTAG_PROVIDENAME, and xstrdup().

Referenced by main(), and rpmds_Ldconfig().

rpmds rpmdsLink rpmds  ds,
const char *  msg
 

Reference a dependency set instance.

Parameters:
ds dependency set
msg 
Returns:
new dependency set reference

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:
0 on success

Definition at line 1052 of file rpmds.c.

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

Referenced by rpmds_Merge(), rpmds_Sort(), rpmdsLdconfig(), rpmdsMergePRCO(), rpmdsNSAdd(), rpmdsPipe(), rpmdsRpmlib(), rpmfcFindRequiredPackages(), rpmfcGenerateDepends(), rpmfcHelper(), rpmfcMergePR(), and rpmfcSCRIPT().

int rpmdsMergePRCO void *  context,
rpmds  ds
 

Merge provides/requires/conflicts/obsoletes dependencies.

Parameters:
context merge dependency set(s) container
ds dependency set to merge
Returns:
0 on success

Definition at line 2694 of file rpmds.c.

References rpmdsMerge(), rpmdsTagN(), RPMTAG_CONFLICTNAME, RPMTAG_DIRNAMES, RPMTAG_FILELINKTOS, RPMTAG_OBSOLETENAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, RPMTAG_TRIGGERNAME, and tagName().

Referenced by main(), rpmdsLdconfig(), rpmdsSysinfoFile(), and unsatisfiedDepend().

const char* rpmdsN rpmds  ds  ) 
 

Return current dependency name.

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

Definition at line 690 of file rpmds.c.

References rpmdsNewN().

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

int rpmdsNegateRC const rpmds  ds,
int  rc
 

Negate return code for negated comparisons.

Parameters:
ds dependency set
rc postive return code
Returns:
return code

Definition at line 3855 of file rpmds.c.

Referenced by rpmtsCheck(), and unsatisfiedDepend().

rpmds rpmdsNew Header  h,
rpmTag  tagN,
int  flags
 

Create and load a dependency set.

Parameters:
h header
tagN type of dependency
flags scareMem(0x1), nofilter(0x2)
Returns:
new dependency set

Definition at line 244 of file rpmds.c.

References _free(), argvFree(), headerFreeData(), headerGetEntry(), headerGetEntryMinMemory(), headerIsEntry(), headerLink(), RPM_INT32_TYPE, rpmdsDupArgv(), rpmdsLink, rpmGenPath(), RPMTAG_ARCH, RPMTAG_BUILDTIME, RPMTAG_CONFLICTFLAGS, RPMTAG_CONFLICTNAME, RPMTAG_CONFLICTVERSION, RPMTAG_DIRINDEXES, RPMTAG_DIRNAMES, RPMTAG_FILELINKTOS, RPMTAG_OBSOLETEFLAGS, RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_OLDFILENAMES, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, RPMTAG_TRIGGERFLAGS, RPMTAG_TRIGGERNAME, RPMTAG_TRIGGERVERSION, urlPath(), xcalloc(), xmalloc(), and xstrdup().

Referenced by checkPackageSet(), handleOneTrigger(), hdr_dsFromHeader(), missingokTag(), printDeps(), rpmds_init(), rpmdsAnyMatchesDep(), rpmdsNewPRCO(), rpmfcGenerateDepends(), rpmfiBuildFDeps(), and rpmtsAddAvailableElement().

char* rpmdsNewDNEVR const char *  dspfx,
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 418 of file rpmds.c.

References _rpmns_N_at_A, rpmdsNewN(), RPMSENSE_EQUAL, RPMSENSE_GREATER, RPMSENSE_LESS, RPMSENSE_NOTEQUAL, RPMSENSE_SENSEMASK, stpcpy(), and xmalloc().

Referenced by rpmdsNext(), rpmdsSingle(), rpmdsThis(), and zapRelation().

const char* rpmdsNewN rpmds  ds  ) 
 

Return N string, expanded if necessary.

Parameters:
ds dependency set
Returns:
new N string (malloc'ed)

Definition at line 403 of file rpmds.c.

References rpmnsParse().

Referenced by rpmdsN(), and rpmdsNewDNEVR().

rpmPRCO rpmdsNewPRCO Header  h  ) 
 

Create dependency set(s) container.

Parameters:
h header
Returns:
0 on success

Definition at line 2754 of file rpmds.c.

References rpmdsNew(), rpmdsThis(), RPMSENSE_EQUAL, RPMTAG_CONFLICTNAME, RPMTAG_DIRNAMES, RPMTAG_FILELINKTOS, RPMTAG_OBSOLETENAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, RPMTAG_TRIGGERNAME, and xcalloc().

Referenced by addTE(), main(), rpmds_Ldconfig(), rpmds_Sysinfo(), rpmShowRC(), rpmtsCreate(), and unsatisfiedDepend().

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 930 of file rpmds.c.

References _free(), and rpmdsNewDNEVR().

Referenced by checkPackageDeps(), handleOneTrigger(), missingokTag(), printDeps(), rpmalAddProvides(), rpmalAllSatisfiesDepend(), rpmdepPrint(), rpmds_iternext(), rpmds_print(), rpmds_subscript(), rpmdsAnyMatchesDep(), rpmdsMerge(), rpmdsPrint(), rpmdsPrintClosure(), rpmdsPrintResults(), rpmdsSearch(), rpmfcPrint(), rpmfiBuildFDeps(), rpmShowRC(), rpmteColorDS(), rpmtsAddObsoletes(), 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 772 of file rpmds.c.

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 917 of file rpmds.c.

References _, RPMMESS_DEBUG, and rpmMessage.

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

nsType rpmdsNSType const rpmds  ds  ) 
 

Return dependency class type.

Parameters:
ds dependency set
Returns:
dependency class type

Definition at line 764 of file rpmds.c.

References RPMNS_TYPE_UNKNOWN.

Referenced by addRelation(), rpmtsCheck(), 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 3805 of file rpmds.c.

References alloca(), headerGetEntryMinMemory(), headerNVR(), rpmdsCompare(), rpmdsFlags(), rpmdsFree(), rpmdsSetNoPromote(), rpmdsSingle(), RPMSENSE_EQUAL, RPMSENSE_SENSEMASK, RPMTAG_EPOCH, RPMTAG_PROVIDENAME, stpcpy(), and V.

Referenced by ensureOlder().

int rpmdsPipe rpmds dsp,
int_32  tagN,
const char *  cmd
 

Load provides from a pipe into a dependency set.

Return values:
*dsp (loaded) depedency set
Parameters:
tagN rpmds tag (<= 0 uses RPMTAG_PROVIDENAME).
cmd popen cmd to run (NULL loads perl provides)
Returns:
0 on success

Definition at line 3466 of file rpmds.c.

References _, _free(), _isspace, _PERL_PROVIDES, rpmdsFree(), rpmdsMerge(), rpmdsSingle(), rpmEVRflags(), rpmExpand(), RPMTAG_PROVIDENAME, xisalnum(), and xstrdup().

Referenced by main().

static int rpmdsPrint rpmds  ds,
FILE *  fp
[inline, static]
 

Print current dependency set contents.

Parameters:
ds dependency set
fp file handle (NULL uses stderr)
Returns:
0 always

Definition at line 706 of file rpmds.h.

References rpmdsDNEVR(), rpmdsInit(), rpmdsIx(), rpmdsNext(), and rpmdsTagName().

static int rpmdsPrintClosure rpmds  P,
rpmds  R,
FILE *  fp
[inline, static]
 

Check Provides: against Requires: and print closure results.

Parameters:
P Provides: dependency set
R Requires: dependency set
fp file handle (NULL uses stderr)
Returns:
0 always

Definition at line 750 of file rpmds.h.

References rpmdsInit(), rpmdsNext(), rpmdsPrintResults(), rpmdsSearch(), and rpmdsSetResult().

Referenced by main().

static int rpmdsPrintResults rpmds  ds,
FILE *  fp
[inline, static]
 

Print current dependency set results.

Parameters:
ds dependency set
fp file handle (NULL uses stderr)
Returns:
0 always

Definition at line 725 of file rpmds.h.

References rpmdsDNEVR(), rpmdsInit(), rpmdsIx(), rpmdsNext(), rpmdsResult(), and rpmdsTagName().

Referenced by rpmdsPrintClosure().

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 3721 of file rpmds.c.

References D_, rpmdsDNEVR(), rpmdsEVR(), rpmdsN(), RPMMESS_DEBUG, rpmMessage, RPMPROB_CONFLICT, RPMPROB_REQUIRES, 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 (0 if not set)

Definition at line 849 of file rpmds.c.

Referenced by rpmds_Refs().

int_32 rpmdsResult const rpmds  ds  ) 
 

Return current dependency comparison result.

Parameters:
ds dependency set
Returns:
current dependency result (0 if not set)

Definition at line 883 of file rpmds.c.

Referenced by rpmds_Result(), and rpmdsPrintResults().

int rpmdsRpmlib rpmds dsp,
void *  tblp
 

Load rpmlib provides into a dependency set.

Return values:
*dsp (loaded) depedency set
Parameters:
tblp rpmlib provides table (NULL uses internal table)
Returns:
0 on success

Definition at line 1469 of file rpmds.c.

References rpmlibProvides_s::featureEVR, rpmlibProvides_s::featureFlags, rpmlibProvides_s::featureName, rpmdsFree(), rpmdsMerge(), rpmdsSingle(), and RPMTAG_PROVIDENAME.

Referenced by main(), rpmds_Rpmlib(), rpmShowRC(), and unsatisfiedDepend().

int rpmdsSearch rpmds  ds,
rpmds  ods
 

Search a sorted dependency set for an element that overlaps.

A boolean result is saved (if allocated) and accessible through rpmdsResult(ods) afterwards.

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

Definition at line 1132 of file rpmds.c.

References rpmdsCompare(), rpmdsIx(), rpmdsNext(), rpmdsSetIx(), rpmdsSetResult(), and save.

Referenced by rpmds_Search(), rpmdsPrintClosure(), and unsatisfiedDepend().

time_t rpmdsSetBT const rpmds  ds,
time_t  BT
 

Set dependency build time.

Parameters:
ds dependency set
BT build time
Returns:
dependency build time, 0 on invalid

Definition at line 754 of file rpmds.c.

uint_32 rpmdsSetColor const rpmds  ds,
uint_32  color
 

Set current dependency color.

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

Definition at line 828 of file rpmds.c.

References xcalloc().

Referenced by rpmteColorDS().

void* rpmdsSetEVRcmp rpmds  ds,
int(*)(const char *a, const char *b)  EVRcmp
 

Set EVR comparison function.

Parameters:
ds dependency set
EVRcmp EVR comparison function (NULL uses default)
Returns:
previous EVR comparison function

Definition at line 804 of file rpmds.c.

void* rpmdsSetEVRparse rpmds  ds,
int(*)(const char *everstr, EVR_t evr)  EVRparse
 

Set EVR parsing function.

Parameters:
ds dependency set
EVRparse EVR parsing function (NULL uses default)
Returns:
previous EVR parsing function

int rpmdsSetIx rpmds  ds,
int  ix
 

Set dependency set index.

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

Definition at line 666 of file rpmds.c.

Referenced by rpmalAllSatisfiesDepend(), rpmds_Find(), rpmds_subscript(), rpmdsSearch(), 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 781 of file rpmds.c.

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

int_32 rpmdsSetRefs const rpmds  ds,
int_32  refs
 

Set current dependency file refs.

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

Definition at line 862 of file rpmds.c.

References xcalloc().

Referenced by rpmteColorDS().

int_32 rpmdsSetResult const rpmds  ds,
int_32  result
 

Set current dependency comparison result.

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

Definition at line 896 of file rpmds.c.

References xcalloc().

Referenced by rpmdsPrintClosure(), and rpmdsSearch().

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/context flags
Returns:
new dependency set

Definition at line 599 of file rpmds.c.

References rpmdsLink, rpmdsNewDNEVR(), RPMTAG_CONFLICTNAME, RPMTAG_DIRNAMES, RPMTAG_FILELINKTOS, RPMTAG_OBSOLETENAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, RPMTAG_TRIGGERNAME, xcalloc(), and xmalloc().

Referenced by ensureOlder(), rpmds_iternext(), rpmds_Single(), rpmdsELF(), rpmdsLdconfig(), rpmdsNSAdd(), rpmdsNVRMatchesDep(), rpmdsPipe(), rpmdsRpmlib(), rpmdsSysinfoFile(), rpmfcApply(), rpmfcFindRequiredPackages(), rpmfcGenerateDepends(), rpmfcHelper(), rpmfcSCRIPT(), rpmInstall(), and unsatisfiedDepend().

int rpmdsSysinfo rpmPRCO  PRCO,
const char *  fn
 

Load sysinfo dependencies into a dependency set.

Return values:
*PRCO provides/requires/conflicts/obsoletes depedency set(s)
Parameters:
fn path to file (NULL uses /etc/rpm/sysinfo)
Returns:
0 on success

Definition at line 1633 of file rpmds.c.

References _ETC_RPM_SYSINFO, _free(), alloca(), rpmdsSysinfoFile(), rpmExpand(), rpmGetPath(), RPMTAG_PROVIDENAME, Stat(), and tagValue().

Referenced by main(), rpmds_Sysinfo(), rpmShowRC(), and rpmtsCreate().

rpmTag rpmdsTagN const rpmds  ds  ) 
 

Return current dependency type.

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

Definition at line 728 of file rpmds.c.

Referenced by addRelation(), rpmds_iternext(), rpmds_TagN(), rpmdsMergePRCO(), rpmdsTagName(), rpmfcFileDep(), rpmfcMergePR(), rpmtsSolve(), and unsatisfiedDepend().

static const char* rpmdsTagName const rpmds  ds  )  [inline, static]
 

Return current dependency type name.

Parameters:
ds dependency set
Returns:
current dependency type name

Definition at line 683 of file rpmds.h.

References rpmdsTagN(), RPMTAG_CONFLICTNAME, RPMTAG_DIRNAMES, RPMTAG_OBSOLETENAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, RPMTAG_TRIGGERNAME, and tagName().

Referenced by rpmdepPrint(), rpmdsPrint(), and rpmdsPrintResults().

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 501 of file rpmds.c.

References headerGetEntryMinMemory(), headerNVR(), RPM_INT32_TYPE, rpmdsLink, rpmdsNewDNEVR(), RPMTAG_ARCH, RPMTAG_BUILDTIME, RPMTAG_CONFLICTNAME, RPMTAG_DIRNAMES, RPMTAG_EPOCH, RPMTAG_FILELINKTOS, RPMTAG_OBSOLETENAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, RPMTAG_TRIGGERNAME, stpcpy(), xcalloc(), xmalloc(), and xstrdup().

Referenced by hdr_dsOfHeader(), parseSpec(), rpmdsNewPRCO(), rpmHeadersIdentical(), and rpmtsAddInstallElement().

int rpmdsUname rpmds dsp,
const struct utsname *  un
 

Load uname(2) provides into a dependency set.

Return values:
*dsp (loaded) depedency set
Parameters:
un utsname struct (NULL calls uname(2))
Returns:
0 on success

Definition at line 3422 of file rpmds.c.

References rpmdsNSAdd(), and RPMSENSE_EQUAL.

Referenced by main(), rpmShowRC(), and unsatisfiedDepend().

rpmds rpmdsUnlink rpmds  ds,
const char *  msg
 

Unreference a dependency set instance.

Parameters:
ds dependency set
msg 
Returns:
NULL always

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

Todo:
Remove debugging entry from the ABI.

Definition at line 125 of file rpmds.c.

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

Todo:
Remove debugging entry from the ABI.

Definition at line 114 of file rpmds.c.


Variable Documentation

int _rpmds_debug
 

Definition at line 104 of file rpmds.c.

int _rpmds_nopromote
 

Definition at line 107 of file rpmds.c.


Generated on Sat Oct 1 16:48:24 2011 for rpm by  doxygen 1.4.4