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);