Merge branch 'thh-parsedb' into pu pu
authorThomas Hochstein <thh@inter.net>
Sat, 29 May 2021 08:21:13 +0000 (10:21 +0200)
committerThomas Hochstein <thh@inter.net>
Sat, 29 May 2021 08:21:13 +0000 (10:21 +0200)
* thh-parsedb:
  Forcibly decode headers with unencoded 8bit chars.
  Add MID to error message to make it more useful.

bin/feedlog.pl
bin/gatherstats.pl [changed mode: 0755->0644]
bin/groupstats.pl
doc/INSTALL
install/install.pl
lib/NewsStats.pm

index bbfd814..27cc75a 100755 (executable)
@@ -13,7 +13,7 @@
 # which Perl itself is published.
 
 BEGIN {
-  our $VERSION = "0.01";
+  our $VERSION = "0.02";
   use File::Basename;
   # we're in .../bin, so our module is in ../lib
   push(@INC, dirname($0).'/../lib');
@@ -153,7 +153,7 @@ feedlog - log data from an INN feed to a database
 
 =head1 SYNOPSIS
 
-B<feedlog> [B<-Vhdq>] [--conffile I<filename>]
+B<feedlog> [B<-Vhdq>] [B<--conffile> I<filename>]
 
 =head1 REQUIREMENTS
 
@@ -174,7 +174,8 @@ terminating would only result in a rapid respawn.
 =head2 Configuration
 
 B<feedlog> will read its configuration from F<newsstats.conf> which
-should be present in the same directory via Config::Auto.
+should be present in etc/ via Config::Auto or from a configuration file
+submitted by the B<--conffile> option.
 
 See L<doc/INSTALL> for an overview of possible configuration options.
 
@@ -265,7 +266,7 @@ Thomas Hochstein <thh@inter.net>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (c) 2010-2012 Thomas Hochstein <thh@inter.net>
+Copyright (c) 2010-2013 Thomas Hochstein <thh@inter.net>
 
 This program is free software; you may redistribute it and/or modify it
 under the same terms as Perl itself.
old mode 100755 (executable)
new mode 100644 (file)
index 7f42448..b09b73f
@@ -13,7 +13,7 @@
 # which Perl itself is published.
 
 BEGIN {
-  our $VERSION = "0.01";
+  our $VERSION = "0.02";
   use File::Basename;
   # we're in .../bin, so our module is in ../lib
   push(@INC, dirname($0).'/../lib');
@@ -210,7 +210,7 @@ gatherstats - process statistical data from a parsed source
 
 =head1 SYNOPSIS
 
-B<gatherstats> [B<-Vhdt>] [B<-m> I<YYYY-MM> | I<YYYY-MM:YYYY-MM>] [B<-s> I<stats>] [B<-c> I<filename template>]] [B<--hierarchy> I<TLH>] [B<--parsedb> I<database table>] [B<-groupsdb> I<database table>] [B<--clientsdb> I<database table>] [B<--hostsdb> I<database table>] [--conffile I<filename>]
+B<gatherstats> [B<-Vhdt>] [B<-m> I<YYYY-MM> | I<YYYY-MM:YYYY-MM>] [B<-s> I<stats>] [B<-c> I<filename template>]] [B<--hierarchy> I<TLH>] [B<--parsedb> I<database table>] [B<-groupsdb> I<database table>] [B<--clientsdb> I<database table>] [B<--hostsdb> I<database table>] [B<--conffile> I<filename>]
 
 =head1 REQUIREMENTS
 
@@ -261,7 +261,8 @@ override that default through the B<--groupsdb> option.
 =head2 Configuration
 
 B<gatherstats> will read its configuration from F<newsstats.conf>
-which should be present in the same directory via Config::Auto.
+which should be present in etc/ via Config::Auto or from a configuration file
+submitted by the B<--conffile> option.
 
 See L<doc/INSTALL> for an overview of possible configuration options.
 
@@ -417,7 +418,7 @@ Thomas Hochstein <thh@inter.net>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (c) 2010-2012 Thomas Hochstein <thh@inter.net>
+Copyright (c) 2010-2013 Thomas Hochstein <thh@inter.net>
 
 This program is free software; you may redistribute it and/or modify it
 under the same terms as Perl itself.
