rpm 4.19.0
The RPM Package Manager
Loading...
Searching...
No Matches
Enumerations | Functions
Dependency Set API.

How to compare dependencies. More...

Collaboration diagram for Dependency Set API.:

Enumerations

enum  rpmsenseFlags_e {
  RPMSENSE_ANY = 0 , RPMSENSE_LESS = (1 << 1) , RPMSENSE_GREATER = (1 << 2) , RPMSENSE_EQUAL = (1 << 3) ,
  RPMSENSE_POSTTRANS = (1 << 5) , RPMSENSE_PREREQ = (1 << 6) , RPMSENSE_PRETRANS = (1 << 7) , RPMSENSE_INTERP = (1 << 8) ,
  RPMSENSE_SCRIPT_PRE = (1 << 9) , RPMSENSE_SCRIPT_POST = (1 << 10) , RPMSENSE_SCRIPT_PREUN = (1 << 11) , RPMSENSE_SCRIPT_POSTUN = (1 << 12) ,
  RPMSENSE_SCRIPT_VERIFY = (1 << 13) , RPMSENSE_FIND_REQUIRES = (1 << 14) , RPMSENSE_FIND_PROVIDES = (1 << 15) , RPMSENSE_TRIGGERIN = (1 << 16) ,
  RPMSENSE_TRIGGERUN = (1 << 17) , RPMSENSE_TRIGGERPOSTUN = (1 << 18) , RPMSENSE_MISSINGOK = (1 << 19) , RPMSENSE_PREUNTRANS = (1 << 20) ,
  RPMSENSE_POSTUNTRANS = (1 << 21) , RPMSENSE_RPMLIB = (1 << 24) , RPMSENSE_TRIGGERPREIN = (1 << 25) , RPMSENSE_KEYRING = (1 << 26) ,
  RPMSENSE_CONFIG = (1 << 28) , RPMSENSE_META = (1 << 29)
}
 

Functions

rpmsenseFlags rpmSanitizeDSFlags (rpmTagVal tagN, rpmsenseFlags Flags)
 
rpmsenseFlags rpmParseDSFlags (const char *str, size_t len)
 
rpmds rpmdsLink (rpmds ds)
 
rpmds rpmdsFree (rpmds ds)
 
rpmds rpmdsNew (Header h, rpmTagVal tagN, int flags)
 
char * rpmdsNewDNEVR (const char *dspfx, const rpmds ds)
 
rpmds rpmdsThis (Header h, rpmTagVal tagN, rpmsenseFlags Flags)
 
rpmds rpmdsSingle (rpmTagVal tagN, const char *N, const char *EVR, rpmsenseFlags Flags)
 
rpmds rpmdsCurrent (rpmds ds)
 
int rpmdsPutToHeader (rpmds ds, Header h)
 
int rpmdsCount (const rpmds ds)
 
int rpmdsIx (const rpmds ds)
 
int rpmdsSetIx (rpmds ds, int ix)
 
const char * rpmdsDNEVR (const rpmds ds)
 
char rpmdsD (const rpmds ds)
 
rpmTagVal rpmdsDToTagN (char deptype)
 
const char * rpmdsN (const rpmds ds)
 
const char * rpmdsEVR (const rpmds ds)
 
int rpmdsTi (const rpmds ds)
 
rpmsenseFlags rpmdsFlags (const rpmds ds)
 
rpmTagVal rpmdsTagN (const rpmds ds)
 
rpmTagVal rpmdsTagEVR (const rpmds ds)
 
rpmTagVal rpmdsTagF (const rpmds ds)
 
rpmTagVal rpmdsTagTi (const rpmds ds)
 
unsigned int rpmdsInstance (rpmds ds)
 
int rpmdsIsWeak (rpmds ds)
 
int rpmdsIsReverse (rpmds ds)
 
rpm_color_t rpmdsColor (const rpmds ds)
 
rpm_color_t rpmdsSetColor (const rpmds ds, rpm_color_t color)
 
int rpmdsNext (rpmds ds)
 
rpmds rpmdsInit (rpmds ds)
 
int rpmdsFind (rpmds ds, const rpmds ods)
 
