From 2c5d8f223c4724bd1ec6ab5dc0c45d0ce38661b8 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Tue, 29 May 2012 19:59:03 +0200 Subject: [PATCH] Complete previous fix by setting packages as obsoleted in other parts --- src/distromatic.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/distromatic.c b/src/distromatic.c index 8d77122..5252a2c 100644 --- a/src/distromatic.c +++ b/src/distromatic.c @@ -258,9 +258,10 @@ handleObsoletedPackages(struct configTag *ct, int archidx) /* print 'obsoletes' warning for binary packages belonging to target repository, and 'obsoleted by' for all obsoletions in upper level repositories */ if (prov->provider[k]->altrepository != ct->repository_level) { - currheader = prov->provider[k]->sourceheader->firstchild[archidx]; + currheader = prov->provider[k]->sourceheader->firstchild[archidx]; while (currheader) { if (!strcmp(currheader->name, prov->provider[k]->name)) { + prov->provider[k]->obsoleted = 1; snprintf(buf, PATH_MAX, "%s(%s,%s) obsoleted by %s(%s,%s)", prov->provider[k]->name, prov->provider[k]->arch, @@ -272,10 +273,10 @@ handleObsoletedPackages(struct configTag *ct, int archidx) logmsg(LOG_WARNING,"%s", buf); break; } - currheader -> obsoleted = 1; currheader = currheader -> nextbrother; } } else { + prov->provider[k]->obsoleted = 1; snprintf(buf, PATH_MAX, "%s(%s,%s) obsoletes %s(%s,%s)", prov->provider[i]->name, prov->provider[i]->arch, @@ -324,6 +325,7 @@ handleObsoletedPackages(struct configTag *ct, int archidx) if (prov) { for (i = 0; i < prov->numproviders; i++) { if (prov->provider[i] != currheader) { + 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, @@ -472,7 +474,7 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx) } } else { /* provided->numproviders > 0 */ for (j = 0; j < provided->numproviders; j++) { - if (provided->provider[j] && provided->provider[j]->obsoleted) { + if (provided->provider[j]->obsoleted && !currheader->obsoleted) { snprintf(warning, PATH_MAX, "%s needed by %s(%s,%s) is provided by obsoleted package %s(%s,%s)", provided->name, currheader->name,