diff --git a/src/distromatic.c b/src/distromatic.c index 4a1053c..e804b81 100644 --- a/src/distromatic.c +++ b/src/distromatic.c @@ -234,6 +234,7 @@ handleObsoletedPackages(struct configTag *ct, int archidx) int i,j,k; int obs[256]; char buf[PATH_MAX]; + struct headerList* currchild; while (prov) { @@ -255,13 +256,21 @@ handleObsoletedPackages(struct configTag *ct, int archidx) buf)) continue; } if (prov->provider[k]->sourceheader->altrepository == ct->repository_level) { - snprintf(buf, PATH_MAX, "obsoleted by %s(%s) from package %s(source) in %s", - prov->provider[i]->name, - prov->provider[i]->arch, - prov->provider[i]->sourceheader->name, - ct->repository[prov->provider[i]->sourceheader->altrepository]->tag); - addWarning(prov->provider[k]->sourceheader, buf); - logmsg(LOG_WARNING,"%s(%s): %s",prov->provider[k]->name, prov->provider[k]->arch, buf); + 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", + prov->provider[i]->name, + prov->provider[i]->arch, + prov->provider[i]->sourceheader->name, + ct->repository[prov->provider[i]->sourceheader->altrepository]->tag); + addWarning(prov->provider[k]->sourceheader, 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) { snprintf(buf, PATH_MAX, "obsoletes %s from package %s(source) in %s",