addReqProv: do not add provided requires

This commit is contained in:
Дмитрий Левин 2004-01-24 23:31:06 +00:00
parent f34648ca99
commit 47e6eacc52

View File

@ -126,6 +126,43 @@ int addReqProv(/*@unused@*/ Spec spec, Header h,
return 0;
}
/* Do not add provided requires. */
if ((nametag == RPMTAG_REQUIRENAME) &&
(flagtag == RPMTAG_REQUIREFLAGS) &&
!(depFlags & _notpre(RPMSENSE_RPMLIB | RPMSENSE_KEYRING | RPMSENSE_SCRIPT_PRE | RPMSENSE_SCRIPT_POSTUN)) &&
!isLegacyPreReq(depFlags) &&
hge(h, RPMTAG_PROVIDENAME, &dnt, (void **) &names, &len)) {
int skip = 0;
int *flags = 0;
const char ** versions = 0;
rpmTagType dvt = RPM_STRING_ARRAY_TYPE;
hge(h, RPMTAG_PROVIDEVERSION, &dvt, (void **) &versions, NULL);
hge(h, RPMTAG_PROVIDEFLAGS, NULL, (void **) &flags, NULL);
while (flags && versions && (len > 0)) {
--len;
if (strcmp (depName, names[len]))
continue;
if (!(depFlags & RPMSENSE_SENSEMASK)) {
skip = 1;
break;
}
if (!(flags[len] & RPMSENSE_SENSEMASK))
continue;
if (rpmRangesOverlap (names[len], versions[len], flags[len], depName, depEVR, depFlags)) {
skip = 1;
break;
}
}
versions = hfd(versions, dvt);
names = hfd(names, dnt);
if (skip) return 0;
}
/* Add this dependency. */
xx = headerAddOrAppendEntry(h, nametag, RPM_STRING_ARRAY_TYPE, &depName, 1);
if (flagtag) {