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,
const char * rpmdsEVR(const rpmds ds)
Return current dependency epoch-version-release.
int rpmdsIsWeak(rpmds ds)
Return whether dependency is weak.
int rpmdsIx(const rpmds ds)
Return dependency set index.
rpmsenseFlags rpmSanitizeDSFlags(rpmTagVal tagN, rpmsenseFlags Flags)
Return only those flags allowed for given type of dependencies.
rpmds rpmdsNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, int flags)
Create and load a dependency set.
rpmds rpmdsCurrent(rpmds ds)
Return a new dependency set of size 1 from the current iteration index.
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.
int rpmdsTi(const rpmds ds)
Return current dependency triggerindex.
int rpmdsCompare(const rpmds A, const rpmds B)
Compare two versioned dependency ranges, looking for overlap.
int rpmdsFind(rpmds ds, const rpmds ods)
Find a dependency set element using binary search.
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.
rpm_color_t rpmdsSetColor(const rpmds ds, rpm_color_t color)
Return current dependency color.
const char * rpmdsN(const rpmds ds)
Return current dependency name.
rpmds rpmdsSingle(rpmTagVal tagN, const char *N, const char *EVR, rpmsenseFlags Flags)
Create, load and initialize a dependency set of size 1.
rpmds rpmdsThis(Header h, rpmTagVal tagN, rpmsenseFlags Flags)
Create, load and initialize a dependency for this header.
rpmds rpmdsNew(Header h, rpmTagVal tagN, int flags)
Create and load a dependency set.
int rpmdsMerge(rpmds *dsp, rpmds ods)
Merge a dependency set maintaining (N,EVR,Flags) sorted order.
rpmTagVal rpmdsTagF(const rpmds ds)
Return current dependency type.
rpmTagVal rpmdsTagEVR(const rpmds ds)
Return current dependency type.
char rpmdsD(const rpmds ds)
Return one char indicating the type of the dependency.
rpmds rpmdsThisPool(rpmstrPool pool, Header h, rpmTagVal tagN, rpmsenseFlags Flags)
Create, load and initialize a dependency for this header.
rpmds rpmdsFree(rpmds ds)
Destroy a dependency set.
rpmTagVal rpmdsTagTi(const rpmds ds)
Return current dependency type.
int rpmdsSetIx(rpmds ds, int ix)
Set dependency set index.
int rpmdsSearch(rpmds ds, rpmds ods)
Search a sorted dependency set for an element that overlaps.
int rpmdsIsReverse(rpmds ds)
Return whether dependency is reversed.
int rpmdsCount(const rpmds ds)
Return dependency set count.
rpmTagVal rpmdsTagN(const rpmds ds)
Return current dependency type.
rpmds rpmdsLink(rpmds ds)
Reference a dependency set instance.
rpmTagVal rpmdsDToTagN(char deptype)
Return matching tagN for one char dependency type description.
int rpmdsMatchesDep(const Header h, int ix, 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.
rpmsenseFlags rpmParseDSFlags(const char *str, size_t len)
Convert a string to the sense flags.
rpmsenseFlags rpmdsFlags(const rpmds ds)
Return current dependency flags.
rpmds rpmdsInit(rpmds ds)
Initialize dependency set iterator.
char * rpmdsNewDNEVR(const char *dspfx, const rpmds ds)
Return new formatted dependency string.
const char * rpmdsDNEVR(const rpmds ds)
Return current formatted dependency string.
int rpmdsAnyMatchesDep(const Header h, const rpmds req, int nopromote)
Compare package provides dependencies from header with a single dependency.
rpm_color_t rpmdsColor(const rpmds ds)
Return current dependency color.
int rpmdsNext(rpmds ds)
Return next dependency set iterator index.
int rpmdsNoPromote(const rpmds ds)
Obsolete, do not use.
rpmsenseFlags_e
Dependency Attributes.
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 rpmdsSetNoPromote(rpmds ds, int nopromote)
Obsolete, do not use.
enum rpmRC_e rpmRC
Package read return codes.
struct headerToken_s * Header
RPM header and data retrieval types.
enum rpmrichParseType_e rpmrichParseType
int rpmdsRpmlib(rpmds *dsp, const void *tblp)
Load rpmlib provides into a dependency set.
rpmRC(* rpmrichParseFunction)(void *cbdata, rpmrichParseType type, const char *n, int nl, const char *e, int el, rpmsenseFlags sense, rpmrichOp op, char **emsg)
int rpmdsIsRich(rpmds dep)
Return if current depenency is rich.
int rpmdsRpmlibPool(rpmstrPool pool, rpmds *dsp, const void *tblp)
Load rpmlib provides into a dependency set.
const char * rpmrichOpStr(rpmrichOp op)
Return a string representation of the rich dependency op.
rpmRC rpmrichParseForTag(const char **dstrp, char **emsg, rpmrichParseFunction cb, void *cbdata, rpmTagVal tagN)
Parse a rich dependency string for a specific tag.
rpmRC rpmrichParse(const char **dstrp, char **emsg, rpmrichParseFunction cb, void *cbdata)
Parse a rich dependency string.
rpmRC rpmdsParseRichDep(rpmds dep, rpmds *leftds, rpmds *rightds, rpmrichOp *op, char **emsg)
Parse a rich dependency string.
enum rpmrichOp_e rpmrichOp
struct rpmstrPool_s * rpmstrPool