index 7f3a32c..76ecce0 100755 (executable)
@@ -13,7 +13,7 @@
 # which Perl itself is published.
 
 BEGIN {
-  our $VERSION = "0.01";
+  our $VERSION = "0.02";
   use File::Basename;
   # we're in .../bin, so our module is in ../lib
   push(@INC, dirname($0).'/../lib');
@@ -140,8 +140,8 @@ $OptGroupBy = 'newsgroup' if (!$OptGroupBy and
                               $OptBoundType and $OptBoundType ne 'default');
 # default to 'newsgroup' if $OptGroupBy is not set and
 # just one newsgroup is requested, but more than one month
-$OptGroupBy = 'newsgroup' if (!$OptGroupBy and
-                              $OptMonth =~ /:/ and $OptNewsgroups !~ /[:*%]/);
+$OptGroupBy = 'newsgroup' if (!$OptGroupBy and $OptMonth and $OptMonth =~ /:/
+                              and $OptNewsgroups and $OptNewsgroups !~ /[:*%]/);
 # parse $OptGroupBy to $GroupBy, create ORDER BY clause $SQLOrderClause
 # if $OptGroupBy is still not set, SQLSortOrder() will default to 'month'
 my ($GroupBy,$SQLOrderClause) = SQLSortOrder($OptGroupBy, $OptOrderBy);
@@ -277,7 +277,7 @@ groupstats - create reports on newsgroup usage
 
 =head1 SYNOPSIS
 
-B<groupstats> [B<-Vhcs> B<--comments>] [B<-m> I<YYYY-MM>[:I<YYYY-MM>] | I<all>] [B<-n> I<newsgroup(s)>] [B<--checkgroups> I<checkgroups file>] [B<-r> I<report type>] [B<-l> I<lower boundary>] [B<-u> I<upper boundary>] [B<-b> I<boundary type>] [B<-g> I<group by>] [B<-o> I<order by>] [B<-f> I<output format>] [B<--filetemplate> I<filename template>] [B<--groupsdb> I<database table>] [--conffile I<filename>]
+B<groupstats> [B<-Vhcs> B<--comments>] [B<-m> I<YYYY-MM>[:I<YYYY-MM>] | I<all>] [B<-n> I<newsgroup(s)>] [B<--checkgroups> I<checkgroups file>] [B<-r> I<report type>] [B<-l> I<lower boundary>] [B<-u> I<upper boundary>] [B<-b> I<boundary type>] [B<-g> I<group by>] [B<-o> I<order by>] [B<-f> I<output format>] [B<--filetemplate> I<filename template>] [B<--groupsdb> I<database table>] [B<--conffile> I<filename>]
 
 =head1 REQUIREMENTS
 
@@ -342,7 +342,8 @@ Captions and comments are automatically disabled in this case.
 =head2 Configuration
 
 B<groupstats> will read its configuration from F<newsstats.conf>
-which should be present in the same directory via Config::Auto.
+which should be present in etc/ via Config::Auto or from a configuration file
+submitted by the B<--conffile> option.
 
 See doc/INSTALL for an overview of possible configuration options.
 
@@ -704,7 +705,7 @@ Thomas Hochstein <thh@inter.net>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (c) 2010-2012 Thomas Hochstein <thh@inter.net>
+Copyright (c) 2010-2013 Thomas Hochstein <thh@inter.net>
 
 This program is free software; you may redistribute it and/or modify it
 under the same terms as Perl itself.
index a5ca01d..626fb6d 100644 (file)
@@ -30,21 +30,21 @@ INSTALLATION INSTRUCTIONS
    * Copy the sample configuration file newsstats.conf.sample to
      newsstats.conf and modify it for your purposes:
 
-     # cp newsstats.conf.sample newsstats.conf
-     # vim newsstats.conf
+     # cp etc/newsstats.conf.sample etc/newsstats.conf
+     # vim etc/newsstats.conf
 
    a) Mandatory configuration options
 
    * DBDriver = mysql
      Database driver used; currently only mysql is supported.
+
    * DBHost = localhost
      The host your mysql server is running on.
 
    * DBUser =
      The username to connect to the database server.
 
