2012-08-28 15:31:44 +02:00
|
|
|
Add support for supplements to the internal dependency generator.
|
2011-05-16 18:07:44 +02:00
|
|
|
|
2012-08-28 15:31:44 +02:00
|
|
|
--- ./build/rpmfc.c.orig 2012-06-01 13:44:21.000000000 +0000
|
|
|
|
+++ ./build/rpmfc.c 2012-06-01 14:00:45.000000000 +0000
|
2011-12-11 22:58:21 +01:00
|
|
|
@@ -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 {
|
2012-08-28 15:31:44 +02:00
|
|
|
@@ -545,6 +546,22 @@ static int rpmfcHelperRequires(rpmfc fc,
|
|
|
|
return 0;
|
|
|
|
}
|
2011-05-16 18:07:44 +02:00
|
|
|
|
2012-08-28 15:31:44 +02:00
|
|
|
+/**
|
|
|
|
+ * Run per-interpreter Supplements: dependency helper.
|
|
|
|
+ * @param fc file classifier
|
|
|
|
+ * @param nsdep class name for interpreter (e.g. "perl")
|
|
|
|
+ * @return 0
|
|
|
|
+ */
|
|
|
|
+static int rpmfcHelperSupplements(rpmfc fc, const char * nsdep)
|
|
|
|
+{
|
|
|
|
+ if (fc->skipReq)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
+ rpmfcHelper(fc, nsdep, "supplements", &fc->supplements, RPMSENSE_FIND_REQUIRES|RPMSENSE_STRONG|RPMSENSE_MISSINGOK, RPMTAG_ENHANCESNAME);
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
/* Only used for elf coloring and controlling RPMTAG_FILECLASS inclusion now */
|
|
|
|
static const struct rpmfcTokens_s rpmfcTokens[] = {
|
|
|
|
{ "directory", RPMFC_INCLUDE },
|
|
|
|
@@ -762,6 +779,7 @@ rpmfc rpmfcFree(rpmfc fc)
|
2011-05-16 18:07:44 +02:00
|
|
|
|
2012-08-28 15:31:44 +02:00
|
|
|
rpmdsFree(fc->provides);
|
|
|
|
rpmdsFree(fc->requires);
|
|
|
|
+ rpmdsFree(fc->supplements);
|
|
|
|
memset(fc, 0, sizeof(*fc)); /* trash and burn */
|
|
|
|
free(fc);
|
2011-05-16 18:07:44 +02:00
|
|
|
}
|
2012-08-28 15:31:44 +02:00
|
|
|
@@ -793,6 +811,11 @@ rpmds rpmfcRequires(rpmfc fc)
|
|
|
|
return (fc != NULL ? fc->requires : NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
+rpmds rpmfcSupplements(rpmfc fc)
|
|
|
|
+{
|
|
|
|
+ return (fc != NULL ? fc->supplements : NULL);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
rpmRC rpmfcApply(rpmfc fc)
|
|
|
|
{
|
|
|
|
const char * s;
|
|
|
|
@@ -814,6 +837,7 @@ rpmRC rpmfcApply(rpmfc fc)
|
2011-05-16 18:07:44 +02:00
|
|
|
for (ARGV_t fattr = fc->fattrs[fc->ix]; fattr && *fattr; fattr++) {
|
2012-08-28 15:31:44 +02:00
|
|
|
rpmfcHelperProvides(fc, *fattr);
|
|
|
|
rpmfcHelperRequires(fc, *fattr);
|
|
|
|
+ rpmfcHelperSupplements(fc, *fattr);
|
2011-05-16 18:07:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-28 15:31:44 +02:00
|
|
|
@@ -856,6 +880,11 @@ rpmRC rpmfcApply(rpmfc fc)
|
2011-05-16 18:07:44 +02:00
|
|
|
dix = rpmdsFind(fc->requires, ds);
|
2012-08-28 15:31:44 +02:00
|
|
|
rpmdsFree(ds);
|
2011-05-16 18:07:44 +02:00
|
|
|
break;
|
|
|
|
+ case 'S':
|
|
|
|
+ ds = rpmdsSingle(RPMTAG_ENHANCESNAME, N, EVR, Flags);
|
|
|
|
+ dix = rpmdsFind(fc->supplements, ds);
|
|
|
|
+ ds = rpmdsFree(ds);
|
|
|
|
+ break;
|
|
|
|
}
|
|
|
|
|
2012-08-28 15:31:44 +02:00
|
|
|
if (dix < 0)
|
|
|
|
@@ -1347,6 +1376,18 @@ rpmRC rpmfcGenerateDepends(const rpmSpec
|
2011-05-16 18:07:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ /* Add Supplements: */
|
2012-08-28 15:31:44 +02:00
|
|
|
+ if (!fc->skipReq) {
|
2011-05-16 18:07:44 +02:00
|
|
|
+ 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)) {
|
2012-08-28 15:31:44 +02:00
|
|
|
headerPut(pkg->header, &td, HEADERPUT_DEFAULT);
|
|
|
|
--- ./build/rpmfc.h.orig 2012-06-01 13:53:12.000000000 +0000
|
|
|
|
+++ ./build/rpmfc.h 2012-06-01 13:53:44.000000000 +0000
|
|
|
|
@@ -106,6 +106,13 @@ rpmds rpmfcProvides(rpmfc fc);
|
|
|
|
*/
|
|
|
|
rpmds rpmfcRequires(rpmfc fc);
|
|
|
|
|
|
|
|
+/** \ingroup rpmfc
|
|
|
|
+ * Retrieve file classification supplements
|
|
|
|
+ * @param fc file classifier
|
|
|
|
+ * @return rpmds dependency set of fc requires
|
|
|
|
+ */
|
|
|
|
+rpmds rpmfcSupplements(rpmfc fc);
|
|
|
|
+
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|