Fix checks when reporting fails to provide due to version

This commit is contained in:
Silvan Calarco 2013-10-06 18:49:42 +02:00
parent b9b62dc14c
commit 31c8e4b837

View File

@ -418,8 +418,8 @@ handleObsoletedPackages(struct configTag *ct, int archidx)
static int static int
resolveFirstLevelDependencies(struct configTag *ct, int archidx) resolveFirstLevelDependencies(struct configTag *ct, int archidx)
{ {
struct headerList *currheader, *scanheader, **newprovider; struct headerList *currheader, *scanheader, **newprovider, *foundverprovider;
struct providedList *provided, *foundverprovided; struct providedList *provided;
struct fileTree *file; struct fileTree *file;
int i,j,k,found; int i,j,k,found;
char warning[PATH_MAX]; char warning[PATH_MAX];
@ -615,24 +615,26 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx)
(currheader->require[i]->flags & (RPMSENSE_LESS|RPMSENSE_GREATER|RPMSENSE_EQUAL))) { (currheader->require[i]->flags & (RPMSENSE_LESS|RPMSENSE_GREATER|RPMSENSE_EQUAL))) {
found = 0; found = 0;
foundverprovided = NULL; foundverprovider = NULL;
for (j = 0; j < provided->numproviders; j++) { for (j = 0; j < provided->numproviders; j++) {
if (foundverprovided && !strcmp(foundverprovided->name,provided->name)) { if (foundverprovider &&
!strcmp(foundverprovider->name,provided->provider[j]->name) &&
foundverprovider->altrepository != provided->provider[j]->altrepository) {
found = 0; found = 0;
foundverprovided = NULL; foundverprovider = NULL;
} }
if (!strcmp(provided->version[j],"")) { if (!strcmp(provided->version[j],"")) {
/* provider with no version; assume ok */ /* provider with no version; assume ok */
found = 1; found = 1;
foundverprovided=provided; foundverprovider=provided->provider[j];
} else { } else {
if (checkVersionWithFlags( if (checkVersionWithFlags(
currheader->require[i]->version, currheader->require[i]->version,
currheader->require[i]->flags, currheader->require[i]->flags,
provided->version[j])) { provided->version[j])) {
found = 1; found = 1;
foundverprovided=provided; foundverprovider=provided->provider[j];
} }
} }
} /* for */ } /* for */
@ -657,13 +659,15 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx)
currheader->name, currheader->name,
currheader->arch, currheader->arch,
ct->repository[currheader->altrepository]->tag); ct->repository[currheader->altrepository]->tag);
logmsg(LOG_WARNING,"%s", warning);
for (k = 0; k < provided->numproviders; k++) { for (k = 0; k < provided->numproviders; k++) {
if (provided->provider[k]->sourceheader && if (provided->provider[k]->sourceheader &&
(provided->provider[k]->altrepository == ct->repository_level)) { (provided->provider[k]->altrepository == ct->repository_level)) {
fprintf(stderr,"Warning: %s\n", warning);
addWarning(provided->provider[k]->sourceheader, warning); addWarning(provided->provider[k]->sourceheader, warning);
} }
if ((currheader->altrepository == ct->repository_level)) {
addWarning(currheader->sourceheader, warning);
}
} }
} }
} }