From 1570c792bef15c5d8bb4688bd3d91305f35bc438 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 12 Jul 2013 02:04:18 +0200 Subject: [PATCH] reports.c: added generation on warnings-*.sh files and added warnings_list in builds-*.sh --- src/reports.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/reports.c b/src/reports.c index daa1ea2..bb52f5f 100644 --- a/src/reports.c +++ b/src/reports.c @@ -81,7 +81,7 @@ comparePackagers(const void *ptr1, const void *ptr2) } int -printHTMLWarnings(FILE *fout,struct configTag *configtag, struct headerSourceList* pkg, int mode) { +printHTMLWarnings(FILE *fout, struct configTag *configtag, struct headerSourceList* pkg, int mode) { char warningsfile[PATH_MAX]; char buf[1024]; @@ -140,6 +140,8 @@ printHTMLWarnings(FILE *fout,struct configTag *configtag, struct headerSourceLis fprintf(fout," • %s\n",currwarning->text); } else if (mode == 1) { fprintf(fout," • %s
",currwarning->text); + } else if (mode == 2) { + fprintf(fout,"%s %s\n",pkg->name,currwarning->text); } currwarning = currwarning->next; } @@ -1787,10 +1789,10 @@ void print_contents_subtree(FILE *f, int print_datatables(struct configTag *ct, int arch) { - FILE *fbd,*fd,*fv,*fb,*fbsh,*fs,*fc; + FILE *fbd,*fd,*fv,*fb,*fbsh,*fs,*fc,*fw; char builddeps_filename[1024], deps_filename[1024], virtual_filename[1024], builds_filename[1024], builds_sh_filename[1024], sources_filename[1024], - contents_filename[1024], buf[1024]; + contents_filename[1024], warnings_filename[1024], buf[1024]; char obsoletebuf[PATH_MAX]; struct headerList *currheaderlist, *currchild; struct headerSourceList * currheadersourcelist; @@ -1802,8 +1804,8 @@ print_datatables(struct configTag *ct, int arch) { snprintf(builds_filename,1024,"%sbuilds-%s",ct->html_dir,ct->arch[arch]); snprintf(builds_sh_filename,1024,"%sbuilds-%s.sh",ct->html_dir,ct->arch[arch]); snprintf(sources_filename,1024,"%ssources-%s",ct->html_dir,ct->arch[arch]); - snprintf(contents_filename,1024,"%scontentslist-%s",ct->repository_dir,ct->arch[arch]); + snprintf(warnings_filename,1024,"%swarnings-%s",ct->repository_dir,ct->arch[arch]); fbd=fopen(builddeps_filename,"w"); if (!fbd) { @@ -1847,6 +1849,12 @@ print_datatables(struct configTag *ct, int arch) { return 1; } + fw=fopen(warnings_filename,"w"); + if (!fw) { + fprintf(stderr, "Error: can't open file for writing: %s. Aborting.\n", warnings_filename); + return 1; + } + // // headerlist scan: write top of deps and sources files // @@ -2037,6 +2045,17 @@ print_datatables(struct configTag *ct, int arch) { } fprintf(fbsh,");\n"); + fprintf(fbsh,"warnings_list=("); + currheadersourcelist = ct->headersourcelist; + while (currheadersourcelist != NULL) { + if ((currheadersourcelist->altrepository == ct->repository_level) && + (printHTMLWarnings(fw,ct,currheadersourcelist,2) == 1)) { + fprintf(fbsh,"%s ",currheadersourcelist->name); + } + currheadersourcelist = currheadersourcelist->next; + } + fprintf(fbsh,");\n"); + currheadersourcelist = ct->headersourcelist; logmsg(LOG_DEBUG,"writing builds and sources files (2)"); while (currheadersourcelist != NULL) { @@ -2096,6 +2115,7 @@ print_datatables(struct configTag *ct, int arch) { fclose(fb); fclose(fs); fclose(fc); + fclose(fw); return 0; }