-   * DBPw = 
+   * DBPw =
      Matching password for your username.
 
    * DBDatabase = newsstats
@@ -63,17 +63,17 @@ INSTALLATION INSTRUCTIONS
 
    * TLH = de
      Limit examination to that top-level hierarchy.
-     
+
 3) Database (mysql) setup
 
    * Setup your database server with a username, password and
      database matching the NewsStats configuration (see 2 a).
 
    * Start the installation script:
-     
+
      # install/install.pl
 
-     It will setup the necessary database tables and display some 
+     It will setup the necessary database tables and display some
      information on the next steps.
 
 4) Feed (INN) setup
index 2f53a25..5116881 100755 (executable)
@@ -12,7 +12,7 @@
 # which Perl itself is published.
 
 BEGIN {
-  our $VERSION = "0.01";
+  our $VERSION = "0.02";
   use File::Basename;
   # we're in .../install, so our module is in ../lib
   push(@INC, dirname($0).'/../lib');
@@ -22,8 +22,6 @@ use warnings;
 
 use NewsStats qw(:DEFAULT);
 
-use Cwd;
-
 use DBI;
 use Getopt::Long qw(GetOptions);
 Getopt::Long::config ('bundling');
@@ -37,10 +35,6 @@ GetOptions ('u|update=s' => \$OptUpdate,
             'h|help'     => \&ShowPOD,
             'V|version'  => \&ShowVersion) or exit 1;
 
-### change working directory to .. (as we're in .../install)
-chdir dirname($FullPath).'/..';
-my $Path = cwd();
-
 ### read configuration
 print("Reading configuration.\n");
 my %Conf = %{ReadConfig($OptConfFile)};
@@ -159,7 +153,7 @@ Things left to do:
           ## gather statistics for NewsStats
           newsstats!\\
                   :!*,de.*\\
-                  :Tc,WmtfbsPNH,Ac:$Path/feedlog.pl
+                  :Tc,WmtfbsPNH,Ac:$HomePath/bin/feedlog.pl
 
       Please
 
@@ -306,7 +300,7 @@ install - installation script
 
 =head1 SYNOPSIS
 
-B<install> [B<-Vh> [--update I<version>] [--conffile I<filename>]
+B<install> [B<-Vh> [--update I<version>] [B<--conffile> I<filename>]
 
 =head1 REQUIREMENTS
 
@@ -318,8 +312,9 @@ This script will create database tables as necessary and configured.
 
 =head2 Configuration
 
-B<install> will read its configuration from F<newsstats.conf> via
-Config::Auto.
+B<install> will read its configuration from F<newsstats.conf> which should
+be present in etc/ via Config::Auto or from a configuration file submitted
+by the B<--conffile> option.
 
 See L<doc/INSTALL> for an overview of possible configuration options.
 
@@ -390,7 +385,7 @@ Thomas Hochstein <thh@inter.net>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (c) 2010-2012 Thomas Hochstein <thh@inter.net>
+Copyright (c) 2010-2013 Thomas Hochstein <thh@inter.net>
 
 This program is free software; you may redistribute it and/or modify it
 under the same terms as Perl itself.
index f79034e..ca66646 100644 (file)
@@ -49,8 +49,8 @@ require Exporter;
                  Output      => [qw(OutputData FormatOutput)],
                  SQLHelper   => [qw(SQLHierarchies SQLSortOrder SQLGroupList
                                  SQLSetBounds SQLBuildClause GetMaxLength)]);
-$VERSION = '0.01';
-our $PackageVersion = '0.01';
+$VERSION = '0.02';
+our $PackageVersion = '0.02';
 
 use Data::Dumper;
 use File::Basename;
@@ -80,7 +80,7 @@ sub ShowVersion {
 ################################################################################
 ### display version and exit
   print "NewsStats v$PackageVersion\n$MyVersion\n";
-  print "Copyright (c) 2010-2012 Thomas Hochstein <thh\@inter.net>\n";
+  print "Copyright (c) 2010-2013 Thomas Hochstein <thh\@inter.net>\n";
   print "This program is free software; you may redistribute it ".
         "and/or modify it under the same terms as Perl itself.\n";
   exit(100);
This page took 0.019272 seconds and 4 git commands to generate.