From 22d3d70a7285bd0730d301609da05ab09ef640e5 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Wed, 4 Sep 2013 10:39:40 +0200 Subject: [PATCH 1/7] Fix ea91003a99e679caa5bf56915f085a7c4931805b. Commit ea91003a99e679caa5bf56915f085a7c4931805b was broken and did not check for undefined variables. Signed-off-by: Thomas Hochstein --- bin/groupstats.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/groupstats.pl b/bin/groupstats.pl index 7f3a32c..b96a9d6 100755 --- a/bin/groupstats.pl +++ b/bin/groupstats.pl @@ -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); From 2871792120fba3b9ac9fe1b7bf166638b05766fd Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Wed, 4 Sep 2013 11:18:11 +0200 Subject: [PATCH 2/7] Fix forgotten dates. Some dates were not bumped when releasing v 0.01 in 07c0b2589af779c33d5d35b6a7fa0e7883201674. Signed-off-by: Thomas Hochstein --- bin/feedlog.pl | 2 +- bin/gatherstats.pl | 2 +- bin/groupstats.pl | 2 +- install/install.pl | 2 +- lib/NewsStats.pm | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/feedlog.pl b/bin/feedlog.pl index bbfd814..f10798a 100755 --- a/bin/feedlog.pl +++ b/bin/feedlog.pl @@ -265,7 +265,7 @@ Thomas Hochstein =head1 COPYRIGHT AND LICENSE -Copyright (c) 2010-2012 Thomas Hochstein +Copyright (c) 2010-2013 Thomas Hochstein This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. diff --git a/bin/gatherstats.pl b/bin/gatherstats.pl index a5a486a..759de66 100755 --- a/bin/gatherstats.pl +++ b/bin/gatherstats.pl @@ -417,7 +417,7 @@ Thomas Hochstein =head1 COPYRIGHT AND LICENSE -Copyright (c) 2010-2012 Thomas Hochstein +Copyright (c) 2010-2013 Thomas Hochstein This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. diff --git a/bin/groupstats.pl b/bin/groupstats.pl index b96a9d6..4035d76 100755 --- a/bin/groupstats.pl +++ b/bin/groupstats.pl @@ -704,7 +704,7 @@ Thomas Hochstein =head1 COPYRIGHT AND LICENSE -Copyright (c) 2010-2012 Thomas Hochstein +Copyright (c) 2010-2013 Thomas Hochstein This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. diff --git a/install/install.pl b/install/install.pl index 12cc8ec..aff4480 100755 --- a/install/install.pl +++ b/install/install.pl @@ -340,7 +340,7 @@ Thomas Hochstein =head1 COPYRIGHT AND LICENSE -Copyright (c) 2010-2012 Thomas Hochstein +Copyright (c) 2010-2013 Thomas Hochstein This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. diff --git a/lib/NewsStats.pm b/lib/NewsStats.pm index a3676d0..de85d0a 100644 --- a/lib/NewsStats.pm +++ b/lib/NewsStats.pm @@ -80,7 +80,7 @@ sub ShowVersion { ################################################################################ ### display version and exit print "NewsStats v$PackageVersion\n$MyVersion\n"; - print "Copyright (c) 2010-2012 Thomas Hochstein \n"; + print "Copyright (c) 2010-2013 Thomas Hochstein \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); From 24d2011f322ff3b58527c24bbd767cdf02515ca5 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Wed, 4 Sep 2013 11:19:36 +0200 Subject: [PATCH 3/7] Bump version numbers. All scripts - and the package - have been restructured in commit 2ad99c20bcc297362aeccabb1c51e20c4bd4b533, but version numbers didn't change accordingly. Signed-off-by: Thomas Hochstein --- bin/feedlog.pl | 2 +- bin/gatherstats.pl | 2 +- bin/groupstats.pl | 2 +- install/install.pl | 2 +- lib/NewsStats.pm | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/feedlog.pl b/bin/feedlog.pl index f10798a..b769ccd 100755 --- a/bin/feedlog.pl +++ b/bin/feedlog.pl @@ -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'); diff --git a/bin/gatherstats.pl b/bin/gatherstats.pl index 759de66..c85b23d 100755 --- a/bin/gatherstats.pl +++ b/bin/gatherstats.pl @@ -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'); diff --git a/bin/groupstats.pl b/bin/groupstats.pl index 4035d76..d0ddcde 100755 --- a/bin/groupstats.pl +++ b/bin/groupstats.pl @@ -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'); diff --git a/install/install.pl b/install/install.pl index aff4480..fabdaa1 100755 --- a/install/install.pl +++ b/install/install.pl @@ -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'); diff --git a/lib/NewsStats.pm b/lib/NewsStats.pm index de85d0a..f2b95c4 100644 --- a/lib/NewsStats.pm +++ b/lib/NewsStats.pm @@ -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; From e39d4207a649749f24866d2ee1afeb8ebf3364e2 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Wed, 4 Sep 2013 11:22:38 +0200 Subject: [PATCH 4/7] Fix --conffile in POD. Change '--conffile' to 'B<--conffile>'. The wrong format was added to documentation in commit 23ab67a099e32a9ee8c0700fe46bc43680a60721. Signed-off-by: Thomas Hochstein --- bin/feedlog.pl | 2 +- bin/gatherstats.pl | 2 +- bin/groupstats.pl | 2 +- install/install.pl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/feedlog.pl b/bin/feedlog.pl index b769ccd..ed9f1b8 100755 --- a/bin/feedlog.pl +++ b/bin/feedlog.pl @@ -153,7 +153,7 @@ feedlog - log data from an INN feed to a database =head1 SYNOPSIS -B [B<-Vhdq>] [--conffile I] +B [B<-Vhdq>] [B<--conffile> I] =head1 REQUIREMENTS diff --git a/bin/gatherstats.pl b/bin/gatherstats.pl index c85b23d..4d61d7e 100755 --- a/bin/gatherstats.pl +++ b/bin/gatherstats.pl @@ -210,7 +210,7 @@ gatherstats - process statistical data from a raw source =head1 SYNOPSIS -B [B<-Vhdt>] [B<-m> I | I] [B<-s> I] [B<-c> I]] [B<--hierarchy> I] [B<--rawdb> I] [B<-groupsdb> I] [B<--clientsdb> I] [B<--hostsdb> I] [--conffile I] +B [B<-Vhdt>] [B<-m> I | I] [B<-s> I] [B<-c> I]] [B<--hierarchy> I] [B<--rawdb> I] [B<-groupsdb> I] [B<--clientsdb> I] [B<--hostsdb> I] [B<--conffile> I] =head1 REQUIREMENTS diff --git a/bin/groupstats.pl b/bin/groupstats.pl index d0ddcde..2c1d9f5 100755 --- a/bin/groupstats.pl +++ b/bin/groupstats.pl @@ -277,7 +277,7 @@ groupstats - create reports on newsgroup usage =head1 SYNOPSIS -B [B<-Vhcs> B<--comments>] [B<-m> I[:I] | I] [B<-n> I] [B<--checkgroups> I] [B<-r> I] [B<-l> I] [B<-u> I] [B<-b> I] [B<-g> I] [B<-o> I] [B<-f> I] [B<--filetemplate> I] [B<--groupsdb> I] [--conffile I] +B [B<-Vhcs> B<--comments>] [B<-m> I[:I] | I] [B<-n> I] [B<--checkgroups> I] [B<-r> I] [B<-l> I] [B<-u> I] [B<-b> I] [B<-g> I] [B<-o> I] [B<-f> I] [B<--filetemplate> I] [B<--groupsdb> I] [B<--conffile> I] =head1 REQUIREMENTS diff --git a/install/install.pl b/install/install.pl index fabdaa1..837f091 100755 --- a/install/install.pl +++ b/install/install.pl @@ -256,7 +256,7 @@ install - installation script =head1 SYNOPSIS -B [B<-Vh> [--update I] [--conffile I] +B [B<-Vh> [--update I] [B<--conffile> I] =head1 REQUIREMENTS From 44c197097be2f6ec7bd02fcc8cc8dc51c34311c5 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Wed, 4 Sep 2013 11:41:58 +0200 Subject: [PATCH 5/7] Fix documentation relating to conffile location. CONFIGURATION section talks about newsstats.conf being in the same directory which is not true any more since 2ad99c20bcc297362aeccabb1c51e20c4bd4b533. It also didn't mention the --conffile option which was added in 23ab67a099e32a9ee8c0700fe46bc43680a60721. Signed-off-by: Thomas Hochstein --- bin/feedlog.pl | 3 ++- bin/gatherstats.pl | 3 ++- bin/groupstats.pl | 3 ++- install/install.pl | 5 +++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/feedlog.pl b/bin/feedlog.pl index ed9f1b8..27cc75a 100755 --- a/bin/feedlog.pl +++ b/bin/feedlog.pl @@ -174,7 +174,8 @@ terminating would only result in a rapid respawn. =head2 Configuration B will read its configuration from F 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 for an overview of possible configuration options. diff --git a/bin/gatherstats.pl b/bin/gatherstats.pl index 4d61d7e..b4f07d9 100755 --- a/bin/gatherstats.pl +++ b/bin/gatherstats.pl @@ -261,7 +261,8 @@ override that default through the B<--groupsdb> option. =head2 Configuration B will read its configuration from F -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 for an overview of possible configuration options. diff --git a/bin/groupstats.pl b/bin/groupstats.pl index 2c1d9f5..76ecce0 100755 --- a/bin/groupstats.pl +++ b/bin/groupstats.pl @@ -342,7 +342,8 @@ Captions and comments are automatically disabled in this case. =head2 Configuration B will read its configuration from F -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. diff --git a/install/install.pl b/install/install.pl index 837f091..690366e 100755 --- a/install/install.pl +++ b/install/install.pl @@ -268,8 +268,9 @@ This script will create database tables as necessary and configured. =head2 Configuration -B will read its configuration from F via -Config::Auto. +B will read its configuration from F which should +be present in etc/ via Config::Auto or from a configuration file submitted +by the B<--conffile> option. See L for an overview of possible configuration options. From b3b170c35779d2d32819f79ce11b25294a136e85 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Wed, 4 Sep 2013 11:25:02 +0200 Subject: [PATCH 6/7] Update INSTALL documentation. Configuration files now reside in etc/. This was an oversight from commit 2ad99c20bcc297362aeccabb1c51e20c4bd4b533. Signed-off-by: Thomas Hochstein --- doc/INSTALL | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/INSTALL b/doc/INSTALL index 1c154af..307ec0e 100644 --- a/doc/INSTALL +++ b/doc/INSTALL @@ -28,21 +28,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 @@ -61,17 +61,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 From fd0717a15cb1b36e25a019060d3f40aac9ca9517 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Wed, 4 Sep 2013 11:27:19 +0200 Subject: [PATCH 7/7] Fix displayed path in install. install.pl will display a sample newsfeeds entry. Adapt the path to the changes in 2ad99c20bcc297362aeccabb1c51e20c4bd4b533. Signed-off-by: Thomas Hochstein --- install/install.pl | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/install/install.pl b/install/install.pl index 690366e..e2acf66 100755 --- a/install/install.pl +++ b/install/install.pl @@ -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)}; @@ -109,7 +103,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