Provide smarter warnings for obsoleted and obsoleting packages

This commit is contained in:
Silvan Calarco 2011-09-15 17:48:23 +02:00
parent 30c3b97217
commit 1e56f5eb13

View File

@ -260,25 +260,28 @@ handleObsoletedPackages(struct configTag *ct, int archidx)
while (currheader) { while (currheader) {
/* print 'obsoleted by' warning only for binary packages belonging to target repository */ /* print 'obsoleted by' warning only for binary packages belonging to target repository */
if (!strcmp(currheader->name, prov->provider[k]->name)) { if (!strcmp(currheader->name, prov->provider[k]->name)) {
snprintf(buf, PATH_MAX, "obsoleted by %s(%s) from package %s(source) in %s", snprintf(buf, PATH_MAX, "%s(%s) obsoleted by %s(%s) in %s",
prov->provider[k]->name,
prov->provider[k]->arch,
prov->provider[i]->name, prov->provider[i]->name,
prov->provider[i]->arch, prov->provider[i]->arch,
prov->provider[i]->sourceheader->name,
ct->repository[prov->provider[i]->sourceheader->altrepository]->tag); ct->repository[prov->provider[i]->sourceheader->altrepository]->tag);
addWarning(prov->provider[k]->sourceheader, buf); addWarning(prov->provider[k]->sourceheader, buf);
logmsg(LOG_WARNING,"%s(%s): %s",prov->provider[k]->name, prov->provider[k]->arch, buf); logmsg(LOG_WARNING,"%s", buf);
break; break;
} }
currheader = currheader -> nextbrother; currheader = currheader -> nextbrother;
} }
} }
if (prov->provider[i]->sourceheader->altrepository == ct->repository_level) { if (prov->provider[i]->sourceheader->altrepository == ct->repository_level) {
snprintf(buf, PATH_MAX, "obsoletes %s from package %s(source) in %s", snprintf(buf, PATH_MAX, "%s(%s) obsoletes %s(%s) in %s",
prov->provider[i]->name,
prov->provider[i]->arch,
prov->provider[k]->name, prov->provider[k]->name,
prov->provider[k]->sourceheader->name, prov->provider[k]->arch,
ct->repository[prov->provider[k]->sourceheader->altrepository]->tag); ct->repository[prov->provider[k]->sourceheader->altrepository]->tag);
addWarning(prov->provider[i]->sourceheader, buf); addWarning(prov->provider[i]->sourceheader, buf);
logmsg(LOG_WARNING,"%s(%s): %s",prov->provider[i]->name, prov->provider[i]->arch, buf); logmsg(LOG_WARNING,"%s", buf);
} }
obs[k]=i; obs[k]=i;
} }
@ -318,13 +321,24 @@ handleObsoletedPackages(struct configTag *ct, int archidx)
if (prov) { if (prov) {
for (i = 0; i < prov->numproviders; i++) { for (i = 0; i < prov->numproviders; i++) {
if (prov->provider[i] != currheader) { if (prov->provider[i] != currheader) {
snprintf(buf, PATH_MAX, "obsoletes %s provided by package %s(%s) in %s", if (!strcmp(prov->name,prov->provider[i]->name)) {
snprintf(buf, PATH_MAX, "%s(%s) obsoletes %s(%s) in %s",
currheader->name,
currheader->arch,
prov->provider[i]->name,
prov->provider[i]->arch,
ct->repository[prov->provider[i]->sourceheader->altrepository]->tag);
} else {
snprintf(buf, PATH_MAX, "%s(%s) obsoletes %s provided by %s(%s) in %s",
currheader->name,
currheader->arch,
prov->name, prov->name,
prov->provider[i]->name, prov->provider[i]->name,
prov->provider[i]->arch, prov->provider[i]->arch,
ct->repository[prov->provider[i]->sourceheader->altrepository]->tag); ct->repository[prov->provider[i]->sourceheader->altrepository]->tag);
addWarning(prov->provider[i]->sourceheader, buf); }
logmsg(LOG_WARNING,"%s(%s): %s",currheader->name, currheader->arch, buf); addWarning(currheader->sourceheader, buf);
logmsg(LOG_WARNING,"%s", buf);
} }
} }
} }