rpmds provides; /*!< (no. provides) package provides */
rpmds requires; /*!< (no. requires) package requires */
+ rpmds supplements; /*!< (no. supplements) package supplements */
};
struct rpmfcTokens_s {
return 0;
}
+/**
+ * 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 },
rpmdsFree(fc->provides);
rpmdsFree(fc->requires);
+ rpmdsFree(fc->supplements);
memset(fc, 0, sizeof(*fc)); /* trash and burn */
free(fc);
}
return (fc != NULL ? fc->requires : NULL);
}
+rpmds rpmfcSupplements(rpmfc fc)
+{
+ return (fc != NULL ? fc->supplements : NULL);
+}
+
rpmRC rpmfcApply(rpmfc fc)
{
const char * s;
for (ARGV_t fattr = fc->fattrs[fc->ix]; fattr && *fattr; fattr++) {
rpmfcHelperProvides(fc, *fattr);
rpmfcHelperRequires(fc, *fattr);
+ rpmfcHelperSupplements(fc, *fattr);
}
}
/* No more additions after this, freeze pool to minimize memory use */
dix = rpmdsFind(fc->requires, ds);
rpmdsFree(ds);
break;
+ case 'S':
+ ds = rpmdsSingle(RPMTAG_ENHANCESNAME, N, EVR, Flags);
+ dix = rpmdsFind(fc->supplements, ds);
+ ds = rpmdsFree(ds);
+ break;
}
if (dix < 0)
}
}
+ /* Add Supplements: */
+ if (!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)) {
headerPut(pkg->header, &td, HEADERPUT_DEFAULT);