Commit graph

16 commits

Author SHA1 Message Date
Thomas Hochstein 3f817eb428 Change handling of warnings.
Replace 'perl -W' by 'use warnings;'.
The latter is preferred, and '-W'
(instead of '-w') was causing problems with
warnings in DB::mysql::GetInfo.pm.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2013-09-02 12:33:51 +02:00
Thomas Hochstein 1703b8e3b4 Get empty 'virtual' hierarchies working.
Commit b5125b1099
was broken.

We didn't add empty .ALL hierarchies as needed;
we added empty (non-existant) hierarchies without
appended '.ALL', and didn't add the original
empty group we started with.

(What's more, gatherstats didn't even start any
more due to missing ex- and import of
&ParseHierarchies from NewsStats.pm.)

Fixes #52 (and some more breakage).

Signed-off-by: Thomas Hochstein <thh@inter.net>
2013-09-01 17:52:21 +02:00
Thomas Hochstein b5125b1099 Add empty 'virtual' .ALL hierarchies as needed.
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>
2013-08-11 09:45:00 +02:00
Thomas Hochstein 93c8eae2ed Change interpretation of --checkgroups to template
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>
2012-10-13 00:52:24 +02:00
Thomas Hochstein 314e31aadf Allow more characters in TLH definitions.
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>
2012-10-13 00:51:51 +02:00
Thomas Hochstein 7773fb6d8f Match TLHs correctly, not only partially.
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>
2012-10-13 00:51:40 +02:00
Thomas Hochstein 43a0fc7769 Fix parsing of more than one TLH in config.
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>
2012-10-13 00:51:29 +02:00
Thomas Hochstein 880c3eb227 Adapt gatherstats.pl to new coding style.
* 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>
2012-10-13 00:43:59 +02:00
Thomas Hochstein 17ffbebad5 gatherstats.pl: Allow for more than one TLH in config.
New syntax for TLH: tlh1:tlh2:tlh3
Check for illegal characters and reformat to RegExp.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2010-11-01 21:45:35 +01:00
Thomas Hochstein 71f0178b2a gatherstats.pl: Change database update mechanism.
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>
2010-11-01 20:13:33 +01:00
Thomas Hochstein 89db2f904d gatherstats.pl: Move TLH check to NewsStats.pm.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2010-11-01 20:13:25 +01:00
Thomas Hochstein ad60979271 gatherstats.pl: Add '-l' option.
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>
2010-11-01 20:13:16 +01:00
Thomas Hochstein 313610f63c gatherstats.pl: Add documentation of 'disregard' to POD.
Database entries in DBTableRaw marked 'disregard' will
be ignored by gatherstats. Document that.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2010-09-19 13:32:12 +02:00
Thomas Hochstein 2832c235b2 Introduce end-of-line normalization and add .gitattributes.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2010-09-18 20:53:31 +02:00
Thomas Hochstein 3430c89868 Add comments and POD.
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>
2010-09-18 20:47:32 +02:00
Thomas Hochstein 741336c210 Initial checkin of working branch.
Checkin of
- NewsStats.pm
- install/install.pl
- feedlog.pl
- gatherstats.pl
- groupstats.pl

Signed-off-by: Thomas Hochstein <thh@inter.net>
2010-09-18 20:44:56 +02:00