Go to the documentation of this file.
11 #include <rpm/rpmtypes.h>
12 #include <rpm/rpmps.h>
58 #define RPMSENSE_SENSEMASK 15
61 #define RPMSENSE_TRIGGER \
62 (RPMSENSE_TRIGGERPREIN | RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN)
64 #define _ALL_REQUIRES_MASK (\
66 RPMSENSE_SCRIPT_PRE | \
67 RPMSENSE_SCRIPT_POST | \
68 RPMSENSE_SCRIPT_PREUN | \
69 RPMSENSE_SCRIPT_POSTUN | \
70 RPMSENSE_SCRIPT_VERIFY | \
71 RPMSENSE_FIND_REQUIRES | \
75 RPMSENSE_POSTTRANS | \
80 #define _notpre(_x) ((_x) & ~RPMSENSE_PREREQ)
81 #define _INSTALL_ONLY_MASK \
82 _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS)
83 #define _ERASE_ONLY_MASK \
84 _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
85 #define _UNORDERED_ONLY_MASK \
86 _notpre(RPMSENSE_RPMLIB|RPMSENSE_CONFIG|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS|RPMSENSE_SCRIPT_VERIFY|RPMSENSE_META)
87 #define _FORCE_ORDER_ONLY_MASK \
88 _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
90 #define isLegacyPreReq(_x) (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ)
91 #define isInstallPreReq(_x) ((_x) & _INSTALL_ONLY_MASK)
92 #define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK)
93 #define isUnorderedReq(_x) ((_x) & _UNORDERED_ONLY_MASK && \
94 !((_x) & _FORCE_ORDER_ONLY_MASK))
95 #define isTransientReq(_x) (isInstallPreReq(_x) && \
96 !isErasePreReq(_x) && \
97 !((_x) & RPMSENSE_META))
459 const char * N,
const char * EVR,
491 const char *n,
int nl,
const char *e,
int el,
rpmsenseFlags sense,
rpmTagVal rpmdsTagN(const rpmds ds)
Return current dependency type.
int rpmdsFind(rpmds ds, const rpmds ods)
Find a dependency set element using binary search.
rpmTagVal rpmdsTagTi(const rpmds ds)
Return current dependency type.
int rpmdsSetNoPromote(rpmds ds, int nopromote)
Obsolete, do not use.
rpmds rpmdsNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, int flags)
Create and load a dependency set.
int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote)
Compare package name-version-release from header with a single dependency.
rpmRC(* rpmrichParseFunction)(void *cbdata, rpmrichParseType type, const char *n, int nl, const char *e, int el, rpmsenseFlags sense, rpmrichOp op, char **emsg)
int rpmdsMerge(rpmds *dsp, rpmds ods)
Merge a dependency set maintaining (N,EVR,Flags) sorted order.
const char * rpmrichOpStr(rpmrichOp op)
Return a string representation of the rich dependency op.
struct rpmstrPool_s * rpmstrPool
rpmRC rpmdsParseRichDep(rpmds dep, rpmds *leftds, rpmds *rightds, rpmrichOp *op, char **emsg)
Parse a rich dependency string.
int rpmdsIx(const rpmds ds)
Return dependency set index.
rpmds rpmdsLink(rpmds ds)
Reference a dependency set instance.
rpmTagVal rpmdsTagEVR(const rpmds ds)
Return current dependency type.
const char * rpmdsN(const rpmds ds)
Return current dependency name.
int rpmdsSetIx(rpmds ds, int ix)
Set dependency set index.
int rpmdsIsWeak(rpmds ds)
Return whether dependency is weak.
enum rpmRC_e rpmRC
Package read return codes.
int rpmdsSearch(rpmds ds, rpmds ods)
Search a sorted dependency set for an element that overlaps.
enum rpmrichOp_e rpmrichOp
enum rpmrichParseType_e rpmrichParseType
int rpmdsAnyMatchesDep(const Header h, const rpmds req, int nopromote)
Compare package provides dependencies from header with a single dependency.
int rpmdsIsRich(rpmds dep)
Return if current depenency is rich.
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.
rpmTagVal rpmdsDToTagN(char deptype)
Return matching tagN for one char dependency type description.
rpmds rpmdsThisPool(rpmstrPool pool, Header h, rpmTagVal tagN, rpmsenseFlags Flags)
Create, load and initialize a dependency for this header.
int rpmdsNoPromote(const rpmds ds)
Obsolete, do not use.
rpmsenseFlags rpmdsFlags(const rpmds ds)
Return current dependency flags.
rpmsenseFlags_e
Dependency Attributes.
rpmds rpmdsFree(rpmds ds)
Destroy a dependency set.
rpmRC rpmrichParse(const char **dstrp, char **emsg, rpmrichParseFunction cb, void *cbdata)
Parse a rich dependency string.
rpmds rpmdsThis(Header h, rpmTagVal tagN, rpmsenseFlags Flags)
Create, load and initialize a dependency for this header.
int rpmdsCount(const rpmds ds)
Return dependency set count.
rpmds rpmdsSingle(rpmTagVal tagN, const char *N, const char *EVR, rpmsenseFlags Flags)
Create, load and initialize a dependency set of size 1.
rpmds rpmdsSinglePool(rpmstrPool pool, rpmTagVal tagN, const char *N, const char *EVR, rpmsenseFlags Flags)
Create, load and initialize a dependency set of size 1.
int rpmdsRpmlib(rpmds *dsp, const void *tblp)
Load rpmlib provides into a dependency set.
int rpmdsCompare(const rpmds A, const rpmds B)
Compare two versioned dependency ranges, looking for overlap.
rpmds rpmdsInit(rpmds ds)
Initialize dependency set iterator.
char rpmdsD(const rpmds ds)
Return one char indicating the type of the dependency.
rpmsenseFlags rpmParseDSFlags(const char *str, size_t len)
Convert a string to the sense flags.
rpmds rpmdsNew(Header h, rpmTagVal tagN, int flags)
Create and load a dependency set.
rpm_color_t rpmdsColor(const rpmds ds)
Return current dependency color.
unsigned int rpmdsInstance(rpmds ds)
Return dependency header instance, ie whether the dependency comes from an installed header or not.
int rpmdsPutToHeader(rpmds ds, Header h)
Write content of the dependency set to the header.
const char * rpmdsEVR(const rpmds ds)
Return current dependency epoch-version-release.
const char * rpmdsDNEVR(const rpmds ds)
Return current formatted dependency string.
rpmTagVal rpmdsTagF(const rpmds ds)
Return current dependency type.
rpmRC rpmrichParseForTag(const char **dstrp, char **emsg, rpmrichParseFunction cb, void *cbdata, rpmTagVal tagN)
Parse a rich dependency string for a specific tag.
int rpmdsRpmlibPool(rpmstrPool pool, rpmds *dsp, const void *tblp)
Load rpmlib provides into a dependency set.
rpm_color_t rpmdsSetColor(const rpmds ds, rpm_color_t color)
Return current dependency color.
rpmsenseFlags rpmSanitizeDSFlags(rpmTagVal tagN, rpmsenseFlags Flags)
Return only those flags allowed for given type of dependencies.
struct headerToken_s * Header
RPM header and data retrieval types.
int rpmdsIsReverse(rpmds ds)
Return whether dependency is reversed.
int rpmdsNext(rpmds ds)
Return next dependency set iterator index.
int rpmdsTi(const rpmds ds)
Return current dependency triggerindex.
int rpmdsMatchesDep(const Header h, int ix, const rpmds req, int nopromote)
Compare package provides dependencies from header with a single dependency.
rpmds rpmdsCurrent(rpmds ds)
Return a new dependency set of size 1 from the current iteration index.
char * rpmdsNewDNEVR(const char *dspfx, const rpmds ds)
Return new formatted dependency string.