Commit graph

76 commits

Author SHA1 Message Date
Thomas Hochstein 2ad99c20bc Redo directory structure.
* Move all scripts to /bin
* Move configuration to /etc
* Move NewsStats.pm to /lib
* Add new path to NewsStats.pm to all scripts
* Set $HomePath to top level directory
* Move setting of config file name to ReadConf()

Signed-off-by: Thomas Hochstein <thh@inter.net>
2013-09-03 10:01:16 +02:00
Thomas Hochstein 07c0b2589a Release 0.01
Update TODO list.
Update version numbers, ChangeLog, bump copyright
dates.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2013-09-02 13:14:33 +02:00
Thomas Hochstein 3d2fd51dd0 Merge branch 'next'
* next: (26 commits)
  Some documentation fixes and enhancments.
  Improve INSTALL documentation.
  README: Update copyright notice.
  README: improve phrasing.
  Change handling of warnings.
  Improve output padding.
  Check for invalid newsgroup names.
  Add some basic validation to config parser.
  Create better newsgroup lists for SQL clause.
  Fix config path detection for install.pl.
  Get empty 'virtual' hierarchies working.
  Add some TODO entries.
  Add database creation to installer.
  Handle undefined previous version when installing.
  Refactor database initialisation in feedlog.pl.
  Add empty 'virtual' .ALL hierarchies as needed.
  Change interpretation of --checkgroups to template
  Be more fault-tolerant when reading checkgroups.
  Remove call to &Bleat where not appropriate.
  Allow more characters in TLH definitions.
  ...
2013-09-02 13:08:39 +02:00
Thomas Hochstein 25b25735dd Merge branch 'language' into next
* language:
  Some documentation fixes and enhancments.
  Improve INSTALL documentation.
  README: Update copyright notice.
  README: improve phrasing.
2013-09-02 13:00:33 +02:00
Thomas Hochstein a036e9da62 Merge branch 'thh-bug13' into next
* thh-bug13:
  Add some basic validation to config parser.
2013-09-02 13:00:23 +02:00
Thomas Hochstein 38fa44f89b Merge branch 'thh-bug53' into next
* thh-bug53:
  Improve output padding.
2013-09-02 13:00:05 +02:00
Thomas Hochstein 7c83a673e6 Merge branch 'thh-bug37' into next
* thh-bug37:
  Create better newsgroup lists for SQL clause.
2013-09-02 12:59:57 +02:00
Thomas Hochstein 5cfcb1c061 Merge branch 'thh-checkinput' into next
* thh-checkinput:
  Check for invalid newsgroup names.
2013-09-02 12:59:45 +02:00
Thomas Hochstein 439c85a280 Merge branch 'thh-warnings' into next
* thh-warnings:
  Change handling of warnings.
2013-09-02 12:59:35 +02:00
Thomas Hochstein 95d9fe2cfd Some documentation fixes and enhancments.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2013-09-02 12:37:13 +02:00
Thomas Hochstein b31f785064 Improve INSTALL documentation.
Fix wrong example for newsfeeds entry (lacking
backslashes).

Fix typos, update copyright, improve phrasing.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2013-09-02 12:37:10 +02:00
Thomas Hochstein 435a99783c README: Update copyright notice.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2013-09-02 12:37:08 +02:00
Daniel Weber 6e6c520f94 README: improve phrasing.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2013-09-02 12:37:05 +02:00
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 b342fcf030 Improve output padding.
Take 'length' of numbers in account.

Change GetMaxLength() accordingly and use that
new information in FormatOutput().

Fixes #53.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2013-09-02 12:32:07 +02:00
Thomas Hochstein c30822b48b Check for invalid newsgroup names.
Add check to SQLGroupList() and act on it
in groupstats.pl.

Issue #12.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2013-09-02 12:31:55 +02:00
Thomas Hochstein db7696e550 Add some basic validation to config parser.
We check for empty mandatory options for
starters.

Fixes #13 ... so we can release RSN :)