int rpmdsMerge (rpmds *dsp, rpmds ods)
 
int rpmdsSearch (rpmds ds, rpmds ods)
 
int rpmdsCompare (const rpmds A, const rpmds B)
 
int rpmdsAnyMatchesDep (const Header h, const rpmds req, int nopromote)
 
int rpmdsMatchesDep (const Header h, int ix, const rpmds req, int nopromote)
 
int rpmdsNVRMatchesDep (const Header h, const rpmds req, int nopromote)
 
rpmds rpmdsNewPool (rpmstrPool pool, Header h, rpmTagVal tagN, int flags)
 
rpmds rpmdsThisPool (rpmstrPool pool, Header h, rpmTagVal tagN, rpmsenseFlags Flags)
 
rpmds rpmdsSinglePool (rpmstrPool pool, rpmTagVal tagN, const char *N, const char *EVR, rpmsenseFlags Flags)
 
rpmds rpmdsSinglePoolTix (rpmstrPool pool, rpmTagVal tagN, const char *N, const char *EVR, rpmsenseFlags Flags, int triggerIndex)
 

Detailed Description

How to compare dependencies.

Enumeration Type Documentation

◆ rpmsenseFlags_e

Dependency Attributes.

Enumerator
RPMSENSE_POSTTRANS 

posttrans dependency

RPMSENSE_PRETRANS 

Pre-transaction dependency.

RPMSENSE_INTERP 

Interpreter used by scriptlet.

RPMSENSE_SCRIPT_PRE 

pre dependency.

RPMSENSE_SCRIPT_POST 

post dependency.

RPMSENSE_SCRIPT_PREUN 

preun dependency.

RPMSENSE_SCRIPT_POSTUN 

postun dependency.

RPMSENSE_SCRIPT_VERIFY 

verify dependency.

RPMSENSE_FIND_REQUIRES 

find-requires generated dependency.

RPMSENSE_FIND_PROVIDES 

find-provides generated dependency.

RPMSENSE_TRIGGERIN 

triggerin dependency.

RPMSENSE_TRIGGERUN 

triggerun dependency.

RPMSENSE_TRIGGERPOSTUN 

triggerpostun dependency.

RPMSENSE_MISSINGOK 

suggests/enhances hint.

RPMSENSE_PREUNTRANS 

preuntrans dependency.

RPMSENSE_POSTUNTRANS 

postuntrans dependency.

RPMSENSE_RPMLIB 

rpmlib(feature) dependency.

RPMSENSE_TRIGGERPREIN 

triggerprein dependency.

RPMSENSE_META 

meta dependency.

Function Documentation

◆ rpmdsAnyMatchesDep()

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

Compare package provides dependencies from header with a single dependency.

Parameters
hheader
reqdependency set
nopromoteunused
Returns
1 if any dependency overlaps, 0 otherwise

◆ rpmdsColor()

rpm_color_t rpmdsColor ( const rpmds  ds)

Return current dependency color.

Parameters
dsdependency set
Returns
current dependency color

◆ rpmdsCompare()

int rpmdsCompare ( const rpmds  A,
const rpmds  B 
)

Compare two versioned dependency ranges, looking for overlap.

Parameters
A1st dependency
B2nd dependency
Returns
1 if dependencies overlap, 0 otherwise

◆ rpmdsCount()

int rpmdsCount ( const rpmds  ds)

Return dependency set count.

Parameters
dsdependency set
Returns
current count

◆ rpmdsCurrent()

rpmds rpmdsCurrent ( rpmds  ds)

Return a new dependency set of size 1 from the current iteration index

Parameters
dsdependency set
Returns
new dependency set

◆ rpmdsD()

char rpmdsD ( const rpmds  ds)

Return one char indicating the type of the dependency.

Parameters
dsdependency set
Returns
character

◆ rpmdsDNEVR()

const char * rpmdsDNEVR ( const rpmds  ds)

Return current formatted dependency string.

Parameters
dsdependency set
Returns
current dependency DNEVR, NULL on invalid

◆ rpmdsDToTagN()

rpmTagVal rpmdsDToTagN ( char  deptype)

Return matching tagN for one char dependency type description.

