Print warning only when all providing packages are obsoleted

This commit is contained in:
Silvan Calarco 2012-05-31 12:08:36 +02:00
parent 2c5d8f223c
commit f79ed692f6

View File

@ -473,20 +473,25 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx)
addWarning(currheader->sourceheader,warning); addWarning(currheader->sourceheader,warning);
} }
} else { /* provided->numproviders > 0 */ } else { /* provided->numproviders > 0 */
for (j = 0; j < provided->numproviders; j++) { k=0;
if (provided->provider[j]->obsoleted && !currheader->obsoleted) { for (j = 0; j < provided->numproviders; j++) {
snprintf(warning, PATH_MAX, "%s needed by %s(%s,%s) is provided by obsoleted package %s(%s,%s)", if (provided->provider[j]->obsoleted && !currheader->obsoleted) k++;
provided->name, }
currheader->name, if (k == provided->numproviders) { // all provides are obsoleted
currheader->arch, snprintf(warning, PATH_MAX, "%s needed by %s(%s,%s) is only provided by obsoleted package(s):",
ct->repository[currheader->altrepository]->tag, provided->name,
provided->provider[j]->name, currheader->name,
provided->provider[j]->arch, currheader->arch,
ct->repository[provided->provider[j]->altrepository]->tag); ct->repository[currheader->altrepository]->tag);
fprintf(stderr,"Warning: %s\n",warning); for (j = 0; j < provided->numproviders; j++) {
addWarning(currheader->sourceheader,warning); snprintf(&warning[strlen(warning)], PATH_MAX - strlen(warning), " %s(%s,%s)",
} provided->provider[j]->name,
} provided->provider[j]->arch,
ct->repository[provided->provider[j]->altrepository]->tag);
}
fprintf(stderr,"Warning: %s\n",warning);
addWarning(currheader->sourceheader,warning);
}
if ((currheader->require[i]->name)[0] == '/') { if ((currheader->require[i]->name)[0] == '/') {
/* when there is a Requires: /file/requirement add provide from file tree as well */ /* when there is a Requires: /file/requirement add provide from file tree as well */
file=findOrCreateFileTreeEntry(&ct->filetree[archidx],currheader->require[i]->name); file=findOrCreateFileTreeEntry(&ct->filetree[archidx],currheader->require[i]->name);