2011-05-16 18:07:44 +02:00
|
|
|
Add support for supplements to the internal dependency
|
|
|
|
generator.
|
|
|
|
|
2011-12-11 22:58:21 +01:00
|
|
|
Index: build/rpmfc.c
|
|
|
|
===================================================================
|
|
|
|
--- build/rpmfc.c.orig 2011-12-09 14:46:56.296892644 +0100
|
|
|
|
+++ build/rpmfc.c 2011-12-09 14:47:08.510313829 +0100
|
|
|
|
@@ -57,6 +57,7 @@ struct rpmfc_s {
|
2011-05-16 18:07:44 +02:00
|
|
|
|
|
|
|
rpmds provides; /*!< (no. provides) package provides */
|
|
|
|
rpmds requires; /*!< (no. requires) package requires */
|
|
|
|
+ rpmds supplements; /*!< (no. supplements) package supplements */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct rpmfcTokens_s {
|
2011-12-11 22:58:21 +01:00
|
|
|
@@ -504,6 +505,14 @@ static int rpmfcHelper(rpmfc fc, unsigne
|
2011-05-16 18:07:44 +02:00
|
|
|
dsContext = RPMSENSE_FIND_REQUIRES;
|
|
|
|
tagN = RPMTAG_REQUIRENAME;
|
|
|
|
break;
|
|
|
|
+ case 'S':
|
|
|
|
+ if (fc->skipProv)
|
|
|
|
+ return 0;
|
|
|
|
+ depname = "supplements";
|
|
|
|
+ depsp = &fc->supplements;
|
|
|
|
+ dsContext = RPMSENSE_FIND_REQUIRES|RPMSENSE_STRONG|RPMSENSE_MISSINGOK;
|
|
|
|
+ tagN = RPMTAG_ENHANCESNAME;
|
|
|
|
+ break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If the entire path is filtered out, there's nothing more to do */
|
2011-12-11 22:58:21 +01:00
|
|
|
@@ -779,6 +788,7 @@ rpmfc rpmfcFree(rpmfc fc)
|
2011-05-16 18:07:44 +02:00
|
|
|
|
|
|
|
fc->provides = rpmdsFree(fc->provides);
|
|
|
|
fc->requires = rpmdsFree(fc->requires);
|
|
|
|
+ fc->supplements = rpmdsFree(fc->supplements);
|
|
|
|
}
|
|
|
|
fc = _free(fc);
|
|
|
|
return NULL;
|
2011-12-11 22:58:21 +01:00
|
|
|
@@ -831,6 +841,7 @@ rpmRC rpmfcApply(rpmfc fc)
|
2011-05-16 18:07:44 +02:00
|
|
|
for (ARGV_t fattr = fc->fattrs[fc->ix]; fattr && *fattr; fattr++) {
|
|
|
|
xx += rpmfcHelper(fc, 'P', *fattr);
|
|
|
|
xx += rpmfcHelper(fc, 'R', *fattr);
|
|
|
|
+ xx += rpmfcHelper(fc, 'S', *fattr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-11 22:58:21 +01:00
|
|
|
@@ -873,6 +884,11 @@ rpmRC rpmfcApply(rpmfc fc)
|
2011-05-16 18:07:44 +02:00
|
|
|
dix = rpmdsFind(fc->requires, ds);
|
|
|
|
ds = rpmdsFree(ds);
|
|
|
|
break;
|
|
|
|
+ case 'S':
|
|
|
|
+ ds = rpmdsSingle(RPMTAG_ENHANCESNAME, N, EVR, Flags);
|
|
|
|
+ dix = rpmdsFind(fc->supplements, ds);
|
|
|
|
+ ds = rpmdsFree(ds);
|
|
|
|
+ break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* XXX assertion incorrect while generating -debuginfo deps. */
|
2011-12-11 22:58:21 +01:00
|
|
|
@@ -1384,6 +1400,18 @@ rpmRC rpmfcGenerateDepends(const rpmSpec
|
2011-05-16 18:07:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ /* Add Supplements: */
|
|
|
|
+ if (fc->supplements != NULL && rpmdsCount(fc->supplements) > 0 && !fc->skipReq) {
|
|
|
|
+ rpmds pi = rpmdsInit(fc->supplements);
|
|
|
|
+ while (rpmdsNext(pi) >= 0) {
|
|
|
|
+ rpmsenseFlags flags = rpmdsFlags(pi);
|
|
|
|
+
|
|
|
|
+ headerPutString(pkg->header, RPMTAG_ENHANCESNAME, rpmdsN(pi));
|
|
|
|
+ headerPutString(pkg->header, RPMTAG_ENHANCESVERSION, rpmdsEVR(pi));
|
|
|
|
+ headerPutUint32(pkg->header, RPMTAG_ENHANCESFLAGS, &flags, 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
/* Add dependency dictionary(#dependencies) */
|
|
|
|
if (rpmtdFromArgi(&td, RPMTAG_DEPENDSDICT, fc->ddictx)) {
|
|
|
|
assert(rpmtdType(&td) == RPM_INT32_TYPE);
|