Added a check to display 'obsoleted by' warning only for binary packages belonging to target repository

This commit is contained in:
Silvan Calarco 2011-08-12 17:53:10 +02:00
parent 01c345c579
commit c5fe806773

View File

@ -234,6 +234,7 @@ handleObsoletedPackages(struct configTag *ct, int archidx)
int i,j,k; int i,j,k;
int obs[256]; int obs[256];
char buf[PATH_MAX]; char buf[PATH_MAX];
struct headerList* currchild;
while (prov) { while (prov) {
@ -255,6 +256,10 @@ handleObsoletedPackages(struct configTag *ct, int archidx)
buf)) continue; buf)) continue;
} }
if (prov->provider[k]->sourceheader->altrepository == ct->repository_level) { if (prov->provider[k]->sourceheader->altrepository == ct->repository_level) {
currchild = prov->provider[k]->sourceheader->firstchild[archidx];
while (currchild) {
/* print 'obsoleted by' warning only for binary packages belonging to target repository */
if (!strcmp(currchild->name, prov->provider[k]->name)) {
snprintf(buf, PATH_MAX, "obsoleted by %s(%s) from package %s(source) in %s", snprintf(buf, PATH_MAX, "obsoleted by %s(%s) from package %s(source) in %s",
prov->provider[i]->name, prov->provider[i]->name,
prov->provider[i]->arch, prov->provider[i]->arch,
@ -262,6 +267,10 @@ handleObsoletedPackages(struct configTag *ct, int archidx)
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(%s): %s",prov->provider[k]->name, prov->provider[k]->arch, buf);
break;
}
currchild = currchild -> 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, "obsoletes %s from package %s(source) in %s",