From e07f68435d13f0b1d38f2361d71c80948ef91ad5 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Wed, 4 Sep 2013 16:53:22 +0200 Subject: [PATCH] distromatic: fixes to obsoletes detection: - ignore obsoletes from obsoleted packages - ignore obsoletes from updated or updating packages which apply to same {up/down}stream source build packages --- src/distromatic.c | 58 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/src/distromatic.c b/src/distromatic.c index ac7baf5..b4ed137 100644 --- a/src/distromatic.c +++ b/src/distromatic.c @@ -347,33 +347,55 @@ handleObsoletedPackages(struct configTag *ct, int archidx) prov=prov->next; } - /* report obsoleted elements which are provided by other packages */ + /* mark obsoleted elements which are provided by other packages */ currheader = ct->headerlist[archidx]; while (currheader) { + if (currheader->obsoleted == 0) for (j = 0; j < currheader->obsoletecount; j++) { prov=findOrCreateProvidedListEntry((struct providedList**) &ct->providedlist_idx[archidx], currheader->obsoletename[j],0,archidx); if (prov) { for (i = 0; i < prov->numproviders; i++) { if (strcmp(currheader->name,prov->provider[i]->name)) { - prov->provider[i]->obsoleted = 1; - if (!strcmp(prov->name,prov->provider[i]->name)) { - snprintf(buf, PATH_MAX, "%s(%s,%s) obsoletes %s(%s,%s)", - currheader->name, - currheader->arch, - ct->repository[currheader->altrepository]->tag, - prov->provider[i]->name, - prov->provider[i]->arch, - ct->repository[prov->provider[i]->altrepository]->tag); +// if (currheader->sourceheader != prov->provider[i]->sourceheader) { + if (prov->provider[i]->sourceheader == currheader->sourceheader) { + snprintf(buf, PATH_MAX, "%s(%s,%s) obsoletes %s provided by %s(%s,%s) which comes from its own source; ignoring", + currheader->name, + currheader->arch, + ct->repository[currheader->altrepository]->tag, + prov->name, + prov->provider[i]->name, + prov->provider[i]->arch, + ct->repository[prov->provider[i]->altrepository]->tag); + } else if (!strcmp(prov->provider[i]->sourceheader->name,currheader->sourceheader->name)) { + snprintf(buf, PATH_MAX, "%s(%s,%s) obsoletes %s provided by %s(%s,%s) which comes from same source name; ignoring", + currheader->name, + currheader->arch, + ct->repository[currheader->altrepository]->tag, + prov->name, + prov->provider[i]->name, + prov->provider[i]->arch, + ct->repository[prov->provider[i]->altrepository]->tag); } else { - snprintf(buf, PATH_MAX, "%s(%s,%s) obsoletes %s provided by %s(%s,%s)", - currheader->name, - currheader->arch, - ct->repository[currheader->altrepository]->tag, - prov->name, - prov->provider[i]->name, - prov->provider[i]->arch, - ct->repository[prov->provider[i]->altrepository]->tag); + prov->provider[i]->obsoleted = 1; + if (!strcmp(prov->name,prov->provider[i]->name)) { + snprintf(buf, PATH_MAX, "%s(%s,%s) obsoletes %s(%s,%s)", + currheader->name, + currheader->arch, + ct->repository[currheader->altrepository]->tag, + prov->provider[i]->name, + prov->provider[i]->arch, + ct->repository[prov->provider[i]->altrepository]->tag); + } else { + snprintf(buf, PATH_MAX, "%s(%s,%s) obsoletes %s provided by %s(%s,%s)", + currheader->name, + currheader->arch, + ct->repository[currheader->altrepository]->tag, + prov->name, + prov->provider[i]->name, + prov->provider[i]->arch, + ct->repository[prov->provider[i]->altrepository]->tag); + } } addWarning(currheader->sourceheader, buf); logmsg(LOG_WARNING,"%s", buf);