addReqProv: ignore self-provides

providePackageNVR already does the right thing.
This commit is contained in:
Дмитрий Левин 2020-11-11 08:00:00 +00:00
parent a1f907ca9c
commit 128d160548

View File

@ -266,7 +266,32 @@ int addReqProv(/*@unused@*/ Spec spec, Header h,
rpmsenseFlags extra = RPMSENSE_ANY;
int xx;
/*@-branchstate@*/
if (depEVR == NULL)
depEVR = "";
/*@=branchstate@*/
if (depFlags & RPMSENSE_PROVIDES) {
const char *name = NULL;
headerName(h, &name);
if (name != NULL && strcmp(name, depName) == 0) {
char dep_flags_str[4];
unsigned int i = 0;
if (depFlags & RPMSENSE_LESS)
dep_flags_str[i++] = '<';
if (depFlags & RPMSENSE_GREATER)
dep_flags_str[i++] = '>';
if (depFlags & RPMSENSE_EQUAL)
dep_flags_str[i++] = '=';
dep_flags_str[i] = '\0';
rpmMessage(RPMMESS_WARNING, "ignored self-provides: %s %s %s\n",
depName, dep_flags_str, depEVR);
return 0;
}
nametag = RPMTAG_PROVIDENAME;
versiontag = RPMTAG_PROVIDEVERSION;
flagtag = RPMTAG_PROVIDEFLAGS;
@ -299,11 +324,6 @@ int addReqProv(/*@unused@*/ Spec spec, Header h,
depFlags = (depFlags & (RPMSENSE_SENSEMASK)) | extra;
/*@-branchstate@*/
if (depEVR == NULL)
depEVR = "";
/*@=branchstate@*/
/* Check for duplicate dependencies. */
if (hge(h, nametag, &dnt, (void **) &names, &len) && len > 0) {
const char ** versions = NULL;