11 #include <rpm/rpmtypes.h> 12 #include <rpm/rpmps.h> 57 #define RPMSENSE_SENSEMASK 15 60 #define RPMSENSE_TRIGGER \ 61 (RPMSENSE_TRIGGERPREIN | RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN) 63 #define _ALL_REQUIRES_MASK (\ 65 RPMSENSE_SCRIPT_PRE | \ 66 RPMSENSE_SCRIPT_POST | \ 67 RPMSENSE_SCRIPT_PREUN | \ 68 RPMSENSE_SCRIPT_POSTUN | \ 69 RPMSENSE_SCRIPT_VERIFY | \ 70 RPMSENSE_FIND_REQUIRES | \ 74 RPMSENSE_POSTTRANS | \ 78 #define _notpre(_x) ((_x) & ~RPMSENSE_PREREQ) 79 #define _INSTALL_ONLY_MASK \ 80 _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS) 81 #define _ERASE_ONLY_MASK \ 82 _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN) 84 #define isLegacyPreReq(_x) (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ) 85 #define isInstallPreReq(_x) ((_x) & _INSTALL_ONLY_MASK) 86 #define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK) 431 const char * N,
const char * EVR, rpmsenseFlags Flags);
444 const char * N,
const char * EVR,
445 rpmsenseFlags Flags,
int triggerIndex);
476 const char *n,
int nl,
const char *e,
int el, rpmsenseFlags sense,
rpmds rpmdsCurrent(rpmds ds)
Return a new dependency set of size 1 from the current iteration index.
int rpmdsNext(rpmds ds)
Return next dependency set iterator index.
int rpmdsMatchesDep(const Header h, int ix, const rpmds req, int nopromote)
Compare package provides dependencies from header with a single dependency.
rpmRC rpmrichParseForTag(const char **dstrp, char **emsg, rpmrichParseFunction cb, void *cbdata, rpmTagVal tagN)
Parse a rich dependency string for a specific tag.
rpmds rpmdsNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, int flags)
Create and load a dependency set.
rpmTagVal rpmdsTagN(const rpmds ds)
Return current dependency type.
rpmRC rpmdsParseRichDep(rpmds dep, rpmds *leftds, rpmds *rightds, rpmrichOp *op, char **emsg)
Parse a rich dependency string.
rpmTagVal rpmdsTagTi(const rpmds ds)
Return current dependency type.
enum rpmrichOp_e rpmrichOp
char * rpmdsNewDNEVR(const char *dspfx, const rpmds ds)
Return new formatted dependency string.
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 rpmdsIx(const rpmds ds)
Return dependency set index.
int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote)
Compare package name-version-release from header with a single dependency.
rpmds rpmdsLink(rpmds ds)
Reference a dependency set instance.
int rpmdsRpmlib(rpmds *dsp, const void *tblp)
Load rpmlib provides into a dependency set.
int rpmdsRpmlibPool(rpmstrPool pool, rpmds *dsp, const void *tblp)
Load rpmlib provides into a dependency set.
rpmsenseFlags rpmdsFlags(const rpmds ds)
Return current dependency flags.
rpmsenseFlags_e
Dependency Attributes.
int rpmdsSetIx(rpmds ds, int ix)
Set dependency set index.
rpmTagVal rpmdsTagEVR(const rpmds ds)
Return current dependency type.
const char * rpmdsN(const rpmds ds)
Return current dependency name.
int rpmdsSearch(rpmds ds, rpmds ods)
Search a sorted dependency set for an element that overlaps.
struct rpmstrPool_s * rpmstrPool
int rpmdsAnyMatchesDep(const Header h, const rpmds req, int nopromote)
Compare package provides dependencies from header with a single dependency.
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.
rpmds rpmdsThisPool(rpmstrPool pool, Header h, rpmTagVal tagN, rpmsenseFlags Flags)
Create, load and initialize a dependency for this header.
int rpmdsNoPromote(const rpmds ds)
Return current "Don't promote Epoch:" flag.
rpmds rpmdsThis(Header h, rpmTagVal tagN, rpmsenseFlags Flags)
Create, load and initialize a dependency for this header.
struct headerToken_s * Header
RPM header and data retrieval types.
int rpmdsCount(const rpmds ds)
Return dependency set count.
char rpmdsD(const rpmds ds)
Return one char indicating the type of the dependency.
rpmds rpmdsSinglePool(rpmstrPool pool, rpmTagVal tagN, const char *N, const char *EVR, rpmsenseFlags Flags)
Create, load and initialize a dependency set of size 1.
rpmds rpmdsSingle(rpmTagVal tagN, const char *N, const char *EVR, rpmsenseFlags Flags)
Create, load and initialize a dependency set of size 1.
rpmTagVal rpmdsDToTagN(char deptype)
Return matching tagN for one char dependency type description.
rpmds rpmdsFree(rpmds ds)
Destroy a dependency set.
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.
int rpmdsPutToHeader(rpmds ds, Header h)
Write content of the dependency set to the header.
int rpmdsIsRich(rpmds dep)
Return if current depenency is rich.
const char * rpmrichOpStr(rpmrichOp op)
Return a string representation of the rich dependency op.
int rpmdsCompare(const rpmds A, const rpmds B)
Compare two versioned dependency ranges, looking for overlap.
rpmTagVal rpmdsTagF(const rpmds ds)
Return current dependency type.
rpmsenseFlags rpmSanitizeDSFlags(rpmTagVal tagN, rpmsenseFlags Flags)
Return only those flags allowed for given type of dependencies.
rpmds rpmdsInit(rpmds ds)
Initialize dependency set iterator.
const char * rpmdsEVR(const rpmds ds)
Return current dependency epoch-version-release.
const char * rpmdsDNEVR(const rpmds ds)
Return current formatted dependency string.
unsigned int rpmdsInstance(rpmds ds)
Return dependency header instance, ie whether the dependency comes from an installed header or not...
enum rpmrichParseType_e rpmrichParseType
rpm_color_t rpmdsSetColor(const rpmds ds, rpm_color_t color)
Return current dependency color.
rpmRC(* rpmrichParseFunction)(void *cbdata, rpmrichParseType type, const char *n, int nl, const char *e, int el, rpmsenseFlags sense, rpmrichOp op, char **emsg)
int rpmdsTi(const rpmds ds)
Return current dependency triggerindex.
int rpmdsSetNoPromote(rpmds ds, int nopromote)
Set "Don't promote Epoch:" flag.
enum rpmRC_e rpmRC
Package read return codes.
rpmRC rpmrichParse(const char **dstrp, char **emsg, rpmrichParseFunction cb, void *cbdata)
Parse a rich dependency string.