$OptUpdate is undefined when not upgrading, so don't
prepare an upgrade notice to avoid calling an
undefined variable.
Signed-off-by: Thomas Hochstein <thh@inter.net>
* Move database initialisation to a separate function.
* (Re-)try to connect every five seconds
(instead of going into an endless loop) and
log successful (re-)connections.
* Log postings that are dropped due to database failures
to syslog (Message-ID) for recovery.
* If the connection to the database is lost, try to
recover it (every five seconds) and try again to
write the pending data.
* Input will be buffered automatically by INN until
feedlog is able to process it (see man 5 newsfeeds).
Fixes#30, #31.
Signed-off-by: Thomas Hochstein <thh@inter.net>
When using a --checkgroups file while tabulating,
valid but empty groups will be added with a posting
count of zero as needed. If all groups in a
sub-hierarchy are empty, the virtual '.ALL' group
for that sub-hierarchy was not created, though.
If local.test.dummy and local.test.binary were
both empty, both groups were added with a posting
count of '0', but local.test.ALL was not.
Now we loop through all hierarchy elements using
ParseHierarchies and add empty .ALL hierarchies as
needed.
Fixes#49.
Also fixing a typo in some comment. :-)
Signed-off-by: Thomas Hochstein <thh@inter.net>
In most hierarchies, the list of valid newsgroups will
change over time, so you'll have to use another
checkgroups file for each month. gatherstats will now
understand the value of --checkgroups to be a template
and amend it with each month it is processing.
Documentation changed accordingly.
Signed-off-by: Thomas Hochstein <thh@inter.net>
TLH may now also contain literal dots '.',
allowing for using second or third level
hierarchies as "TLH". To faciliate that,
'+' and '-' will be allowed, too.
Signed-off-by: Thomas Hochstein <thh@inter.net>
The TLH was checked to match the beginning
of the newsgroup name, not the whole TLH part.
So the TLH "de" would match not only "de.test",
but also "denver.test", which was not the
desired outcome.
Signed-off-by: Thomas Hochstein <thh@inter.net>
The code introduced in 17ffbebad5
did not check the correct variable for being an array.
Improve an unrelated comment, too.
Signed-off-by: Thomas Hochstein <thh@inter.net>
* Switch to Getopt::Long, change coding style;
limit line length.
* Replace 'die' and 'warn' by calls to &Bleat().
* Completely changed options due to new
GetOpt::Long processing.
* Adapt to changes in NewsStats.pm
* Redo documentation.
* Update TODO.
Signed-off-by: Thomas Hochstein <thh@inter.net>
* Switch to Getopt::Long, change coding style;
limit line length.
* Completely changed options due to new
GetOpt::Long processing.
* Adapt to changes in NewsStats.pm
* Redo documentation.
* Update TODO.
Signed-off-by: Thomas Hochstein <thh@inter.net>
* Switch to Getopt::Long, change coding style;
limit line length.
* Replace 'die' and 'warn' by calls to &Bleat().
* Completely changed options due to new
GetOpt::Long processing.
- merged -m/-p into --month
* Adapt to changes in NewsStats.pm
* Redo documentation.
* Update TODO.
Signed-off-by: Thomas Hochstein <thh@inter.net>
* Switch to Getopt::Long, change coding style;
limit line length.
* Replace 'die' and 'warn' by calls to &Bleat().
* Completely redo options and processing:
- merge -m/-p/-a into --month
- replace -i/-q/-d with - much more powerful -
--group-by/--order-by
- replace -t/-l with - much more powerful -
--lower/--upper/--boundary
- remove -b and replace it with --report
Fixes#33.
* Add new report types, boundaries and sorting options:
- report types 'average' and 'sums'
- boundaries 'average' and 'sums'
- upper and/or lower boundary
- sort output independently
Issue #35.
Fixes#34, #38.
* Add possibility to cross-check newsgroups against
checkgroups file.
* Complete rewrite of groupstats.pl internal logic:
- modularize construction fo SQL queries
- remove unnecessary special cases
- refactor code into NewsStats.pm functions as much
as possible
Issue #37.
Fixes#36.
* Rework output formats, fix padding problem by making use
of modularized SQL queries.
Fixes#15, #32.
* Add some more consistency checks.
Issue #12.
* Redo documentation.
* Update TODO list.
Signed-off-by: Thomas Hochstein <thh@inter.net>
DELETE old records and INSERT (INTO) the new ones
instead of just REPLACEing them, which will not
remove wrong entries (i.e. non-existing newsgroups).
Signed-off-by: Thomas Hochstein <thh@inter.net>
Add '-l' option to check newsgroup names against a list of valid
newsgroups read from a file (each group on one line, ignoring
everything after the first whitespace and so accepting files in
checkgroups format as well as (parts of) an INN active file).
New ReadGroupList().
Change ListNewsgroups() accordingly.
Amend documentation accodingly.
See #17.
Signed-off-by: Thomas Hochstein <thh@inter.net>
Add '-f' switch to save monthly reports to a file with
a filename made up by adding year and month to template
submitted via '-f filename': filename-YYYY-MM
Modify OutputData() accordingly.
Ignore '-c' if '-f' is set.
Allow & force '-o dump' if '-f' is set even if a time
period is defined.
Change documentation accodingly.
Fixes#27.
Signed-off-by: Thomas Hochstein <thh@inter.net>
Add '-a' switch to make groupstats.pl consider its whole
database without any time limits ignoring -m and -p.
Change documentation accodingly.
First implementation. Handling needs improvement!
Fixes#14.
Signed-off-by: Thomas Hochstein <thh@inter.net>
If time period is more than on month, switch from dump
to dumpgroup, if possible (just one newsgroup submitted
via -n), and switch to pretty only if that fails.
Signed-off-by: Thomas Hochstein <thh@inter.net>
Do the work in the application, using two separate SQL
queries, instead of trying to optimize the single
query in vain ...
Thanks to Juliane. :)
Fixes#16.
Signed-off-by: Thomas Hochstein <thh@inter.net>
Don't misuse variables:
- Push other binding vars to (new) @Params instead of
filling up @GroupList with things it wasn't meant for.
- Replace generic @QueryPart by @QueryGroupList and
@QueryThreshold, then build $WhereClause from that.
- Don't use $OrderClause for setting level (more or
less than x), use (new) $Level instead.
Signed-off-by: Thomas Hochstein <thh@inter.net>
warn() output to errlog was not activated by '-d' debug
switch, but on by default and just deactivated by '-d'.
Signed-off-by: Thomas Hochstein <thh@inter.net>
NewsStats.pm: Add $PackageVersion.
install.pl: Modularise program flow to subroutines.
Add framework for database upgrade and
upgrade instructions.
Signed-off-by: Thomas Hochstein <thh@inter.net>
Add comments NewsStats.pm
Add POD to install.pl
Add POD to feedlog.pl
Add POD and comments to gatherstats.pl
Add POD and comments to groupstats.pl, beautify code
Signed-off-by: Thomas Hochstein <thh@inter.net>
-t/-l/-b are incompatible. Print warning, let -l take precedence
over -t and -b over both.
-q/-d are incompatible with -l and -b. Print warning, ignore
them.
For -l, only -o 'pretty' makes sense. Force that.
Signed-off-by: Thomas Hochstein <thh@inter.net>