firstLevelDependencies: don't report warnings for missing multiple providers when upstream satisfies it

This commit is contained in:
Silvan Calarco 2013-10-12 15:38:53 +02:00
parent 40aa848d81
commit 16f350bdc4

View File

@ -412,7 +412,7 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx)
struct headerList *currheader, *scanheader, **newprovider; struct headerList *currheader, *scanheader, **newprovider;
struct providedList *provided; struct providedList *provided;
struct fileTree *file; struct fileTree *file;
int i,j,k,found,foundprovider; int i,j,k,found,foundprovider, foundupstreamprovider;
char warning[PATH_MAX]; char warning[PATH_MAX];
char ** newversion; char ** newversion;
@ -607,17 +607,20 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx)
found = 0; found = 0;
foundprovider = -1; foundprovider = -1;
foundupstreamprovider = 0;
for (j = 0; j < provided->numproviders; j++) { for (j = 0; j < provided->numproviders; j++) {
/* updated packages: ignore check with upstream package */ /* updated packages: ignore check with upstream package */
if ((foundprovider >= 0) && if ((foundprovider >= 0) &&
!strcmp(provided->provider[foundprovider]->name,provided->provider[j]->name) && !strcmp(provided->provider[foundprovider]->name,provided->provider[j]->name) &&
provided->provider[foundprovider]->altrepository != provided->provider[j]->altrepository) { provided->provider[foundprovider]->altrepository < provided->provider[j]->altrepository) {
found -= 1; found -= 1;
foundupstreamprovider = foundprovider;
foundprovider = -1; foundprovider = -1;
} }
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;
foundupstreamprovider = foundprovider;
foundprovider = j; foundprovider = j;
} else { } else {
if (checkVersionWithFlags( if (checkVersionWithFlags(
@ -625,16 +628,20 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx)
currheader->require[i]->flags, currheader->require[i]->flags,
provided->version[j])) { provided->version[j])) {
found += 1; found += 1;
foundupstreamprovider = foundprovider;
foundprovider = j; foundprovider = j;
} }
} }
/*if (!strcmp(provided->name,"pkgconfig(gio-2.0)"))
printf("provided->name=pkgconfig(gio-2.0) found=%d foundprovider=%d foundupstreamprovider=%d provided->version[j]=%s\n",
found, foundprovider, foundupstreamprovider, provided->version[j]);*/
} /* for */ } /* for */
if ((found >= 1) && if ((found >= 1) && (!foundupstreamprovider) &&
(currheader->altrepository != 0) && (currheader->altrepository != 0) &&
(currheader->altrepository = ct->repository_level) && (currheader->altrepository = ct->repository_level) &&
(provided->provider[foundprovider]->sourceheader != currheader->sourceheader) && (provided->provider[foundprovider]->sourceheader != currheader->sourceheader) &&
(provided->provider[foundprovider]->altrepository == currheader->altrepository)) { (provided->provider[foundprovider]->altrepository == currheader->altrepository)) {
snprintf(warning, PATH_MAX, "%s(%s,%s) requires %s(%s,%s) because it provides %s=%s", snprintf(warning, PATH_MAX, "%s(%s,%s) requires %s(%s,%s) because it needs %s=%s",
currheader->name, currheader->name,
currheader->arch, currheader->arch,
ct->repository[currheader->altrepository]->tag, ct->repository[currheader->altrepository]->tag,