X-Git-Url: https://code.th-h.de/?p=usenet%2Fnewsstats.git;a=blobdiff_plain;f=install%2Finstall.pl;h=b998280a2acd44f7111fe1ab3c2ccfb523a454a7;hp=b14f59ac79cee63419b83d3ac68b4fcdd4286cb1;hb=71f0178b2aabf91b4f6afe3911f615d056fbf4a0;hpb=f6d15ca78e16217b709d69f2977b28dd1eeabc02 diff --git a/install/install.pl b/install/install.pl index b14f59a..b998280 100755 --- a/install/install.pl +++ b/install/install.pl @@ -96,8 +96,8 @@ Things left to do: a) Edit your 'newsfeeds' file and insert something like ## gather statistics for NewsStats - newsstats!\ - :!*,de.*\ + newsstats!\\ + :!*,de.*\\ :Tc,WmtfbsPNH,Ac:$Path/feedlog.pl Please @@ -140,19 +140,6 @@ Don't forget to restart your INN feed so that it can pick up the new version: (or whatever you called your feed). UPGRADE -##### -------------------------------------------------------------------------- -##### Upgrading -##### -------------------------------------------------------------------------- -my (%DBUpgrade,%Instructions); - -# 0.01 -> 0.02 -$DBUpgrade{'0.02'} = < $Options{'u'} and $UpVersion <= $PackageVersion) { - print "v$UpVersion: Executing database upgrade ...\n"; - &DoMySQL($DBUpgrade{$UpVersion}); - }; - }; - # Display upgrade instructions for each version - foreach my $UpVersion (sort keys %Instructions) { - if ($UpVersion > $Options{'u'} and $UpVersion <= $PackageVersion) { - print "v$UpVersion: Upgrade Instructions >>>>>\n"; - my $Padding = ' ' x (length($UpVersion) + 3); - $Instructions{$UpVersion} =~ s/^/$Padding/; - print $Instructions{$UpVersion}; - print "<" x (length($UpVersion) + 29) . "\n"; - }; + if ($Options{'u'} < 0.02) { + # 0.01 -> 0.02 + # &DoMySQL('...;'); + # print "v0.02: Database upgrades ...\n"; + # &PrintInstructions('0.02',<<" INSTRUCTIONS"); + # INSTRUCTIONS }; }; - # Display upgrade instructions + # Display general upgrade instructions print $Upgrade; }; @@ -204,7 +182,7 @@ exit(0); ################################# Subroutines ################################## -sub CreateTable() { +sub CreateTable { my $Table = shift; if (defined($TablesInDB{$Conf{$Table}})) { printf("Database table %s.%s already exists, skipping ....\n",$Conf{'DBDatabase'},$Conf{$Table}); @@ -216,13 +194,22 @@ sub CreateTable() { return; }; -sub DoMySQL() { +sub DoMySQL { my $SQL = shift; my $DBQuery = $DBHandle->prepare($SQL); $DBQuery->execute() or warn sprintf("$MySelf: E: Database error: %s\n",$DBI::errstr); return; }; +sub PrintInstructions { + my ($UpVersion,$Instructions) = @_; + print "v$UpVersion: Upgrade Instructions >>>>>\n"; + my $Padding = ' ' x (length($UpVersion) + 3); + $Instructions =~ s/^ /$Padding/mg; + print $Instructions; + print "<" x (length($UpVersion) + 29) . "\n"; +}; + __END__