Parameters
deptypecharacter
Returns
type of dependency

◆ rpmdsEVR()

const char * rpmdsEVR ( const rpmds  ds)

Return current dependency epoch-version-release.

Parameters
dsdependency set
Returns
current dependency EVR, NULL on invalid

◆ rpmdsFind()

int rpmdsFind ( rpmds  ds,
const rpmds  ods 
)

Find a dependency set element using binary search.

Parameters
dsdependency set to search
odsdependency set element to find.
Returns
dependency index (or -1 if not found)

◆ rpmdsFlags()

rpmsenseFlags rpmdsFlags ( const rpmds  ds)

Return current dependency flags.

Parameters
dsdependency set
Returns
current dependency flags, 0 on invalid

◆ rpmdsFree()

rpmds rpmdsFree ( rpmds  ds)

Destroy a dependency set.

Parameters
dsdependency set
Returns
NULL always

◆ rpmdsInit()

rpmds rpmdsInit ( rpmds  ds)

Initialize dependency set iterator.

Parameters
dsdependency set
Returns
dependency set

◆ rpmdsInstance()

unsigned int rpmdsInstance ( rpmds  ds)

Return dependency header instance, ie whether the dependency comes from an installed header or not.

Parameters
dsdependency set
Returns
header instance of dependency (0 for not installed)

◆ rpmdsIsReverse()

int rpmdsIsReverse ( rpmds  ds)

Return whether dependency is reversed

Parameters
dsdependency set
Returns
1 if reversed, 0 if not

◆ rpmdsIsWeak()

int rpmdsIsWeak ( rpmds  ds)

Return whether dependency is weak

Parameters
dsdependency set
Returns
1 if weak, 0 if not

◆ rpmdsIx()

int rpmdsIx ( const rpmds  ds)

Return dependency set index.

Parameters
dsdependency set
Returns
current index

◆ rpmdsLink()

rpmds rpmdsLink ( rpmds  ds)

Reference a dependency set instance.

Parameters
dsdependency set
Returns
new dependency set reference

◆ rpmdsMatchesDep()

int rpmdsMatchesDep ( const Header  h,
int  ix,
const rpmds  req,
int  nopromote 
)

Compare package provides dependencies from header with a single dependency.

Parameters
hheader
ixindex in header provides
reqdependency set
nopromoteunused
Returns
1 if any dependency overlaps, 0 otherwise

◆ rpmdsMerge()

int rpmdsMerge ( rpmds *  dsp,
rpmds  ods 
)

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

Parameters
[out]*dsp(merged) dependency set
odsdependency set to merge
Returns
number of merged dependencies, -1 on error

◆ rpmdsN()

const char * rpmdsN ( const rpmds  ds)

Return current dependency name.

Parameters
dsdependency set
Returns
current dependency name, NULL on invalid

◆ rpmdsNew()

rpmds rpmdsNew ( Header  h,
rpmTagVal  tagN,
int  flags 
)

Create and load a dependency set.

Parameters
hheader
tagNtype of dependency
flagsunused
Returns
new dependency set

◆ rpmdsNewDNEVR()

char * rpmdsNewDNEVR ( const char *  dspfx,
const rpmds  ds 
)

Return new formatted dependency string.

