diff --git a/build/reqprov.c b/build/reqprov.c index d7a4d13..6e8aaad 100644 --- a/build/reqprov.c +++ b/build/reqprov.c @@ -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;