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