From da6fc073eed91506a94ae96471b19b6f22b72cb0 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Wed, 12 Jan 2011 16:39:10 +0100 Subject: [PATCH 1/4] 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 --- install/install.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install/install.pl b/install/install.pl index 61e8ef1..8ab7798 100755 --- a/install/install.pl +++ b/install/install.pl @@ -134,7 +134,9 @@ Enjoy! -thh INSTALL -my $Upgrade = < Date: Wed, 12 Jan 2011 16:41:21 +0100 Subject: [PATCH 2/4] 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 --- install/install.pl | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/install/install.pl b/install/install.pl index 8ab7798..374d74b 100755 --- a/install/install.pl +++ b/install/install.pl @@ -47,6 +47,10 @@ my %Conf = %{ReadConfig($HomePath.'/newsstats.conf')}; ##### Database table definitions ##### -------------------------------------------------------------------------- +my $DBCreate = < < <connect(sprintf('DBI:%s:host=%s',$Conf{'DBDriver'}, + $Conf{'DBHost'}), $Conf{'DBUser'}, + $Conf{'DBPw'}, { PrintError => 0 }); + my $DBQuery = $DBHandle->prepare($DBCreate); + $DBQuery->execute() or &Bleat(2, sprintf("Can't create database %s: %s%\n", + $Conf{'DBDatabase'}, $DBI::errstr)); + + printf("Database table %s created succesfully.\n",$Conf{'DBDatabase'}); + $DBHandle->disconnect; +}; + ### DB init, read list of tables print "Reading database information.\n"; my $DBHandle = InitDB(\%Conf,1); @@ -158,7 +179,6 @@ my %TablesInDB = if (!$OptUpdate) { ##### installation mode - print "----------\nStarting database table generation.\n"; # check for tables and create them, if they don't exist yet foreach my $Table (keys %DBCreate) { &CreateTable($Table); From 7b310df13f064955ef771d9657997dedd2498cfb Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sun, 11 Aug 2013 22:51:11 +0200 Subject: [PATCH 3/4] Add some TODO entries. Signed-off-by: Thomas Hochstein --- doc/TODO | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/TODO b/doc/TODO index 6f1a61b..36b6b50 100644 --- a/doc/TODO +++ b/doc/TODO @@ -12,6 +12,10 @@ Bug numbers refer to the Mantis issue tracker at . - Add a test suite There is currently no kind of test suite or regression tests. Something like that is badly needed. + - separate directories (bin, config, ...) + - make NewsStats installable in accordance with LFS and customary procedures, + i.e. scripts to /usr/local/news/bin or /usr/lib/news/bin, configuration + to /usr/local/news/etc or /etc/news and so on * Additional features - Add hierarchy information (GroupInfo - Bugs #19 #20 #21 #22 #23 #24 #25 #26) @@ -42,6 +46,8 @@ Bug numbers refer to the Mantis issue tracker at . names - would be nice. + install/install.pl + - Check installer & fix bugs to get a working version ... finally + - Read current version from a file dropped and updated by installer - Add / enhance / test error handling - General tests and optimisations From 512781bd9259ec07dd7f2958b0074f2f49573970 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Mon, 2 Sep 2013 06:44:32 +0200 Subject: [PATCH 4/4] 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 --- install/install.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/install.pl b/install/install.pl index 374d74b..4069bf5 100755 --- a/install/install.pl +++ b/install/install.pl @@ -36,12 +36,12 @@ GetOptions ('u|update=s' => \$OptUpdate, 'V|version' => \&ShowVersion) or exit 1; ### change working directory to .. (as we're in .../install) -chdir dirname($0).'/..'; +chdir dirname($FullPath).'/..'; my $Path = cwd(); ### read configuration print("Reading configuration.\n"); -my %Conf = %{ReadConfig($HomePath.'/newsstats.conf')}; +my %Conf = %{ReadConfig($Path.'/newsstats.conf')}; ##### -------------------------------------------------------------------------- ##### Database table definitions