Parameters
dspfxformatted dependency string prefix
dsdependency set
Returns
new formatted dependency (malloc'ed)

◆ rpmdsNewPool()

rpmds rpmdsNewPool ( rpmstrPool  pool,
Header  h,
rpmTagVal  tagN,
int  flags 
)

Create and load a dependency set.

Parameters
poolshared string pool (or NULL for private pool)
hheader
tagNtype of dependency
flagsunused
Returns
new dependency set

◆ rpmdsNext()

int rpmdsNext ( rpmds  ds)

Return next dependency set iterator index.

Parameters
dsdependency set
Returns
dependency set iterator index, -1 on termination

◆ rpmdsNVRMatchesDep()

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

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

Parameters
hheader
reqdependency set
nopromoteunused
Returns
1 if dependency overlaps, 0 otherwise

◆ rpmdsPutToHeader()

int rpmdsPutToHeader ( rpmds  ds,
Header  h 
)

Write content of the dependency set to the header

Parameters
dsdependency set
hheader
Returns
0 on success

◆ rpmdsSearch()

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
dsdependency set to search
odsdependency set element to find.
Returns
dependency index (or -1 if not found)

◆ rpmdsSetColor()

rpm_color_t rpmdsSetColor ( const rpmds  ds,
rpm_color_t  color 
)

Return current dependency color.

Parameters
dsdependency set
colornew dependency color
Returns
previous dependency color

◆ rpmdsSetIx()

int rpmdsSetIx ( rpmds  ds,
int  ix 
)

Set dependency set index.

Parameters
dsdependency set
ixnew index
Returns
new index, -1 on error

◆ rpmdsSingle()

rpmds rpmdsSingle ( rpmTagVal  tagN,
const char *  N,
const char *  EVR,
rpmsenseFlags  Flags 
)

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

Parameters
tagNtype of dependency
Nname
EVRepoch:version-release
Flagscomparison flags
Returns
new dependency set

◆ rpmdsSinglePool()

rpmds rpmdsSinglePool ( rpmstrPool  pool,
rpmTagVal  tagN,
const char *  N,
const char *  EVR,
rpmsenseFlags  Flags 
)

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

Parameters
poolstring pool (or NULL for private pool)
tagNtype of dependency
Nname
EVRepoch:version-release
Flagscomparison flags
Returns
new dependency set

◆ rpmdsSinglePoolTix()

rpmds rpmdsSinglePoolTix ( rpmstrPool  pool,
rpmTagVal  tagN,
const char *  N,
const char *  EVR,
rpmsenseFlags  Flags,
int  triggerIndex 
)

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

Parameters
poolstring pool (or NULL for private pool)
tagNtype of dependency
Nname
EVRepoch:version-release
Flagscomparison flags
triggerIndextrigger index
Returns
new dependency set

◆ rpmdsTagEVR()

rpmTagVal rpmdsTagEVR ( const rpmds  ds)

Return current dependency type.

Parameters
dsdependency set
Returns
current dependency type version tag, 0 on invalid

◆ rpmdsTagF()

rpmTagVal rpmdsTagF ( const rpmds  ds)

Return current dependency type.

Parameters
dsdependency set
Returns
current dependency type flags tag, 0 on invalid

◆ rpmdsTagN()

rpmTagVal rpmdsTagN ( const rpmds  ds)

Return current dependency type.

Parameters
dsdependency set
Returns
current dependency type, 0 on invalid

◆ rpmdsTagTi()

rpmTagVal rpmdsTagTi ( const rpmds  ds)

Return current dependency type.

Parameters
dsdependency set
Returns
current dependency type trigger index tag, 0 on invalid

◆ rpmdsThis()

rpmds rpmdsThis ( Header  h,
rpmTagVal  tagN,
rpmsenseFlags  Flags 
)

Create, load and initialize a dependency for this header.

Parameters
hheader
tagNtype of dependency
Flagscomparison flags
Returns
new dependency set

◆ rpmdsThisPool()

rpmds rpmdsThisPool ( rpmstrPool  pool,
Header  h,
rpmTagVal  tagN,
rpmsenseFlags  Flags 
)

Create, load and initialize a dependency for this header.

Parameters
poolstring pool (or NULL for private pool)
hheader
tagNtype of dependency
Flagscomparison flags
Returns
new dependency set

◆ rpmdsTi()

int rpmdsTi ( const rpmds  ds)

Return current dependency triggerindex.

Parameters
dsdependency set
Returns
current dependency trigger index, 0 on invalid

◆ rpmParseDSFlags()

rpmsenseFlags rpmParseDSFlags ( const char *  str,
size_t  len 
)

Convert a string to the sense flags

Parameters
strthe string
lenlength of the string
Returns
flags, zero for unknown relations

◆ rpmSanitizeDSFlags()

rpmsenseFlags rpmSanitizeDSFlags ( rpmTagVal  tagN,
rpmsenseFlags  Flags 
)

Return only those flags allowed for given type of dependencies

Parameters
tagNtype of dependency
Flagsflags
Returns
flags filtered to allowed bits