Use rpmsenseFlags type for dependency flags everywhere (hopefully)

This commit is contained in:
Panu Matilainen 2008-01-30 16:04:40 +02:00
parent 87e01f3362
commit d2efb5d77c
14 changed files with 42 additions and 40 deletions

View File

@ -77,7 +77,7 @@ int parseScript(rpmSpec spec, int parsePart)
const char *partname = NULL;
rpm_tag_t reqtag = 0;
rpm_tag_t tag = 0;
int tagflags = 0;
rpmsenseFlags tagflags = 0;
rpm_tag_t progtag = 0;
int flag = PART_SUBNAME;
Package pkg;

View File

@ -337,7 +337,8 @@ static int rpmfcHelper(rpmfc fc, unsigned char deptype, const char * nsdep)
rpmds * depsp, ds;
const char * N;
const char * EVR;
int32_t Flags, dsContext, tagN;
rpmsenseFlags Flags;
int32_t dsContext, tagN;
ARGV_t pav;
const char * s;
int pac;
@ -1123,7 +1124,7 @@ rpmRC rpmfcApply(rpmfc fc)
rpmds ds;
const char * N;
const char * EVR;
int32_t Flags;
rpmsenseFlags Flags;
unsigned char deptype;
int nddict;
int previx;
@ -1401,7 +1402,7 @@ static void printDeps(Header h)
rpmds ds = NULL;
int flags = 0; /* XXX !scareMem */
const char * DNEVR;
int32_t Flags;
rpmsenseFlags Flags;
int bingo = 0;
for (dm = DepMsgs; dm->msg != NULL; dm++) {
@ -1458,7 +1459,7 @@ static int rpmfcGenerateDependsHelper(const rpmSpec spec, Package pkg, rpmfi fi)
for (dm = DepMsgs; dm->msg != NULL; dm++) {
rpm_tag_t tag;
int tagflags;
rpmsenseFlags tagflags;
char * s;
int xx;
@ -1659,7 +1660,7 @@ assert(ac == c);
if (fc->provides != NULL && (c = rpmdsCount(fc->provides)) > 0 && !fc->skipProv) {
const char **names = xcalloc(c, sizeof(char *));
const char **evrs = xcalloc(c, sizeof(char *));
int32_t *flags = xcalloc(c, sizeof(int32_t *));
rpmsenseFlags *flags = xcalloc(c, sizeof(rpmsenseFlags *));
int i;
rpmds pi = rpmdsInit(fc->provides);
while ((i = rpmdsNext(pi)) >= 0) {
@ -1693,7 +1694,7 @@ assert(flags != NULL);
if (fc->requires != NULL && (c = rpmdsCount(fc->requires)) > 0 && !fc->skipReq) {
const char **names = xcalloc(c, sizeof(char *));
const char **evrs = xcalloc(c, sizeof(char *));
int32_t *flags = xcalloc(c, sizeof(int32_t *));
rpmsenseFlags *flags = xcalloc(c, sizeof(rpmsenseFlags *));
int i;
rpmds ri = rpmdsInit(fc->requires);
while ((i = rpmdsNext(ri)) >= 0) {

View File

@ -809,7 +809,7 @@ static void markLoop(tsortInfo tsi, rpmte q)
}
}
static inline const char * identifyDepend(int32_t f)
static inline const char * identifyDepend(rpmsenseFlags f)
{
if (isLegacyPreReq(f))
return "PreReq:";
@ -857,7 +857,7 @@ zapRelation(rpmte q, rpmte p,
/* XXX Note: the loop traverses "not found", break on "found". */
tsi_prev = tsi, tsi = tsi->tsi_next)
{
int32_t Flags;
rpmsenseFlags Flags;
if (tsi->tsi_suc != p)
continue;
@ -1039,7 +1039,7 @@ static void addQ(rpmte p,
int rpmtsOrder(rpmts ts)
{
rpmds requires;
int32_t Flags;
rpmsenseFlags Flags;
uint32_t prefcolor = rpmtsPrefColor(ts);
rpmtsi pi; rpmte p;
rpmtsi qi; rpmte q;

View File

@ -147,11 +147,11 @@ void providePackageNVR(Header h)
int32_t * epoch;
const char *pEVR;
char *p;
int32_t pFlags = RPMSENSE_EQUAL;
rpmsenseFlags pFlags = RPMSENSE_EQUAL;
const char ** provides = NULL;
const char ** providesEVR = NULL;
rpm_tagtype_t pnt, pvt;
int32_t * provideFlags = NULL;
rpmsenseFlags * provideFlags = NULL;
rpm_count_t providesCount, i;
int xx;
int bingo = 1;
@ -182,7 +182,7 @@ void providePackageNVR(Header h)
if (!hge(h, RPMTAG_PROVIDEVERSION, &pvt, (rpm_data_t *) &providesEVR, NULL)) {
for (i = 0; i < providesCount; i++) {
const char * vdummy = "";
int32_t fdummy = RPMSENSE_ANY;
rpmsenseFlags fdummy = RPMSENSE_ANY;
xx = headerAddOrAppendEntry(h, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE,
&vdummy, 1);
xx = headerAddOrAppendEntry(h, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE,

View File

@ -61,7 +61,7 @@ struct rpmpsm_s {
int progTag; /*!< Scriptlet interpreter tag. */
int npkgs_installed; /*!< No. of installed instances. */
int scriptArg; /*!< Scriptlet package arg. */
int sense; /*!< One of RPMSENSE_TRIGGER{PREIN,IN,UN,POSTUN}. */
rpmsenseFlags sense; /*!< One of RPMSENSE_TRIGGER{PREIN,IN,UN,POSTUN}. */
int countCorrection; /*!< 0 if installing, -1 if removing. */
int chrootDone; /*!< Was chroot(2) done by pkgStage? */
int unorderedSuccessor; /*!< Can the PSM be run asynchronously? */
@ -461,9 +461,9 @@ static const char * tag2sln(rpm_tag_t tag)
return "%unknownscript";
}
static rpm_tag_t triggertag(rpm_tag_t sense)
static rpm_tag_t triggertag(rpmsenseFlags sense)
{
rpm_tag_t tag = 0;
rpm_tag_t tag = RPMTAG_NOT_FOUND;
switch (sense) {
case RPMSENSE_TRIGGERIN:
tag = RPMTAG_TRIGGERIN;
@ -1018,7 +1018,7 @@ static rpmRC handleOneTrigger(const rpmpsm psm,
while ((i = rpmdsNext(trigger)) >= 0) {
rpm_tagtype_t tit, tst, tpt;
const char * Name;
int32_t Flags = rpmdsFlags(trigger);
rpmsenseFlags Flags = rpmdsFlags(trigger);
if ((Name = rpmdsN(trigger)) == NULL)
continue; /* XXX can't happen */

View File

@ -32,7 +32,7 @@ struct rpmds_s {
Header h; /*!< Header for dependency set (or NULL) */
const char ** N; /*!< Name. */
const char ** EVR; /*!< Epoch-Version-Release. */
int32_t * Flags; /*!< Bit(s) identifying context/comparison. */
rpmsenseFlags * Flags; /*!< Bit(s) identifying context/comparison. */
uint32_t * Color; /*!< Bit(s) calculated from file color(s). */
int32_t * Refs; /*!< No. of file refs. */
int32_t BT; /*!< Package build time tie breaker. */
@ -242,7 +242,7 @@ char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds)
return tbuf;
}
rpmds rpmdsThis(Header h, rpm_tag_t tagN, int32_t Flags)
rpmds rpmdsThis(Header h, rpm_tag_t tagN, rpmsenseFlags Flags)
{
HGE_t hge = (HGE_t) headerGetEntryMinMemory;
rpmds ds = NULL;
@ -315,7 +315,7 @@ exit:
return rpmdsLink(ds, (ds ? ds->Type : RPMDBG()));
}
rpmds rpmdsSingle(rpm_tag_t tagN, const char * N, const char * EVR, int32_t Flags)
rpmds rpmdsSingle(rpm_tag_t tagN, const char * N, const char * EVR, rpmsenseFlags Flags)
{
rpmds ds = NULL;
const char * Type;
@ -415,9 +415,9 @@ const char * rpmdsEVR(const rpmds ds)
return EVR;
}
int32_t rpmdsFlags(const rpmds ds)
rpmsenseFlags rpmdsFlags(const rpmds ds)
{
int32_t Flags = 0;
rpmsenseFlags Flags = 0;
if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) {
if (ds->Flags != NULL)
@ -666,7 +666,7 @@ int rpmdsMerge(rpmds * dsp, rpmds ods)
rpmds ds;
const char ** N;
const char ** EVR;
int32_t * Flags;
rpmsenseFlags * Flags;
int j;
int save;
@ -948,7 +948,7 @@ int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote)
int32_t * epoch;
const char * pkgEVR;
char * t;
int32_t pkgFlags = RPMSENSE_EQUAL;
rpmsenseFlags pkgFlags = RPMSENSE_EQUAL;
rpmds pkg;
int rc = 1; /* XXX assume match, names already match here */

View File

@ -138,7 +138,7 @@ char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds);
* @param Flags comparison flags
* @return new dependency set
*/
rpmds rpmdsThis(Header h, rpm_tag_t tagN, int32_t Flags);
rpmds rpmdsThis(Header h, rpm_tag_t tagN, rpmsenseFlags Flags);
/** \ingroup rpmds
* Create, load and initialize a dependency set of size 1.
@ -148,7 +148,7 @@ rpmds rpmdsThis(Header h, rpm_tag_t tagN, int32_t Flags);
* @param Flags comparison flags
* @return new dependency set
*/
rpmds rpmdsSingle(rpm_tag_t tagN, const char * N, const char * EVR, int32_t Flags);
rpmds rpmdsSingle(rpm_tag_t tagN, const char * N, const char * EVR, rpmsenseFlags Flags);
/** \ingroup rpmds
* Return dependency set count.
@ -198,7 +198,7 @@ extern const char * rpmdsEVR(const rpmds ds);
* @param ds dependency set
* @return current dependency flags, 0 on invalid
*/
int32_t rpmdsFlags(const rpmds ds);
rpmsenseFlags rpmdsFlags(const rpmds ds);
/** \ingroup rpmds
* Return current dependency type.

View File

@ -11,6 +11,7 @@
#include <rpm/rpmio.h>
#include <rpm/header.h>
#include <rpm/rpmtag.h>
#include <rpm/rpmds.h> /* XXX move rpmlib provides to rpmds instead */
#include <popt.h>
#ifdef __cplusplus
@ -207,7 +208,7 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
* @return no. of entries
*/
int rpmGetRpmlibProvides(const char *** provNames,
int ** provFlags,
rpmsenseFlags ** provFlags,
const char *** provVersions);
/** \ingroup rpmtrans

View File

@ -15,7 +15,7 @@
struct rpmlibProvides_s {
const char * featureName;
const char * featureEVR;
int featureFlags;
rpmsenseFlags featureFlags;
const char * featureDescription;
};
@ -95,11 +95,11 @@ int rpmCheckRpmlibProvides(const rpmds key)
return rc;
}
int rpmGetRpmlibProvides(const char *** provNames, int ** provFlags,
int rpmGetRpmlibProvides(const char *** provNames, rpmsenseFlags ** provFlags,
const char *** provVersions)
{
const char ** names, ** versions;
int * flags;
rpmsenseFlags * flags;
int n = 0;
while (rpmlibProvides[n].featureName != NULL)

View File

@ -407,7 +407,7 @@ rpmRC rpmtsImportPubkey(const rpmts ts, const unsigned char * pkt, size_t pktlen
const char * group = "Public Keys";
const char * license = "pubkey";
const char * buildhost = "localhost";
int32_t pflags = (RPMSENSE_KEYRING|RPMSENSE_EQUAL);
rpmsenseFlags pflags = (RPMSENSE_KEYRING|RPMSENSE_EQUAL);
int32_t zero = 0;
pgpDig dig = NULL;
pgpDigParams pubp = NULL;

View File

@ -600,7 +600,7 @@ assert(otherFi != NULL);
static int ensureOlder(rpmts ts,
const rpmte p, const Header h)
{
int32_t reqFlags = (RPMSENSE_LESS | RPMSENSE_EQUAL);
rpmsenseFlags reqFlags = (RPMSENSE_LESS | RPMSENSE_EQUAL);
const char * reqEVR;
rpmds req;
char * t;

View File

@ -214,7 +214,7 @@ rpmds_iternext(rpmdsObject * s)
const char * N = rpmdsN(s->ds);
const char * EVR = rpmdsEVR(s->ds);
rpm_tag_t tagN = rpmdsTagN(s->ds);
int Flags = rpmdsFlags(s->ds);
rpmsenseFlags Flags = rpmdsFlags(s->ds);
if (N != NULL) N = xstrdup(N);
if (EVR != NULL) EVR = xstrdup(EVR);
@ -453,7 +453,7 @@ static int rpmds_init(rpmdsObject * s, PyObject *args, PyObject *kwds)
hdrObject * ho = NULL;
PyObject * to = NULL;
rpm_tag_t tagN = RPMTAG_REQUIRENAME;
int flags = 0;
rpmsenseFlags flags = 0;
char * kwlist[] = {"header", "tag", "flags", NULL};
if (_rpmds_debug < 0)
@ -595,7 +595,7 @@ rpmds_Single(PyObject * s, PyObject * args, PyObject * kwds)
rpm_tag_t tagN = RPMTAG_PROVIDENAME;
const char * N;
const char * EVR = NULL;
int Flags = 0;
rpmsenseFlags Flags = 0;
char * kwlist[] = {"to", "name", "evr", "flags", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "Os|si:Single", kwlist,
@ -620,7 +620,7 @@ hdr_dsFromHeader(PyObject * s, PyObject * args, PyObject * kwds)
hdrObject * ho = (hdrObject *)s;
PyObject * to = NULL;
rpm_tag_t tagN = RPMTAG_REQUIRENAME;
int flags = 0;
rpmsenseFlags flags = 0;
char * kwlist[] = {"to", "flags", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi:dsFromHeader", kwlist,
@ -642,7 +642,7 @@ hdr_dsOfHeader(PyObject * s)
{
hdrObject * ho = (hdrObject *)s;
rpm_tag_t tagN = RPMTAG_PROVIDENAME;
int Flags = RPMSENSE_EQUAL;
rpmsenseFlags Flags = RPMSENSE_EQUAL;
return rpmds_Wrap( rpmdsThis(hdrGetHeader(ho), tagN, Flags) );
}

View File

@ -409,7 +409,7 @@ fprintf(stderr, "*** rpmts_Check(%p) ts %p cb %p\n", s, s->ts, cbInfo.cb);
const char * needsName;
char * byName, * byVersion, * byRelease, *byArch;
char * needsOP, * needsVersion;
int needsFlags, sense;
rpmsenseFlags needsFlags, sense;
fnpyKey key;
p = rpmpsGetProblem(psi);

View File

@ -27,7 +27,7 @@ static const char * avdbpath =
#endif
static int noDeps = 0;
static inline const char * identifyDepend(int32_t f)
static inline const char * identifyDepend(rpmsenseFlags f)
{
if (isLegacyPreReq(f))
return "PreReq:";