diff options
author | Anders Rune Jensen <arj@gentoo.org> | 2004-07-06 23:17:12 +0000 |
---|---|---|
committer | Anders Rune Jensen <arj@gentoo.org> | 2004-07-06 23:17:12 +0000 |
commit | 1c69af6cefccd79ef7edaf32a464fc3bea8f8048 (patch) | |
tree | e5a7b2158daf848bec02b6f121e8db7410df2158 /app-admin | |
parent | Added ~sparc (Manifest recommit) (diff) | |
download | gentoo-2-1c69af6cefccd79ef7edaf32a464fc3bea8f8048.tar.gz gentoo-2-1c69af6cefccd79ef7edaf32a464fc3bea8f8048.tar.bz2 gentoo-2-1c69af6cefccd79ef7edaf32a464fc3bea8f8048.zip |
patch
Diffstat (limited to 'app-admin')
-rw-r--r-- | app-admin/webalizer/ChangeLog | 6 | ||||
-rw-r--r-- | app-admin/webalizer/files/output.c.patch | 157 | ||||
-rw-r--r-- | app-admin/webalizer/webalizer-2.01.10-r5.ebuild | 5 |
3 files changed, 166 insertions, 2 deletions
diff --git a/app-admin/webalizer/ChangeLog b/app-admin/webalizer/ChangeLog index 65b8907a4857..5fc07842b8d7 100644 --- a/app-admin/webalizer/ChangeLog +++ b/app-admin/webalizer/ChangeLog @@ -1,7 +1,11 @@ # ChangeLog for app-admin/webalizer # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/webalizer/ChangeLog,v 1.26 2004/06/29 19:52:46 agriffis Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/webalizer/ChangeLog,v 1.27 2004/07/06 23:17:12 arj Exp $ + 07 Jul 2004; Anders Rune Jensen <arj@gentoo.org> webalizer-2.01.10-r5.ebuild, + webalizer-2.01.10-r5.ebuild: + Pretty printer patch from Ondrej Novy <onovy@nomi.cz>. + 29 Jun 2004; Aron Griffis <agriffis@gentoo.org> webalizer-2.01.10-r4.ebuild, webalizer-2.01.10-r5.ebuild: sync IUSE (+apache2) diff --git a/app-admin/webalizer/files/output.c.patch b/app-admin/webalizer/files/output.c.patch new file mode 100644 index 000000000000..9cf52580223f --- /dev/null +++ b/app-admin/webalizer/files/output.c.patch @@ -0,0 +1,157 @@ +--- output.c.orig 2001-06-15 10:34:24.000000000 +0200 ++++ output.c 2004-07-03 14:32:01.000000000 +0200 +@@ -140,6 +140,26 @@ + + FILE *out_fp; + ++ ++/*********************************************/ ++/* FORMAT_NUM - output format of number */ ++/*********************************************/ ++char * format_num(double in) ++{ ++ static char *jednotky[] = { ++ " B", " kB", " MB", " GB", " TB" ++ }; ++ char **jednotka, *tmp; ++ static char out[100]; ++ for (jednotka = jednotky; in > 1024 && jednotka < jednotky+4; in /= 1024, ++jednotka); ++ snprintf(out, 45, "%.2f", in); ++ for (tmp = out + strlen(out) - 1; tmp > out && *tmp == '0'; *tmp-- = 0); ++ if (*tmp == '.') *tmp = 0; ++ strcat(out, *jednotka); ++ return out; ++} ++ ++ + /*********************************************/ + /* WRITE_HTML_HEAD - output top of HTML page */ + /*********************************************/ +@@ -544,8 +564,8 @@ + "</FONT></TD></TR>\n",msg_h_total, msg_h_visits, t_visit); + /* Total XFer */ + fprintf(out_fp,"<TR><TD WIDTH=380><FONT SIZE=\"-1\">%s</FONT></TD>\n" \ +- "<TD ALIGN=right COLSPAN=2><FONT SIZE=\"-1\"><B>%.0f</B>" \ +- "</FONT></TD></TR>\n",msg_mtot_tx,t_xfer/1024); ++ "<TD ALIGN=right COLSPAN=2><FONT SIZE=\"-1\"><B>%s</B>" \ ++ "</FONT></TD></TR>\n",msg_mtot_tx,format_num(t_xfer)); + fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n"); + /**********************************************/ + /* Unique Sites */ +@@ -620,10 +640,11 @@ + /* Max/Avg KBytes per Day */ + fprintf(out_fp,"<TR>" \ + "<TD><FONT SIZE=\"-1\">%s</FONT></TD>\n" \ +- "<TD ALIGN=right WIDTH=65><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \ +- "<TD WIDTH=65 ALIGN=right><FONT SIZE=-1><B>%.0f</B>" \ +- "</FONT></TD></TR>\n",msg_mtot_mkd, +- (t_xfer/1024)/days_in_month,max_xfer/1024); ++ "<TD ALIGN=right WIDTH=65><FONT SIZE=\"-1\"><B>%s</B></FONT></TD>\n", ++ msg_mtot_mkd,format_num(t_xfer/days_in_month)); ++ fprintf(out_fp,"<TD WIDTH=65 ALIGN=right><FONT SIZE=-1><B>%s</B>" \ ++ "</FONT></TD></TR>\n",format_num(max_xfer)); ++ + fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n"); + /**********************************************/ + /* response code totals */ +@@ -713,9 +734,9 @@ + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n", + tm_site[i],PCENT(tm_site[i],t_site)); + fprintf(out_fp,"<TD ALIGN=right>" \ +- "<FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \ ++ "<FONT SIZE=\"-1\"><B>%s</B></FONT></TD>\n" \ + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD></TR>\n", +- tm_xfer[i]/1024,PCENT(tm_xfer[i],t_xfer)); ++ format_num(tm_xfer[i]),PCENT(tm_xfer[i],t_xfer)); + } + fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n"); + fprintf(out_fp,"</TABLE>\n"); +@@ -801,11 +822,13 @@ + th_page[i]/days_in_month,th_page[i], + PCENT(th_page[i],t_page)); + fprintf(out_fp, +- "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \ +- "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \ ++ "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%s</B></FONT></TD>\n", ++ format_num(th_xfer[i]/days_in_month)); ++ fprintf(out_fp, ++ "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%s</B></FONT></TD>\n" \ + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD></TR>\n", +- (th_xfer[i]/days_in_month)/1024,th_xfer[i]/1024, +- PCENT(th_xfer[i],t_xfer)); ++ format_num(th_xfer[i]), ++ PCENT(th_xfer[i],t_xfer)); + avg_file += th_file[i]/days_in_month; + avg_xfer+= (th_xfer[i]/days_in_month)/1024; + } +@@ -884,14 +907,15 @@ + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%lu</B></FONT></TD>\n" \ + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ +- "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \ ++ "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%s</B></FONT></TD>\n" \ + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%lu</B></FONT></TD>\n" \ + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ + "<TD ALIGN=left NOWRAP><FONT SIZE=\"-1\">", + i+1,hptr->count, + (t_hit==0)?0:((float)hptr->count/t_hit)*100.0,hptr->files, +- (t_file==0)?0:((float)hptr->files/t_file)*100.0,hptr->xfer/1024, ++ (t_file==0)?0:((float)hptr->files/t_file)*100.0, ++ format_num(hptr->xfer), + (t_xfer==0)?0:((float)hptr->xfer/t_xfer)*100.0,hptr->visit, + (t_visit==0)?0:((float)hptr->visit/t_visit)*100.0); + +@@ -1066,12 +1090,12 @@ + "<TD ALIGN=center><FONT SIZE=\"-1\"><B>%d</B></FONT></TD>\n" \ + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%lu</B></FONT></TD>\n" \ + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ +- "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n"\ ++ "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%s</B></FONT></TD>\n"\ + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ + "<TD ALIGN=left NOWRAP><FONT SIZE=\"-1\">", + i+1,uptr->count, + (t_hit==0)?0:((float)uptr->count/t_hit)*100.0, +- uptr->xfer/1024, ++ format_num(uptr->xfer), + (t_xfer==0)?0:((float)uptr->xfer/t_xfer)*100.0); + + if (uptr->flag==OBJ_GRP) +@@ -2036,14 +2060,14 @@ + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%lu</B></FONT></TD>\n" \ + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ +- "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \ ++ "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%s</B></FONT></TD>\n" \ + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ + "<TD ALIGN=left NOWRAP><FONT SIZE=\"-1\">%s</FONT></TD></TR>\n", + i+1,top_ctrys[i]->count, + (t_hit==0)?0:((float)top_ctrys[i]->count/t_hit)*100.0, + top_ctrys[i]->files, + (t_file==0)?0:((float)top_ctrys[i]->files/t_file)*100.0, +- top_ctrys[i]->xfer/1024, ++ format_num(top_ctrys[i]->xfer), + (t_xfer==0)?0:((float)top_ctrys[i]->xfer/t_xfer)*100.0, + top_ctrys[i]->desc); + } +@@ -2402,8 +2426,9 @@ + hist_visit[s_mth]/days_in_month); + fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%lu</FONT></TD>\n", + hist_site[s_mth]); +- fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%.0f</FONT></TD>\n", +- hist_xfer[s_mth]); ++ fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%s</FONT></TD>\n", ++/* hist_xfer[s_mth]);*/ ++ format_num(hist_xfer[s_mth]*1024)); + fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%lu</FONT></TD>\n", + hist_visit[s_mth]); + fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%lu</FONT></TD>\n", +@@ -2422,7 +2447,7 @@ + fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" COLSPAN=6 ALIGN=left>" \ + "<FONT SIZE=\"-1\">%s</FONT></TH>\n",GREY,msg_h_totals); + fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=right>" \ +- "<FONT SIZE=\"-1\">%.0f</FONT></TH>\n",GREY,gt_xfer); ++ "<FONT SIZE=\"-1\">%s</FONT></TH>\n",GREY,format_num(gt_xfer*1024)); + fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=right>" \ + "<FONT SIZE=\"-1\">%.0f</FONT></TH>\n",GREY,gt_visits); + fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=right>" \ diff --git a/app-admin/webalizer/webalizer-2.01.10-r5.ebuild b/app-admin/webalizer/webalizer-2.01.10-r5.ebuild index c24aa6bb689e..394140ba901f 100644 --- a/app-admin/webalizer/webalizer-2.01.10-r5.ebuild +++ b/app-admin/webalizer/webalizer-2.01.10-r5.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/webalizer/webalizer-2.01.10-r5.ebuild,v 1.8 2004/06/30 17:08:01 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/webalizer/webalizer-2.01.10-r5.ebuild,v 1.9 2004/07/06 23:17:12 arj Exp $ inherit eutils @@ -35,6 +35,9 @@ src_unpack() { ( cd ${WORKDIR} && unpack geolizer_${MY_PV}-patch.20040216.tar.bz2 ) epatch ${WORKDIR}/geolizer_${MY_PV}-patch/geolizer.patch || die fi + + # pretty printer for numbers + epatch ${FILESDIR}/output.c.patch || die } src_compile() { |