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);
}
} else { /* provided->numproviders > 0 */
k=0;
for (j = 0; j < provided->numproviders; j++) {
if (provided->provider[j]->obsoleted && !currheader->obsoleted) {
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++;
}
if (k == provided->numproviders) { // all provides are obsoleted
snprintf(warning, PATH_MAX, "%s needed by %s(%s,%s) is only provided by obsoleted package(s):",
provided->name,
currheader->name,
currheader->arch,
ct->repository[currheader->altrepository]->tag,
ct->repository[currheader->altrepository]->tag);
for (j = 0; j < provided->numproviders; j++) {
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] == '/') {
/* when there is a Requires: /file/requirement add provide from file tree as well */
file=findOrCreateFileTreeEntry(&ct->filetree[archidx],currheader->require[i]->name);