Commit graph

23 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 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 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 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 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 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 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 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 78389b28e9 groupstats.pl: Add '-f' option.
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>
2010-11-01 20:12:50 +01:00
Thomas Hochstein 4bbd46d336 NewsStats.pm: Fix $VERSION and $PackageVersion.
Set to 0.01 from 0.1

Signed-off-by: Thomas Hochstein <thh@inter.net>
2010-09-19 00:21:42 +02:00
Thomas Hochstein f6d15ca78e Add upgrade path.
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>
2010-09-18 20:54:02 +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 b221278d97 NewsStats.pm: Warn when -p takes precedence over -m.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2010-09-18 20:45:18 +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