Merge branch 'installation' into next
authorThomas Hochstein <thh@inter.net>
Mon, 2 Sep 2013 10:19:11 +0000 (12:19 +0200)
committerThomas Hochstein <thh@inter.net>
Mon, 2 Sep 2013 10:19:11 +0000 (12:19 +0200)
* installation:
  Fix config path detection for install.pl.
  Add some TODO entries.
  Add database creation to installer.
  Handle undefined previous version when installing.

NewsStats.pm
gatherstats.pl

index 428719e..bfcb37b 100644 (file)
@@ -33,6 +33,7 @@ require Exporter;
   SplitPeriod
   ListMonth
   ListNewsgroups
+  ParseHierarchies
   ReadGroupList
   OutputData
   FormatOutput
index ae7d65d..4c539f1 100755 (executable)
@@ -19,7 +19,7 @@ BEGIN {
 }
 use strict;
 
-use NewsStats qw(:DEFAULT :TimePeriods ListNewsgroups ReadGroupList);
+use NewsStats qw(:DEFAULT :TimePeriods ListNewsgroups ParseHierarchies ReadGroupList);
 
 use DBI;
 use Getopt::Long qw(GetOptions);
@@ -145,13 +145,15 @@ foreach my $Month (&ListMonth($Period)) {
     if (%ValidGroups) {
       foreach (sort keys %ValidGroups) {
         if (!defined($Postings{$_})) {
-          # expand newsgroup with hierarchies
-          my @Newsgroups = ParseHierarchies($_);
-          # add each empty newsgroup and empty hierarchies, too, as needed
-          foreach (@Newsgroups) {
-            if (!defined($Postings{$_})) {
-              $Postings{$_} = 0;
-              warn (sprintf("ADDED: %s as empty group\n",$_));
+          # add current newsgroup as empty group
+          $Postings{$_} = 0;
+          warn (sprintf("ADDED: %s as empty group\n",$_));
+          # add empty hierarchies for current newsgroup as needed
+          foreach (ParseHierarchies($_)) {
+            my $Hierarchy = $_ . '.ALL';
+            if (!defined($Postings{$Hierarchy})) {
+              $Postings{$Hierarchy} = 0;
+              warn (sprintf("ADDED: %s as empty group\n",$Hierarchy));
             };
           };
         }
This page took 0.012658 seconds and 4 git commands to generate.