reports.c: indentation fixes
This commit is contained in:
parent
1182d9ac32
commit
b70cb5cf71
106
src/reports.c
106
src/reports.c
@ -751,7 +751,6 @@ generateHTMLMainIndex(struct configTag *configtag)
|
||||
int
|
||||
generateHTML_SRPMSFiles(struct configTag *configtag)
|
||||
{
|
||||
|
||||
humanDate strdate;
|
||||
char indexfile[PATH_MAX];
|
||||
char htmlfile[PATH_MAX];
|
||||
@ -825,10 +824,8 @@ generateHTML_SRPMSFiles(struct configTag *configtag)
|
||||
}
|
||||
|
||||
for (arch = 0; arch < ARCHS_MAX + 1 && findexout[arch]; arch++) {
|
||||
fprintf(findexout[arch],
|
||||
"<h1><b>%s</b> - %s</h1>\n",
|
||||
configtag->tag,
|
||||
configtag->description);
|
||||
fprintf(findexout[arch], "<h1><b>%s</b> - %s</h1>\n",
|
||||
configtag->tag, configtag->description);
|
||||
if (configtag->repository_level > 0) {
|
||||
fprintf(findexout[arch],"<h2>Depends on:</h2> ");
|
||||
for (c=0; c < configtag->repository_level; c++) {
|
||||
@ -840,8 +837,7 @@ generateHTML_SRPMSFiles(struct configTag *configtag)
|
||||
}
|
||||
fprintf(findexout[arch],"\n");
|
||||
}
|
||||
fprintf(findexout[arch],
|
||||
"<br><h2>List of packages:</h2>\n[ ");
|
||||
fprintf(findexout[arch], "<br><h2>List of packages:</h2>\n[ ");
|
||||
// <th width=18></th><th nowrap align=left><b>Source</b></th><th nowrap align=left><b>Release</b></th><th width=100%% nowrap align=left><b>Builds</b></th></tr>\n");
|
||||
|
||||
for (c='a'; c <= 'z'; c++) {
|
||||
@ -851,25 +847,20 @@ generateHTML_SRPMSFiles(struct configTag *configtag)
|
||||
}
|
||||
|
||||
currheadersourcelist = configtag->headersourcelist;
|
||||
|
||||
while (currheadersourcelist) {
|
||||
if ((configtag->repository_level == 0) ||
|
||||
(currheadersourcelist->altrepository == configtag->repository_level)) {
|
||||
|
||||
curr_letter=currheadersourcelist->name[0];
|
||||
if (curr_letter >= 'A' && curr_letter <= 'Z') curr_letter=curr_letter+'a'-'A';
|
||||
|
||||
snprintf(htmlfile,PATH_MAX,"%spackages/%s.source.inc",configtag->html_dir,currheadersourcelist->name);
|
||||
|
||||
snprintf(htmlfile,PATH_MAX,"%spackages/%s.source.inc",
|
||||
configtag->html_dir,currheadersourcelist->name);
|
||||
if ((fout = fopen(htmlfile, "w")) == NULL) {
|
||||
perror(htmlfile);
|
||||
return 1;
|
||||
}
|
||||
|
||||
get_favicon_from_url(currheadersourcelist->url, buffer2, PATH_MAX);
|
||||
|
||||
fprintf(fout,
|
||||
"<h1><img src=\"%s\" width=\"16\" height=\"16\">"
|
||||
fprintf(fout, "<h1><img src=\"%s\" width=\"16\" height=\"16\">"
|
||||
" %s: %s (source)</h1><table class=\"pkgpage\" width=\"100%%\">\n",
|
||||
buffer2,
|
||||
currheadersourcelist->name,
|
||||
@ -903,8 +894,7 @@ generateHTML_SRPMSFiles(struct configTag *configtag)
|
||||
groupdirname(currheadersourcelist->group, buffer2),
|
||||
htmlclean(currheadersourcelist->group,buffer,PATH_MAX));
|
||||
|
||||
fprintf(fout,
|
||||
"<tr><td>Maintainer:</td><td>");
|
||||
fprintf(fout, "<tr><td>Maintainer:</td><td>");
|
||||
|
||||
if (currheadersourcelist->packager &&
|
||||
(currheadersourcelist->packager->role & PACKAGER_ROLE_MAINTAINER)) {
|
||||
@ -915,12 +905,12 @@ generateHTML_SRPMSFiles(struct configTag *configtag)
|
||||
currheadersourcelist->packager->name,
|
||||
currheadersourcelist->packager->name);
|
||||
// currheadersourcelist->packager->packages_count++;
|
||||
} else
|
||||
} else {
|
||||
fprintf(fout,
|
||||
"<a href=\"%stag=%s&maintainer=unmaintained\"><b>unmaintained</b></a></td></tr>\n",
|
||||
configtag->configdefaults->url_prefix,
|
||||
configtag->tag);
|
||||
|
||||
}
|
||||
fprintf(fout,
|
||||
"<tr><td>Description:</td><td><font size=\"-1\">%s</font></td></tr>\n",
|
||||
htmlclean(currheadersourcelist->description,buffer,PATH_MAX));
|
||||
@ -932,9 +922,7 @@ generateHTML_SRPMSFiles(struct configTag *configtag)
|
||||
humanSize(currheadersourcelist->size, &strsize));
|
||||
|
||||
if (configtag->download_prefix) {
|
||||
|
||||
fprintf(fout,"<tr><td>Download:</td><td><font size=\"-1\">");
|
||||
|
||||
fprintf(fout,"<a href=\"%s%s/SRPMS.base/%s-%s-%s.src.rpm\">%s-%s-%s.src.rpm</a>",
|
||||
configtag->download_prefix,
|
||||
configtag->download_dir,
|
||||
@ -947,11 +935,12 @@ generateHTML_SRPMSFiles(struct configTag *configtag)
|
||||
fprintf(fout,"</font></td></tr>\n");
|
||||
}
|
||||
|
||||
if (currheadersourcelist->url)
|
||||
if (currheadersourcelist->url) {
|
||||
fprintf(fout,
|
||||
"<tr><td>URL:</td><td><font size=\"-1\"><a href=\"%s\" target=\"_new\">%s</a></font></td></tr>\n",
|
||||
currheadersourcelist->url,
|
||||
currheadersourcelist->url);
|
||||
}
|
||||
|
||||
fprintf(fout,
|
||||
"<tr><td>Specfile:</td><td><font size=\"-1\"><a href=\"%s%s/specs/%s.spec\">%s.spec</a>",
|
||||
@ -962,30 +951,24 @@ generateHTML_SRPMSFiles(struct configTag *configtag)
|
||||
|
||||
if (currheadersourcelist->source) {
|
||||
fprintf(fout,"<tr><td>Sources:</td><td><font size=\"-1\">");
|
||||
|
||||
i=0;
|
||||
while (currheadersourcelist->source[i+1]) i++;
|
||||
|
||||
for (; i>=0; i--)
|
||||
fprintf(fout,"%s ",currheadersourcelist->source[i]);
|
||||
|
||||
for (; i>=0; i--) fprintf(fout,"%s ",currheadersourcelist->source[i]);
|
||||
fprintf(fout,"</font></td></tr>\n");
|
||||
}
|
||||
|
||||
if (currheadersourcelist->patch) {
|
||||
fprintf(fout,"<tr><td>Patches:</td><td><font size=\"-1\">");
|
||||
|
||||
i=0;
|
||||
while (currheadersourcelist->patch[i+1]) i++;
|
||||
|
||||
for (; i>=0; i--)
|
||||
for (; i>=0; i--) {
|
||||
// fprintf(fout,"%s ",currheadersourcelist->patch[i]);
|
||||
fprintf(fout,"<a href=\"%s%s/patches/%s\">%s</a> ",
|
||||
configtag->showfile_prefix,
|
||||
configtag->download_dir,
|
||||
currheadersourcelist->patch[i],
|
||||
currheadersourcelist->patch[i]);
|
||||
|
||||
}
|
||||
fprintf(fout,"</font></td></tr>\n");
|
||||
}
|
||||
|
||||
@ -1025,22 +1008,19 @@ generateHTML_SRPMSFiles(struct configTag *configtag)
|
||||
currheadersourcelist->epoch,
|
||||
currheadersourcelist->version,
|
||||
currheadersourcelist->release);
|
||||
|
||||
} else {
|
||||
fprintf(findexout[idx],
|
||||
"%s-%s",
|
||||
currheadersourcelist->version,
|
||||
currheadersourcelist->release);
|
||||
}
|
||||
|
||||
fprintf(findexout[idx]," - ");
|
||||
}
|
||||
} // for
|
||||
|
||||
fprintf(fout,"<tr><td>Built RPMS:</td><td><font size=\"-1\">");
|
||||
for (arch = 0; arch < ARCHS_MAX && configtag->arch[arch]; arch++) {
|
||||
/* write children to both fout and findexout */
|
||||
currchild = currheadersourcelist->firstchild[arch];
|
||||
|
||||
c = 0;
|
||||
while (currchild) {
|
||||
for (idx = 0; idx < ARCHS_MAX + 1 && findexout[idx]; idx++) {
|
||||
@ -1053,8 +1033,7 @@ generateHTML_SRPMSFiles(struct configTag *configtag)
|
||||
currchild->name,
|
||||
configtag->configdefaults->url_dir);
|
||||
}
|
||||
fprintf(fout,
|
||||
"<a href=\"%stag=%s&pkg=%s.%s\">%s(%s)</a> ",
|
||||
fprintf(fout, "<a href=\"%stag=%s&pkg=%s.%s\">%s(%s)</a> ",
|
||||
configtag->configdefaults->url_prefix,
|
||||
configtag->tag, currchild->name, configtag->arch[arch],
|
||||
currchild->name, configtag->arch[arch]);
|
||||
@ -1098,7 +1077,8 @@ generateHTML_SRPMSFiles(struct configTag *configtag)
|
||||
currheadersourcelist->require[i]->resolved->name);
|
||||
if ((configtag->repository_level > 0) &&
|
||||
currheadersourcelist->require[i]->resolved->buildprovider[0]->sourceheader &&
|
||||
(currheadersourcelist->require[i]->resolved->buildprovider[0]->altrepository == configtag->repository_level)) {
|
||||
(currheadersourcelist->require[i]->resolved->buildprovider[0]->altrepository == configtag->repository_level))
|
||||
{
|
||||
snprintf(buffer, PATH_MAX, "has build requirement %s which is only provided in this repository",
|
||||
currheadersourcelist->require[i]->resolved->name);
|
||||
addWarning(currheadersourcelist, buffer);
|
||||
@ -1138,14 +1118,10 @@ generateHTML_SRPMSFiles(struct configTag *configtag)
|
||||
/* print changelog to fout */
|
||||
fprintf(fout,
|
||||
"<tr><td>Changelog:</td><td><font size=\"-1\" face=\"Courier,Courier New,monospace\">");
|
||||
|
||||
currchangelog = currheadersourcelist->changelog;
|
||||
|
||||
while (currchangelog) {
|
||||
// changelog_total++;
|
||||
simpleTimeToHuman(currchangelog->time,
|
||||
(humanDate *) & strdate);
|
||||
|
||||
simpleTimeToHuman(currchangelog->time, (humanDate *) & strdate);
|
||||
if (currchangelog->pkg) {
|
||||
if ((currchangelog->pkg->role & PACKAGER_ROLE_MAINTAINER) &&
|
||||
(currchangelog->pkg->packages_count)) {
|
||||
@ -1166,12 +1142,12 @@ generateHTML_SRPMSFiles(struct configTag *configtag)
|
||||
htmlclean(currchangelog->text,buffer,PATH_MAX));
|
||||
// currchangelog->pkg->changes_count++;
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
fprintf(fout, "%s - (noname) (%s)<br>%s<br>",
|
||||
&strdate[0],
|
||||
currchangelog->release,
|
||||
htmlclean(currchangelog->text,buffer,PATH_MAX));
|
||||
|
||||
}
|
||||
currchangelog = currchangelog->next;
|
||||
}
|
||||
|
||||
@ -1180,7 +1156,8 @@ generateHTML_SRPMSFiles(struct configTag *configtag)
|
||||
fclose(fout);
|
||||
}
|
||||
currheadersourcelist = currheadersourcelist->next;
|
||||
}
|
||||
} // while currheadersourcelist
|
||||
|
||||
for (idx = 0; idx < ARCHS_MAX + 1 && findexout[idx]; idx++) {
|
||||
fprintf(findexout[idx], "</table>\n");
|
||||
fclose(findexout[idx]);
|
||||
@ -1300,7 +1277,6 @@ cleanHTMLFiles(struct configTag *ct)
|
||||
int
|
||||
generateHTMLFiles(struct configTag *ct, int arch)
|
||||
{
|
||||
|
||||
char buffer[PATH_MAX];
|
||||
char htmlfile[PATH_MAX];
|
||||
int i,j;
|
||||
@ -1355,9 +1331,9 @@ generateHTMLFiles(struct configTag *ct, int arch)
|
||||
fprintf(fout,
|
||||
"<tr><td>Architecture:</td><td>%s</td></tr>\n",
|
||||
currheaderlist->arch);
|
||||
/* fprintf(fout,
|
||||
"<tr><td>Summary:</td><td><b>%s</b></td></tr>\n",
|
||||
htmlclean(currheaderlist->summary,buffer,PATH_MAX));*/
|
||||
//fprintf(fout,
|
||||
// "<tr><td>Summary:</td><td><b>%s</b></td></tr>\n",
|
||||
// htmlclean(currheaderlist->summary,buffer,PATH_MAX));
|
||||
fprintf(fout,
|
||||
"<tr><td>Group:</td><td>%s</td></tr>\n",
|
||||
htmlclean(currheaderlist->group,buffer,PATH_MAX));
|
||||
@ -1366,15 +1342,12 @@ generateHTMLFiles(struct configTag *ct, int arch)
|
||||
fprintf(fout,
|
||||
"<tr><td>Size:</td><td><font size=\"-1\">%s</font></td></tr>\n",
|
||||
humanSize(currheaderlist->size, &strsize));
|
||||
|
||||
/* fprintf(fout,
|
||||
"<tr><td>Arch:</td><td><font size=\"-1\">%s</font></td></tr>\n",
|
||||
currheaderlist->arch);*/
|
||||
//fprintf(fout,
|
||||
// "<tr><td>Arch:</td><td><font size=\"-1\">%s</font></td></tr>\n",
|
||||
// currheaderlist->arch);
|
||||
|
||||
if (ct->download_prefix) {
|
||||
|
||||
fprintf(fout,"<tr><td>Download:</td><td><font size=\"-1\">");
|
||||
|
||||
fprintf(fout,"<a href=\"%s%s/RPMS.%s/%s-%s-%s.%s.rpm\">%s-%s-%s.%s.rpm</a>",
|
||||
ct->download_prefix,
|
||||
ct->download_dir,
|
||||
@ -1391,8 +1364,7 @@ generateHTMLFiles(struct configTag *ct, int arch)
|
||||
fprintf(fout,"</font></td></tr>\n");
|
||||
}
|
||||
|
||||
if (currheaderlist->sourcename
|
||||
&& currheaderlist->sourceheader) {
|
||||
if (currheaderlist->sourcename && currheaderlist->sourceheader) {
|
||||
fprintf(fout,
|
||||
"<tr><td>Source RPM:</td><td><font size=\"-1\"><a href=\"%stag=%s&pkg=%s.source\">%s</a></font></td></tr>\n",
|
||||
ct->configdefaults->url_prefix,
|
||||
@ -1436,8 +1408,7 @@ generateHTMLFiles(struct configTag *ct, int arch)
|
||||
fprintf(fout, "</font></td></tr>\n");
|
||||
|
||||
/* list requires */
|
||||
fprintf(fout,
|
||||
"<tr><td>Requires:</td><td><font size=\"-1\">");
|
||||
fprintf(fout, "<tr><td>Requires:</td><td><font size=\"-1\">");
|
||||
for (i = 0; i < currheaderlist->requirecount; i++) {
|
||||
if (currheaderlist->require[i]->resolved) {
|
||||
if (currheaderlist->require[i]->resolved->numproviders == 0) {
|
||||
@ -1547,8 +1518,7 @@ generateHTMLFiles(struct configTag *ct, int arch)
|
||||
fprintf(fout, "</font></td></tr>\n");
|
||||
|
||||
/* list required by */
|
||||
fprintf(fout,
|
||||
"<tr><td>Required by:</td><td><font size=\"-1\">");
|
||||
fprintf(fout, "<tr><td>Required by:</td><td><font size=\"-1\">");
|
||||
auxheaderlist = ct->headerlist[arch];
|
||||
while (auxheaderlist) {
|
||||
found = 0;
|
||||
@ -1557,8 +1527,7 @@ generateHTMLFiles(struct configTag *ct, int arch)
|
||||
if (auxheaderlist->require[i]->resolved) {
|
||||
for (j = 0; j < auxheaderlist->require[i]->resolved->numproviders; j++) {
|
||||
if (!strcmp(auxheaderlist->require[i]->resolved->provider[j]->name, currheaderlist->name)) {
|
||||
fprintf(fout,
|
||||
"<a href=\"%stag=%s&pkg=%s.%s\">%s(%s)</a> ",
|
||||
fprintf(fout, "<a href=\"%stag=%s&pkg=%s.%s\">%s(%s)</a> ",
|
||||
ct->configdefaults->url_prefix,
|
||||
ct->repository[auxheaderlist->altrepository]->tag,
|
||||
auxheaderlist->name,
|
||||
@ -1574,7 +1543,7 @@ generateHTMLFiles(struct configTag *ct, int arch)
|
||||
}
|
||||
}
|
||||
auxheaderlist = auxheaderlist->next;
|
||||
}
|
||||
} // while auxheaderlist
|
||||
fprintf(fout, "</font></td></tr>\n");
|
||||
|
||||
/* list build required by */
|
||||
@ -1607,19 +1576,16 @@ generateHTMLFiles(struct configTag *ct, int arch)
|
||||
fprintf(fout, "</font></td></tr>\n");
|
||||
|
||||
/* list filenames */
|
||||
fprintf(fout,
|
||||
"<tr><td>Filenames:</td><td><font size=\"-1\">");
|
||||
fprintf(fout, "<tr><td>Filenames:</td><td><font size=\"-1\">");
|
||||
for (i = 0; i < currheaderlist->filenamecount; i++) {
|
||||
ftname((currheaderlist->file)[i], buffer);
|
||||
|
||||
fprintf(fout, "/%s ",buffer);
|
||||
}
|
||||
fprintf(fout, "</font></td></tr></table>\n");
|
||||
fclose(fout);
|
||||
}
|
||||
currheaderlist = currheaderlist->next;
|
||||
}
|
||||
|
||||
} // while currheaderlist
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user