2014-02-20 14:18:41 +01:00
|
|
|
--- ./build/rpmfc.c.orig 2014-02-20 12:56:59.836814478 +0000
|
|
|
|
+++ ./build/rpmfc.c 2014-02-20 12:58:18.886814338 +0000
|
|
|
|
@@ -59,6 +59,7 @@ struct rpmfc_s {
|
|
|
|
rpmstrPool pool; /*!< general purpose string storage */
|
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 {
|
2014-02-20 14:18:41 +01:00
|
|
|
@@ -583,6 +584,22 @@ static int rpmfcHelperRequires(rpmfc fc,
|
|
|
|
RPMSENSE_FIND_REQUIRES, RPMTAG_REQUIRENAME);
|
2012-08-28 15:31:44 +02:00
|
|
|
}
|
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 },
|
2014-02-20 14:18:41 +01:00
|
|
|
@@ -800,6 +817,8 @@ 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);
|
2014-02-20 14:18:41 +01:00
|
|
|
+
|
|
|
|
rpmstrPoolFree(fc->pool);
|
2012-08-28 15:31:44 +02:00
|
|
|
memset(fc, 0, sizeof(*fc)); /* trash and burn */
|
|
|
|
free(fc);
|
2014-02-20 14:18:41 +01:00
|
|
|
@@ -833,6 +852,11 @@ rpmds rpmfcRequires(rpmfc fc)
|
2012-08-28 15:31:44 +02:00
|
|
|
return (fc != NULL ? fc->requires : NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
+rpmds rpmfcSupplements(rpmfc fc)
|
|
|
|
+{
|
|
|
|
+ return (fc != NULL ? fc->supplements : NULL);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
rpmRC rpmfcApply(rpmfc fc)
|
|
|
|
{
|
|
|
|
const char * s;
|
2014-02-20 14:18:41 +01:00
|
|
|
@@ -853,6 +877,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
|
|
|
}
|
|
|
|
}
|
2013-07-12 16:11:14 +02:00
|
|
|
/* No more additions after this, freeze pool to minimize memory use */
|
2014-02-20 14:18:41 +01:00
|
|
|
@@ -897,6 +922,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)
|
2014-02-20 14:18:41 +01:00
|
|
|
@@ -1380,6 +1410,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);
|
2014-02-20 14:18:41 +01:00
|
|
|
--- ./build/rpmfc.h.orig 2012-11-07 12:55:24.000000000 +0000
|
|
|
|
+++ ./build/rpmfc.h 2014-02-20 12:57:04.466814469 +0000
|
2012-08-28 15:31:44 +02:00
|
|
|
@@ -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
|