Signed-off-by: Thomas Hochstein <thh@inter.net>
2013-09-02 12:31:41 +02:00
Thomas Hochstein 10459ac8c7 Create better newsgroup lists for SQL clause.
Build a 'IN(...)' list for single newsgroup
names without wildcards. Create SQL clause
with a mix of wildcards and wildcard-less
group names.

More code for a better query ...

Fixes #37.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2013-09-02 12:30:56 +02:00
Thomas Hochstein d28168419e Merge branch 'installation' into next
* installation:
  Fix config path detection for install.pl.
  Add some TODO entries.
  Add database creation to installer.
  Handle undefined previous version when installing.
2013-09-02 12:19:11 +02:00
Thomas Hochstein 512781bd92 Fix config path detection for install.pl.
Make use of $Path - which is set and checked
to display a correct 'newsfeeds' example - to
load our configuration from the correct location.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2013-09-02 12:17:27 +02:00
Thomas Hochstein cce2fd0b7f Merge branch 'gatherstats' into next
* gatherstats:
  Get empty 'virtual' hierarchies working.
2013-09-02 06:46:40 +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 7b310df13f Add some TODO entries.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2013-08-11 22:51:11 +02:00
Thomas Hochstein 36cffe7aed Add database creation to installer.
It's not enough to create tables, one should
create the database first if it is still
missing ...

Signed-off-by: Thomas Hochstein <thh@inter.net>
2013-08-11 22:16:24 +02:00
Thomas Hochstein da6fc073ee Handle undefined previous version when installing.
$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>
2013-08-11 22:05:25 +02:00
Thomas Hochstein 1c3adb8de2 Merge branch 'feedlog' into next 2013-08-11 22:00:05 +02:00
Thomas Hochstein 98563c619e Refactor database initialisation in feedlog.pl.
* 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>
2013-08-11 21:59:31 +02:00
Thomas Hochstein c3973e7d0d Merge branch 'gatherstats' into next 2013-08-11 21:56:37 +02:00
Thomas Hochstein a915469e0c Merge branch 'rewrite' into next 2013-08-11 21:56:18 +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 7662b1065e Be more fault-tolerant when reading checkgroups.
* Accept lines starting with whitespace.

* Drop empty "groups", i.e. lines containing only
  whitespace.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2012-10-13 00:52:13 +02:00
Thomas Hochstein 0dc13b3980 Remove call to &Bleat where not appropriate.
Some warn()ings are used for debugging purposes.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2012-10-13 00:52:02 +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 1fa9479946 Adapt install.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.

* Adapt to changes in NewsStats.pm

* Redo documentation.

* Update TODO.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2012-10-13 00:44:40 +02:00
Thomas Hochstein f05ec4aeaa Adapt feedlog.pl to new coding style.
* 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>
2012-10-13 00:44:20 +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 edd250f265 Complete rewrite of groupstats.pl and NewsStats.pm.
* 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>
2012-10-13 00:43:39 +02:00
Thomas Hochstein 3c7a7dfef5 Merge branch 'tools' into pu
* tools:
  Add tools directory, move untracked stuff top /tmp
2012-05-07 17:53:52 +02:00
Thomas Hochstein fe46be2168 Add tools directory, move untracked stuff top /tmp
Signed-off-by: Thomas Hochstein <thh@inter.net>
2012-05-04 07:41:02 +02:00
Thomas Hochstein a02fdc165f Documentation: Add ChangeLog
Signed-off-by: Thomas Hochstein <thh@inter.net>
2010-11-01 21:54:56 +01:00
Thomas Hochstein 06402a2526 Update To-Do list.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2010-11-01 21:54:43 +01:00
Thomas Hochstein 147194c190 Documentation: Add TODO.
Add a comprehensive to-do list.
Add a reference to README accordingly.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2010-11-01 21:54:31 +01: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 d3b6810d3d Fix some typos.
groupsstats.pl: Fix typo in lead-in comment.
groupsstats.pl/NewsStats.pm: Fix typo concerning
GetMaxLength - it isn't 'GetMaxLenght' ...

Signed-off-by: Thomas Hochstein <thh@inter.net>
2010-11-01 20:28:31 +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