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
diff --git a/install/install.pl b/install/install.pl
index 61e8ef1..4069bf5 100755
--- a/install/install.pl
+++ b/install/install.pl
@@ -36,17 +36,21 @@ 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
##### --------------------------------------------------------------------------
+my $DBCreate = < < <
INSTALL
-my $Upgrade = <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);
@@ -155,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);