From 5fa39e3b168aceccb7bcb2d7c11445989b4c84de Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Wed, 12 Oct 2011 12:02:42 +0200 Subject: [PATCH] print_datatables: check and ignore obsoleted providers when printing deps table --- src/reports.c | 77 +++++++++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 33 deletions(-) diff --git a/src/reports.c b/src/reports.c index 435ad93..7c07383 100644 --- a/src/reports.c +++ b/src/reports.c @@ -1770,7 +1770,7 @@ print_datatables(struct configTag *ct, int arch) { char obsoletebuf[1024]; struct headerList *currheaderlist, *currchild; struct headerSourceList * currheadersourcelist; - int i,depscnt; + int i, depscnt, nonobsoletednumproviders; snprintf(builddeps_filename,1024,"%sbuilddeps-%s",ct->html_dir,ct->arch[arch]); snprintf(deps_filename,1024,"%sdeps-%s",ct->html_dir,ct->arch[arch]); @@ -1859,44 +1859,55 @@ print_datatables(struct configTag *ct, int arch) { // write deps file struct providedList* provided = ct->providedlist_idx[arch][0]; while (provided) { - if (provided->numproviders > 1) { + nonobsoletednumproviders=0; + for (i = 0; i < provided->numproviders; i++) { + if (!provided->provider[i]->obsoleted) nonobsoletednumproviders++; + } + if (nonobsoletednumproviders > 1) { fprintf(fd,"ifndef "); fprintf_depstable_filtered_var(fd,provided->name); - fprintf(fd,"\n"); - fprintf_depstable_filtered_var(fd,provided->name); - fprintf(fd," := "); - fprintf_depstable_filtered_var(fd,provided->name); - fprintf(fd,"_to_be_defined # "); + fprintf(fd,"\n"); + fprintf_depstable_filtered_var(fd,provided->name); + fprintf(fd," := "); + fprintf_depstable_filtered_var(fd,provided->name); + fprintf(fd,"_to_be_defined # "); - fprintf_depstable_filtered_var(fs,provided->name); - fprintf(fs,":"); - for (i = 0; i < provided->numproviders; i++) { - fprintf(fd,"%s ",provided->provider[i]->name); - fprintf(fs," _%s",provided->provider[i]->sourceheader->name); - } - fprintf(fs,"\n"); + fprintf_depstable_filtered_var(fs,provided->name); + fprintf(fs,":"); + for (i = 0; i < provided->numproviders; i++) { + if (!provided->provider[i]->obsoleted) { + fprintf(fd,"%s ",provided->provider[i]->name); + fprintf(fs," _%s",provided->provider[i]->sourceheader->name); + } + } + fprintf(fs,"\n"); - fprintf(fd,"\nendif\n"); - fprintf_depstable_filtered_var(fd,provided->name); - fprintf(fd,": "); - fprintf(fd,"$("); - fprintf_depstable_filtered_var(fd,provided->name); - fprintf(fd,")\n"); + fprintf(fd,"\nendif\n"); + fprintf_depstable_filtered_var(fd,provided->name); + fprintf(fd,": "); + fprintf(fd,"$("); + fprintf_depstable_filtered_var(fd,provided->name); + fprintf(fd,")\n"); fprintf(fv,"%s= # ",provided->name); - for (i = 0; i < provided->numproviders; i++) { - fprintf(fv,"%s ",provided->provider[i]->name); - } - fprintf(fv,"\n"); - } else if (provided->numproviders == 1 && (strcmp(provided->name,provided->provider[0]->name))) { - fprintf_depstable_filtered_var(fd,provided->name); - fprintf(fd,": "); - fprintf(fd,"%s\n",provided->provider[0]->name); - - fprintf_depstable_filtered_var(fs,provided->name); - fprintf(fs,": _%s\n",provided->provider[0]->sourceheader->name); - - } else if (provided->numproviders == 0) { + for (i = 0; i < provided->numproviders; i++) { + if (!provided->provider[i]->obsoleted) { + fprintf(fv,"%s ",provided->provider[i]->name); + } + } + fprintf(fv,"\n"); + } else if (nonobsoletednumproviders == 1) { + for (i = 0; i < provided->numproviders; i++) { + if (!provided->provider[i]->obsoleted) break; + } + if (strcmp(provided->name,provided->provider[i]->name)) { + fprintf_depstable_filtered_var(fd,provided->name); + fprintf(fd,": "); + fprintf(fd,"%s\n",provided->provider[i]->name); + fprintf_depstable_filtered_var(fs,provided->name); + fprintf(fs,": _%s\n",provided->provider[i]->sourceheader->name); + } + } else { fprintf_depstable_filtered_var(fd,provided->name); fprintf(fd,": "); fprintf(fd,"__missing_provider_for_");