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
This commit is contained in:
Silvan Calarco 2013-09-04 16:53:22 +02:00
parent 6cf2f008b1
commit e07f68435d

View File

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