From c5fe8067734c2c63c8a63a0243c20093463eaa44 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 12 Aug 2011 17:53:10 +0200 Subject: [PATCH] Added a check to display 'obsoleted by' warning only for binary packages belonging to target repository --- src/distromatic.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) 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",