From: Thomas Hochstein Date: Mon, 2 Sep 2013 11:00:33 +0000 (+0200) Subject: Merge branch 'language' into next X-Git-Tag: 0.01~1^2 X-Git-Url: https://code.th-h.de/?p=usenet%2Fnewsstats.git;a=commitdiff_plain;h=25b25735dddfe027afe565a2e2ec78490a2cfa5e;hp=-c Merge branch 'language' into next * language: Some documentation fixes and enhancments. Improve INSTALL documentation. README: Update copyright notice. README: improve phrasing. --- 25b25735dddfe027afe565a2e2ec78490a2cfa5e diff --combined feedlog.pl index 80dbbe0,0814f2c..8ff868d --- a/feedlog.pl +++ b/feedlog.pl @@@ -1,4 -1,4 +1,4 @@@ -#! /usr/bin/perl -W +#! /usr/bin/perl # # feedlog.pl # @@@ -18,7 -18,6 +18,7 @@@ BEGIN push(@INC, dirname($0)); } use strict; +use warnings; use NewsStats; @@@ -201,7 -200,7 +201,7 @@@ Suppress logging to syslog =head1 INSTALLATION - See L + See L. =head1 EXAMPLES diff --combined gatherstats.pl index 160c115,64ea87b..6db137d --- a/gatherstats.pl +++ b/gatherstats.pl @@@ -1,4 -1,4 +1,4 @@@ -#! /usr/bin/perl -W +#! /usr/bin/perl # # gatherstats.pl # @@@ -18,7 -18,6 +18,7 @@@ BEGIN push(@INC, dirname($0)); } use strict; +use warnings; use NewsStats qw(:DEFAULT :TimePeriods ListNewsgroups ParseHierarchies ReadGroupList); @@@ -206,7 -205,7 +206,7 @@@ gatherstats - process statistical data =head1 SYNOPSIS - B [B<-Vhdt>] [B<-m> I | I] [B<-s> I I]] [B<--hierarchy> I] [B<--rawdb> I] [B<-groupsdb> I] [B<--clientsdb> I] [B<--hostsdb> I] + B [B<-Vhdt>] [B<-m> I | I] [B<-s> I] [B<-c> I]] [B<--hierarchy> I] [B<--rawdb> I] [B<-groupsdb> I] [B<--clientsdb> I] [B<--hostsdb> I] =head1 REQUIREMENTS @@@ -293,7 -292,6 +293,6 @@@ Set processing period to a single mont period between two month in YYYY-MM:YYYY-MM format (two month, separated by a colon). - =item B<-s>, B<--stats> I Set processing type to one of I and I. Defaults to all @@@ -307,8 -305,9 +306,9 @@@ one group on each line and ignoring eve whitespace (so you can use a file in checkgroups format or (part of) your INN active file). - The filename is taken from I, amended by each B<-- - month> B is processing, so that + The filename is taken from I, amended by each + B<--month> B is processing in the form of I, + so that gatherstats -m 2010-01:2010-12 -c checkgroups diff --combined groupstats.pl index 067cffc,efd34ef..84105cf --- a/groupstats.pl +++ b/groupstats.pl @@@ -1,4 -1,4 +1,4 @@@ -#! /usr/bin/perl -W +#! /usr/bin/perl # # groupstats.pl # @@@ -18,7 -18,6 +18,7 @@@ BEGIN push(@INC, dirname($0)); } use strict; +use warnings; use NewsStats qw(:DEFAULT :TimePeriods :Output :SQLHelper ReadGroupList); @@@ -100,13 -99,8 +100,13 @@@ my ($CaptionPeriod,$SQLWherePeriod) = & "please use 'YYYY-MM', 'YYYY-MM:YYYY-MM' or 'ALL'!") if !$CaptionPeriod; # get list of newsgroups and set expression for SQL 'WHERE' clause # with placeholders as well as a list of newsgroup to bind to them -my ($SQLWhereNewsgroups,@SQLBindNewsgroups) = &SQLGroupList($OptNewsgroups) - if $OptNewsgroups;; +my ($SQLWhereNewsgroups,@SQLBindNewsgroups); +if ($OptNewsgroups) { + ($SQLWhereNewsgroups,@SQLBindNewsgroups) = &SQLGroupList($OptNewsgroups); + # bail out if --newsgroups is invalid + &Bleat(2,"--newsgroups option has an invalid format!") + if !$SQLWhereNewsgroups; +} ### build SQL WHERE clause (and HAVING clause, if needed) my ($SQLWhereClause,$SQLHavingClause); @@@ -160,10 -154,9 +160,10 @@@ if ($OptReportType and $OptReportType n ### get length of longest newsgroup name delivered by query ### for formatting purposes my $Field = ($GroupBy eq 'month') ? 'newsgroup' : 'month'; -my $MaxLength = &GetMaxLength($DBHandle,$Conf{'DBTableGrps'}, - $Field,$SQLWhereClause,$SQLHavingClause, - @SQLBindNewsgroups); +my ($MaxLength,$MaxValLength) = &GetMaxLength($DBHandle,$Conf{'DBTableGrps'}, + $Field,'postings',$SQLWhereClause, + $SQLHavingClause, + @SQLBindNewsgroups); ### build and execute SQL query my ($DBQuery); @@@ -200,8 -193,8 +200,8 @@@ if ($OptBoundType and $OptBoundType ne $DBQuery = $DBHandle->prepare(sprintf('SELECT %s FROM %s.%s %s %s %s', $SQLSelect, $Conf{'DBDatabase'},$Conf{'DBTableGrps'}, - $SQLWhereClause,$SQLGroupClause,$ - SQLOrderClause)); + $SQLWhereClause,$SQLGroupClause, + $SQLOrderClause)); # execute query $DBQuery->execute(@SQLBindNewsgroups) @@@ -248,7 -241,7 +248,7 @@@ if ($OptCaptions && $OptComments) # output data &OutputData($OptFormat,$OptComments,$GroupBy,$Precision, $OptCheckgroupsFile ? $ValidGroups : '', - $OptFileTemplate,$DBQuery,$MaxLength); + $OptFileTemplate,$DBQuery,$MaxLength,$MaxValLength); ### close handles $DBHandle->disconnect; @@@ -379,6 -372,9 +379,9 @@@ Restrict output to those newgroups pres (one newgroup name per line; everything after the first whitespace on each line is ignored). All other newsgroups will be removed from output. + Contrary to B, I is not a template, but refers to + a single file in checkgroups format. + =item B<-r>, B<--report> I Choose the report type: I, I or I @@@ -436,8 -432,8 +439,8 @@@ you'll get the following result de.comp.datenbanken.misc has not been considered even though it has 38 postings in total, because it has less than 25 postings in every single - month. If you want to list all newsgroups with more than 25 postings U, you'll have to set the boundary type to I, see below. + month. If you want to list all newsgroups with more than 25 postings + I, you'll have to set the boundary type to I, see below. A boundary type of I will show only those newsgroups - at all - that satisfy the boundaries in each and every single month. With the above @@@ -449,10 -445,10 +452,10 @@@ you'll get this result de.comp.datenbanken.ms-access 293 de.comp.datenbanken.mysql has not been considered because it had less than - 25 postings in 2012-02. + 25 postings in 2012-02 (only). You can use that to get a list of newsgroups that have more (or less) then - x postings during the whole reporting period. + x postings in every month during the whole reporting period. A boundary type of I will show only those newsgroups - at all -that satisfy the boundaries on average. With the above list of newsgroups and