- Still doesn't make much difference as it is, but further pre-requisites
for sanitizing the way dependencies are carried around.
- Change rpmSpecDS() to return the ds based on the actual source package
header, not buildRestrictions. Using buildRestrictions was probably
kinda wrong to begin with but its more so now as the actual
requires and conflicts go to the "real" header, not buildRestrictions.
(cherry picked from commit
42b2f78e724e02d677974314d460cc6dec5cbc5b)
char * N = NULL, * EVR = NULL;
rpmTagVal nametag = RPMTAG_NOT_FOUND;
rpmsenseFlags Flags;
- Header h = pkg->header; /* everything except buildrequires go here */
rpmRC rc = RPMRC_FAIL; /* assume failure */
switch (tagN) {
case RPMTAG_BUILDREQUIRES:
nametag = RPMTAG_REQUIRENAME;
tagflags |= RPMSENSE_ANY;
- h = spec->buildRestrictions;
+ pkg = spec->sourcePackage;
break;
case RPMTAG_BUILDCONFLICTS:
nametag = RPMTAG_CONFLICTNAME;
- h = spec->buildRestrictions;
+ pkg = spec->sourcePackage;
break;
}
} else
EVR = NULL;
- if (addReqProv(h, nametag, N, EVR, Flags, index)) {
+ if (addReqProv(pkg, nametag, N, EVR, Flags, index)) {
emsg = _("invalid dependency");
goto exit;
}
spec->lineNum, progArgv[0]);
goto exit;
} else {
- (void) addReqProv(pkg->header, RPMTAG_REQUIRENAME,
+ (void) addReqProv(pkg, RPMTAG_REQUIRENAME,
progArgv[0], NULL, (tagflags | RPMSENSE_INTERP), 0);
}
return isnew;
}
-int addReqProv(Header h, rpmTagVal tagN,
+int addReqProv(Package pkg, rpmTagVal tagN,
const char * N, const char * EVR, rpmsenseFlags Flags,
uint32_t index)
{
rpmTagVal flagtag = 0;
rpmTagVal indextag = 0;
rpmsenseFlags extra = RPMSENSE_ANY;
+ Header h = pkg->header; /* just a shortcut */
switch (tagN) {
case RPMTAG_PROVIDENAME:
rasprintf(&reqname, "rpmlib(%s)", feature);
- res = addReqProv(pkg->header, RPMTAG_REQUIRENAME, reqname, featureEVR,
+ res = addReqProv(pkg, RPMTAG_REQUIRENAME, reqname, featureEVR,
RPMSENSE_RPMLIB|(RPMSENSE_LESS|RPMSENSE_EQUAL), 0);
free(reqname);
rpmRC packageSources(rpmSpec spec, char **cookie);
/** \ingroup rpmbuild
- * Add dependency to header, filtering duplicates.
- * @param h header
+ * Add dependency to package, filtering duplicates.
+ * @param pkg package
* @param tagN tag, identifies type of dependency
* @param N (e.g. Requires: foo < 0:1.2-3, "foo")
* @param EVR (e.g. Requires: foo < 0:1.2-3, "0:1.2-3")
* @return 0 on success, 1 on error
*/
RPM_GNUC_INTERNAL
-int addReqProv(Header h, rpmTagVal tagN,
+int addReqProv(Package pkg, rpmTagVal tagN,
const char * N, const char * EVR, rpmsenseFlags Flags,
uint32_t index);
rpmds rpmSpecDS(rpmSpec spec, rpmTagVal tag)
{
- return (spec != NULL) ? rpmdsNew(spec->buildRestrictions, tag, 0) : NULL;
+ return (spec != NULL) ? rpmdsNew(spec->sourcePackage->header, tag, 0) : NULL;
}
rpmps rpmSpecCheckDeps(rpmts ts, rpmSpec spec)