From 6f5f28dde3356d0cacecf2170aa79834e6e975d8 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Tue, 27 Sep 2011 20:35:49 +0200 Subject: [PATCH] Modify several messages to print packages in the form packagename(arch,repository) --- src/distromatic.c | 41 ++++++++++++++++++++++++++++------------- src/headerlist.c | 5 ++++- src/reports.c | 8 +++++--- 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/src/distromatic.c b/src/distromatic.c index aceea82..27b601d 100644 --- a/src/distromatic.c +++ b/src/distromatic.c @@ -260,12 +260,13 @@ handleObsoletedPackages(struct configTag *ct, int archidx) while (currheader) { /* print 'obsoleted by' warning only for binary packages belonging to target repository */ if (!strcmp(currheader->name, prov->provider[k]->name)) { - snprintf(buf, PATH_MAX, "%s(%s) obsoleted by %s(%s) in %s", + snprintf(buf, PATH_MAX, "%s(%s,%s) obsoleted by %s(%s,%s)", prov->provider[k]->name, prov->provider[k]->arch, + ct->repository[prov->provider[k]->sourceheader->altrepository]->tag, prov->provider[i]->name, prov->provider[i]->arch, - ct->repository[prov->provider[i]->sourceheader->altrepository]->tag); + ct->repository[prov->provider[i]->sourceheader->altrepository]->tag); addWarning(prov->provider[k]->sourceheader, buf); logmsg(LOG_WARNING,"%s", buf); break; @@ -274,9 +275,10 @@ handleObsoletedPackages(struct configTag *ct, int archidx) } } if (prov->provider[i]->sourceheader->altrepository == ct->repository_level) { - snprintf(buf, PATH_MAX, "%s(%s) obsoletes %s(%s) in %s", + snprintf(buf, PATH_MAX, "%s(%s,%s) obsoletes %s(%s,%s)", prov->provider[i]->name, prov->provider[i]->arch, + ct->repository[prov->provider[i]->sourceheader->altrepository]->tag, prov->provider[k]->name, prov->provider[k]->arch, ct->repository[prov->provider[k]->sourceheader->altrepository]->tag); @@ -322,16 +324,18 @@ handleObsoletedPackages(struct configTag *ct, int archidx) for (i = 0; i < prov->numproviders; i++) { if (prov->provider[i] != currheader) { if (!strcmp(prov->name,prov->provider[i]->name)) { - snprintf(buf, PATH_MAX, "%s(%s) obsoletes %s(%s) in %s", + snprintf(buf, PATH_MAX, "%s(%s,%s) obsoletes %s(%s,%s)", currheader->name, currheader->arch, + ct->repository[currheader->sourceheader->altrepository]->tag, prov->provider[i]->name, prov->provider[i]->arch, ct->repository[prov->provider[i]->sourceheader->altrepository]->tag); } else { - snprintf(buf, PATH_MAX, "%s(%s) obsoletes %s provided by %s(%s) in %s", + snprintf(buf, PATH_MAX, "%s(%s,%s) obsoletes %s provided by %s(%s,%s)", currheader->name, currheader->arch, + ct->repository[currheader->sourceheader->altrepository]->tag, prov->name, prov->provider[i]->name, prov->provider[i]->arch, @@ -422,7 +426,11 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx) } } if (!scanheader) { - snprintf(warning,PATH_MAX,"%s(%s): missing provider for %s",currheader->name,ct->arch[archidx],currheader->require[i]->name); + snprintf(warning,PATH_MAX,"%s(%s,%s): missing provider for %s", + currheader->name, + ct->arch[archidx], + ct->repository[currheader->sourceheader->altrepository]->tag, + currheader->require[i]->name); fprintf(stderr,"Warning: %s\n",warning); addWarning(currheader->sourceheader,warning); } @@ -448,19 +456,23 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx) } /* for */ if (!found) { for (j = 0; j < provided->numversions; j++) { - snprintf(warning, PATH_MAX, "%s = %s fails to provide %s ", provided->name, provided->version[j], provided->name); + snprintf(warning, PATH_MAX, "%s = %s fails to provide %s ", + provided->name, + provided->version[j], + provided->name); if (currheader->require[i]->flags & RPMSENSE_LESS) snprintf(&warning[strlen(warning)], PATH_MAX,"<"); if (currheader->require[i]->flags & RPMSENSE_GREATER) snprintf(&warning[strlen(warning)], PATH_MAX, ">"); if (currheader->require[i]->flags & RPMSENSE_EQUAL) snprintf(&warning[strlen(warning)], PATH_MAX, "="); - snprintf(&warning[strlen(warning)], PATH_MAX, " %s to %s(%s)", - currheader->require[i]->version, currheader->name,ct->arch[archidx]); + snprintf(&warning[strlen(warning)], PATH_MAX, " %s to %s(%s,%s)", + currheader->require[i]->version, + currheader->name, + currheader->arch, + ct->repository[currheader->sourceheader->altrepository]->tag); for (k = 0; k < provided->numproviders; k++) { if (provided->provider[k]->sourceheader && (provided->provider[k]->sourceheader->altrepository == ct->repository_level)) { - fprintf(stderr,"Warning: %s: %s\n", - provided->provider[k]->name, - warning); + fprintf(stderr,"Warning: %s\n", warning); addWarning(provided->provider[k]->sourceheader, warning); } } @@ -543,7 +555,10 @@ resolveFirstLevelSourceDependencies(struct configTag *ct, int archidx) } if (!scanheader) { snprintf(warning,PATH_MAX,"missing build provider for %s",currsourceheader->require[i]->name); - fprintf(stderr,"Warning: %s(source): %s\n",currsourceheader->name,warning); + fprintf(stderr,"Warning: %s(source,%s): %s\n", + currsourceheader->name, + ct->repository[currsourceheader->altrepository]->tag, + warning); addWarning(currsourceheader,warning); } /* if (scanheader) { diff --git a/src/headerlist.c b/src/headerlist.c index 8527263..315b618 100644 --- a/src/headerlist.c +++ b/src/headerlist.c @@ -675,7 +675,10 @@ addToSourceHeaderList(struct headerSourceList **headersourcelist, struct configT currheadersourcelist->version, currheadersourcelist->release); logmsg(LOG_WARNING, - "%s(source): %s", newheadersourcelist->name, warning); + "%s(source,%s): %s", + newheadersourcelist->name, + ct->repository[newheadersourcelist->altrepository]->tag, + warning); addWarning(newheadersourcelist, warning); } } diff --git a/src/reports.c b/src/reports.c index 75d95e9..1e94e96 100644 --- a/src/reports.c +++ b/src/reports.c @@ -1168,7 +1168,7 @@ generateHTML_SRPMSFiles(struct configTag *configtag) configtag->arch[0], currheadersourcelist->require[i]->resolved->name); if (configtag->repository_level > 0) { - snprintf(buffer, PATH_MAX, "has build requirement %s in this repository", + snprintf(buffer, PATH_MAX, "has build requirement %s which is provided in this repository", currheadersourcelist->require[i]->resolved->name); addWarning(currheadersourcelist, buffer); } @@ -1583,11 +1583,13 @@ generateHTMLFiles(struct configTag *ct, int arch) currheaderlist->require[i]->resolved->provider[0]->name); if ((ct->repository_level > 0) && (currheaderlist->sourceheader != currheaderlist->require[i]->resolved->provider[0]->sourceheader)) { - snprintf(buffer, PATH_MAX, "%s(%s) requires %s(%s) in this repository", + snprintf(buffer, PATH_MAX, "%s(%s,%s) requires %s(%s,%s) which is in this repository", currheaderlist->name, ct->arch[arch], + ct->repository[currheaderlist->sourceheader->altrepository]->tag, currheaderlist->require[i]->resolved->provider[0]->name, - ct->arch[arch]); + ct->arch[arch], + ct->repository[currheaderlist->require[i]->resolved->provider[0]->sourceheader->altrepository]->tag); addWarning(currheaderlist->sourceheader, buffer); } } else