handeObsoletePackages: add a warning for packages which obsolete other existing packages

This commit is contained in:
Silvan Calarco 2011-09-14 23:57:55 +02:00
parent 10a6a28ea8
commit 30c3b97217

View File

@ -234,7 +234,7 @@ handleObsoletedPackages(struct configTag *ct, int archidx)
int i,j,k;
int obs[256];
char buf[PATH_MAX];
struct headerList* currchild;
struct headerList *currheader;
while (prov) {
@ -256,10 +256,10 @@ handleObsoletedPackages(struct configTag *ct, int archidx)
buf)) continue;
}
if (prov->provider[k]->sourceheader->altrepository == ct->repository_level) {
currchild = prov->provider[k]->sourceheader->firstchild[archidx];
while (currchild) {
currheader = prov->provider[k]->sourceheader->firstchild[archidx];
while (currheader) {
/* print 'obsoleted by' warning only for binary packages belonging to target repository */
if (!strcmp(currchild->name, prov->provider[k]->name)) {
if (!strcmp(currheader->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,
@ -269,7 +269,7 @@ handleObsoletedPackages(struct configTag *ct, int archidx)
logmsg(LOG_WARNING,"%s(%s): %s",prov->provider[k]->name, prov->provider[k]->arch, buf);
break;
}
currchild = currchild -> nextbrother;
currheader = currheader -> nextbrother;
}
}
if (prov->provider[i]->sourceheader->altrepository == ct->repository_level) {
@ -308,6 +308,30 @@ handleObsoletedPackages(struct configTag *ct, int archidx)
prov=prov->next;
}
/* report obsoleted elements which are provided by other packages */
currheader = ct->headerlist[archidx];
while (currheader) {
for (j = 0; j < currheader->obsoletecount; j++) {
prov=findOrCreateProvidedListEntry((struct providedList**) &ct->providedlist_idx[archidx],
currheader->obsoletename[j],0);
if (prov) {
for (i = 0; i < prov->numproviders; i++) {
if (prov->provider[i] != currheader) {
snprintf(buf, PATH_MAX, "obsoletes %s provided by package %s(%s) in %s",
prov->name,
prov->provider[i]->name,
prov->provider[i]->arch,
ct->repository[prov->provider[i]->sourceheader->altrepository]->tag);
addWarning(prov->provider[i]->sourceheader, buf);
logmsg(LOG_WARNING,"%s(%s): %s",currheader->name, currheader->arch, buf);
}
}
}
}
currheader = currheader->next;
}
return 0;
}