summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-01-30 16:04:40 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-01-30 16:04:40 +0200
commitd2efb5d77c0a3a2f5919d40efe5e163254422b6f (patch)
tree7fc86609eb75acea785b47cace1618ef17ae88a0
parent87e01f336262f3738211c0426304590ed16284f8 (diff)
downloadlibrpm-tizen-d2efb5d77c0a3a2f5919d40efe5e163254422b6f.tar.gz
librpm-tizen-d2efb5d77c0a3a2f5919d40efe5e163254422b6f.tar.bz2
librpm-tizen-d2efb5d77c0a3a2f5919d40efe5e163254422b6f.zip
Use rpmsenseFlags type for dependency flags everywhere (hopefully)
-rw-r--r--build/parseScript.c2
-rw-r--r--build/rpmfc.c13
-rw-r--r--lib/depends.c6
-rw-r--r--lib/legacy.c6
-rw-r--r--lib/psm.c8
-rw-r--r--lib/rpmds.c14
-rw-r--r--lib/rpmds.h6
-rw-r--r--lib/rpmlib.h3
-rw-r--r--lib/rpmlibprov.c6
-rw-r--r--lib/rpmts.c2
-rw-r--r--lib/transaction.c2
-rw-r--r--python/rpmds-py.c10
-rw-r--r--python/rpmts-py.c2
-rw-r--r--tools/rpmsort.c2
14 files changed, 42 insertions, 40 deletions
diff --git a/build/parseScript.c b/build/parseScript.c
index 3d560f3ff..90faf1e8a 100644
--- a/build/parseScript.c
+++ b/build/parseScript.c
@@ -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;
diff --git a/build/rpmfc.c b/build/rpmfc.c
index 106fe1a14..7b1c28e26 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -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) {
diff --git a/lib/depends.c b/lib/depends.c
index eccb3a9eb..5c345bff4 100644
--- a/lib/depends.c
+++ b/lib/depends.c
@@ -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;
diff --git a/lib/legacy.c b/lib/legacy.c
index 86a205ba2..dda035b34 100644
--- a/lib/legacy.c
+++ b/lib/legacy.c
@@ -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,
diff --git a/lib/psm.c b/lib/psm.c
index 1b2ee970e..c4c825b3b 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -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 */
diff --git a/lib/rpmds.c b/lib/rpmds.c
index 84a859cc6..69781c233 100644
--- a/lib/rpmds.c
+++ b/lib/rpmds.c
@@ -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 */
diff --git a/lib/rpmds.h b/lib/rpmds.h
index 6b604b6ab..2500e6b1c 100644
--- a/lib/rpmds.h
+++ b/lib/rpmds.h
@@ -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.
diff --git a/lib/rpmlib.h b/lib/rpmlib.h
index fdc6316a6..c948a3f1e 100644
--- a/lib/rpmlib.h
+++ b/lib/rpmlib.h
@@ -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
diff --git a/lib/rpmlibprov.c b/lib/rpmlibprov.c
index 5bbdcf10a..39cd659e7 100644
--- a/lib/rpmlibprov.c
+++ b/lib/rpmlibprov.c
@@ -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)
diff --git a/lib/rpmts.c b/lib/rpmts.c
index ded3acc56..786ece15c 100644
--- a/lib/rpmts.c
+++ b/lib/rpmts.c
@@ -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;
diff --git a/lib/transaction.c b/lib/transaction.c
index ba3b23b67..4d0987596 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -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;
diff --git a/python/rpmds-py.c b/python/rpmds-py.c
index 8b694653d..fabd99eab 100644
--- a/python/rpmds-py.c
+++ b/python/rpmds-py.c
@@ -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) );
}
diff --git a/python/rpmts-py.c b/python/rpmts-py.c
index 98ebfee04..4ff01ce65 100644
--- a/python/rpmts-py.c
+++ b/python/rpmts-py.c
@@ -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);
diff --git a/tools/rpmsort.c b/tools/rpmsort.c
index 74b279bd5..9630ecb15 100644
--- a/tools/rpmsort.c
+++ b/tools/rpmsort.c
@@ -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:";