From upstream: missing fixes.
authorThomas Hochstein <thh@inter.net>
Mon, 16 Aug 2010 21:14:40 +0000 (23:14 +0200)
committerThomas Hochstein <thh@inter.net>
Mon, 16 Aug 2010 21:40:38 +0000 (23:40 +0200)
* UVrules.pm, usevote.rul: add H, h.
* messages.cfg: add COUNT_ERR_GROUPCOUNT.
* uvvote.pl: TMP/DIR, $msgid.

Signed-off-by: Thomas Hochstein <thh@inter.net>
UVrules.pm
messages.cfg
usevote.rul
uvvote.pl

index 4325867..76e260f 100644 (file)
@@ -149,10 +149,10 @@ sub read_rulefile {
       die $errortext . ": $_\n\n" if ($errortext);
  
       # check for correct characters in conditions
       die $errortext . ": $_\n\n" if ($errortext);
  
       # check for correct characters in conditions
-      if ($if !~ /^[JjNnEeSsIi\.]+$/) {
+      if ($if !~ /^[JjNnEeSsHhIi\.]+$/) {
         die UVmessage::get ("RULES_INVCHARS", (NUM=>$num+1, TYPE=>"if")) . ": $if\n\n";
 
         die UVmessage::get ("RULES_INVCHARS", (NUM=>$num+1, TYPE=>"if")) . ": $if\n\n";
 
-      } elsif ($then !~ /^[JjNnEeSsIi\.]+$/) {
+      } elsif ($then !~ /^[JjNnEeSsHhIi\.]+$/) {
         die UVmessage::get ("RULES_INVCHARS",
                             (NUM=>$num+1, TYPE=>"if")) . ": $then\n\n";
       }
         die UVmessage::get ("RULES_INVCHARS",
                             (NUM=>$num+1, TYPE=>"if")) . ": $then\n\n";
       }
@@ -194,8 +194,9 @@ sub read_rulefile {
 sub make_regex_pos {
   my $pat = $_[0];
  
 sub make_regex_pos {
   my $pat = $_[0];
  
-  $pat =~ s/[jens]/./g;
+  $pat =~ s/[hijens]/./g;
   $pat =~ s/S/[JN]/g;
   $pat =~ s/S/[JN]/g;
+  $pat =~ s/H/[EJ]/g;
   $pat =~ s/I/[EN]/g;
  
   return $pat;
   $pat =~ s/I/[EN]/g;
  
   return $pat;
@@ -216,22 +217,19 @@ sub make_regex_neg {
  
   # upper case characters are replaced with dots
   # (are covered by make_regex_pos)
  
   # upper case characters are replaced with dots
   # (are covered by make_regex_pos)
-  $pat =~ s/[JENS]/./g;
+  $pat =~ s/[HIJENS]/./g;
  
   # reverse lower case characters
   $pat =~ s/j/[NE]/g;
   $pat =~ s/n/[JE]/g;
   $pat =~ s/e/[JN]/g;
   $pat =~ s/s/E/g;
  
   # reverse lower case characters
   $pat =~ s/j/[NE]/g;
   $pat =~ s/n/[JE]/g;
   $pat =~ s/e/[JN]/g;
   $pat =~ s/s/E/g;
+  $pat =~ s/h/N/g;
   $pat =~ s/i/J/g;
  
   $pat =~ s/i/J/g;
  
-  # to be translated:
-  # Falls keine Kleinbuchstaben vorkamen (es sind nur Punkte uebrig):
-  # Wenn keine optionalen Forderungen vorhanden sind, wuerde der Regex
-  # immer matchen und somit die Stimme immer als nicht passend erkannt
-  # werden. Deswegen wird versucht auf den leeren String zu ueberpruefen,
-  # was durch die Negation dazu fuehrt, dass die Stimme als passend 
-  # gewertet wird.
+  # If the string contained only upper case characters they are now all
+  # replaced with dots and the RegEx would match everything, i.e. declare
+  # every vote as invalid. In this case an empty pattern is returned.
   $pat =~ s/^\.+$//;
  
   return $pat;
   $pat =~ s/^\.+$//;
  
   return $pat;
@@ -305,6 +303,10 @@ sub rule_print {
       $fill = "    $and ";
       $text1 = UVmessage::get ("RULES_IFCLAUSE",
                                (VOTE=>"$yes $or $no", GROUP=>$groups[$i]));
       $fill = "    $and ";
       $text1 = UVmessage::get ("RULES_IFCLAUSE",
                                (VOTE=>"$yes $or $no", GROUP=>$groups[$i]));
+    } elsif ($rule[$i] eq 'H') {
+      $fill = "    $and ";
+      $text1 = UVmessage::get ("RULES_IFCLAUSE",
+                               (VOTE=>"$abst $or $yes", GROUP=>$groups[$i]));
     } elsif ($rule[$i] eq 'I') {
       $fill = "    $and ";
       $text1 = UVmessage::get ("RULES_IFCLAUSE",
     } elsif ($rule[$i] eq 'I') {
       $fill = "    $and ";
       $text1 = UVmessage::get ("RULES_IFCLAUSE",
@@ -322,6 +324,10 @@ sub rule_print {
       $fill = "    $or ";
       $text1 = UVmessage::get ("RULES_IFCLAUSE",
                                (VOTE=>"$yes $or $no", GROUP=>$groups[$i]));
       $fill = "    $or ";
       $text1 = UVmessage::get ("RULES_IFCLAUSE",
                                (VOTE=>"$yes $or $no", GROUP=>$groups[$i]));
+    } elsif ($rule[$i] eq 'h') {
+      $fill = "    $or ";
+      $text1 = UVmessage::get ("RULES_IFCLAUSE",
+                               (VOTE=>"$abst $or $yes", GROUP=>$groups[$i]));
     } elsif ($rule[$i] eq 'i') {
       $fill = "    $or ";
       $text1 = UVmessage::get ("RULES_IFCLAUSE",
     } elsif ($rule[$i] eq 'i') {
       $fill = "    $or ";
       $text1 = UVmessage::get ("RULES_IFCLAUSE",
@@ -357,6 +363,10 @@ sub rule_print {
       $fill = "    $and ";
       $text1 = UVmessage::get ("RULES_THENCLAUSE",
                                (VOTE=>"$yes $or $no", GROUP=>$groups[$i]));
       $fill = "    $and ";
       $text1 = UVmessage::get ("RULES_THENCLAUSE",
                                (VOTE=>"$yes $or $no", GROUP=>$groups[$i]));
+    } elsif ($rule[$i] eq 'H') {
+      $fill = "    $and ";
+      $text1 = UVmessage::get ("RULES_THENCLAUSE",
+                               (VOTE=>"$abst $or $yes", GROUP=>$groups[$i]));
     } elsif ($rule[$i] eq 'I') {
       $fill = "    $and ";
       $text1 = UVmessage::get ("RULES_THENCLAUSE",
     } elsif ($rule[$i] eq 'I') {
       $fill = "    $and ";
       $text1 = UVmessage::get ("RULES_THENCLAUSE",
@@ -374,6 +384,10 @@ sub rule_print {
       $fill = "    $or ";
       $text1 = UVmessage::get ("RULES_THENCLAUSE",
                                (VOTE=>"$yes $or $no", GROUP=>$groups[$i]));
       $fill = "    $or ";
       $text1 = UVmessage::get ("RULES_THENCLAUSE",
                                (VOTE=>"$yes $or $no", GROUP=>$groups[$i]));
+    } elsif ($rule[$i] eq 'h') {
+      $fill = "    $or ";
+      $text1 = UVmessage::get ("RULES_THENCLAUSE",
+                               (VOTE=>"$abst $or $yes", GROUP=>$groups[$i]));
     } elsif ($rule[$i] eq 'i') {
       $fill = "    $or ";
       $text1 = UVmessage::get ("RULES_THENCLAUSE",
     } elsif ($rule[$i] eq 'i') {
       $fill = "    $or ";
       $text1 = UVmessage::get ("RULES_THENCLAUSE",
index 1ea665e..6b1dd5d 100644 (file)
@@ -154,6 +154,7 @@ CFV_SUBJECT = Wahlschein
 #
 COUNT_ERR_OPEN = Kann Ergebnisdatei ${FILE} nicht oeffnen!
 COUNT_ERR_RESULT = Fehler in ${FILE} Zeile ${LINE}
 #
 COUNT_ERR_OPEN = Kann Ergebnisdatei ${FILE} nicht oeffnen!
 COUNT_ERR_RESULT = Fehler in ${FILE} Zeile ${LINE}
+COUNT_ERR_GROUPCOUNT = Bei Stimme von <${ADDR}>: ${NUM1} statt ${NUM2} Stimmen gefunden (${RESULTFILE} kontrollieren!)
 COUNT_DELETED = ${NUM} Stimme(n) geloescht.
 #
 # uvvote.pl
 COUNT_DELETED = ${NUM} Stimme(n) geloescht.
 #
 # uvvote.pl
index e8f4501..4d9a6c6 100644 (file)
 #   N  eine NEIN-Stimme
 #   E  eine Enthaltung
 #   S  eine JA- oder NEIN-Stimme
 #   N  eine NEIN-Stimme
 #   E  eine Enthaltung
 #   S  eine JA- oder NEIN-Stimme
+#   H   eine Enthaltung oder JA-Stimme
 #   I   eine Enthaltung oder NEIN-Stimme
 #   .  egal (Ja, nein oder Enthaltung)
 #   j  eine oder mehrere der markierten Gruppen hat JA-Stimme
 #   n   ""   ""    ""     ""     ""       ""    ""  NEIN-Stimme
 #   e   ""   ""    ""     ""     ""       ""    ""  Enthaltung
 #   s   ""   ""    ""     ""     ""       ""    ""  Ja- oder Nein-Stimme
 #   I   eine Enthaltung oder NEIN-Stimme
 #   .  egal (Ja, nein oder Enthaltung)
 #   j  eine oder mehrere der markierten Gruppen hat JA-Stimme
 #   n   ""   ""    ""     ""     ""       ""    ""  NEIN-Stimme
 #   e   ""   ""    ""     ""     ""       ""    ""  Enthaltung
 #   s   ""   ""    ""     ""     ""       ""    ""  Ja- oder Nein-Stimme
+#   h   ""   ""    ""     ""     ""       ""    ""  Enthaltung oder Ja-Stimme
 #   i   ""   ""    ""     ""     ""       ""    ""  Enthaltung oder Nein-Stimme
 #
 # Alles klar?  Jede Stimme wird mit den Symbolen verglichen, und wenn alle
 #   i   ""   ""    ""     ""     ""       ""    ""  Enthaltung oder Nein-Stimme
 #
 # Alles klar?  Jede Stimme wird mit den Symbolen verglichen, und wenn alle
index 5dd26ff..a86ef43 100644 (file)
--- a/uvvote.pl
+++ b/uvvote.pl
@@ -1,8 +1,8 @@
 #!/usr/bin/perl -w
 
 ###############################################################################
 #!/usr/bin/perl -w
 
 ###############################################################################
-# UseVoteGer 4.07 Wahldurchfuehrung
-# (c) 2001-2004 Marc Langer <uv@marclanger.de>
+# UseVoteGer 4.09 Wahldurchfuehrung
+# (c) 2001-2005 Marc Langer <uv@marclanger.de>
 # 
 # This script package is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Public License as published by the
 # 
 # This script package is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Public License as published by the
@@ -37,7 +37,7 @@ use UVtemplate;
 my $clean = 0;
 my %opt_ctl = ();
 
 my $clean = 0;
 my %opt_ctl = ();
 
-print "\n$usevote_version Wahldurchfuehrung - (c) 2001-2004 Marc Langer\n\n";
+print "\n$usevote_version Wahldurchfuehrung - (c) 2001-2005 Marc Langer\n\n";
 
 # unknown parameters remain in @ARGV (for "help")
 Getopt::Long::Configure(qw(pass_through bundling));
 
 # unknown parameters remain in @ARGV (for "help")
 Getopt::Long::Configure(qw(pass_through bundling));
@@ -123,7 +123,7 @@ if ($clean) {
   my $ext = time;
 
   opendir (TMP, $config{tmpdir});
   my $ext = time;
 
   opendir (TMP, $config{tmpdir});
-  my @tmpfiles = readdir (TMP);
+  my @tmpfiles = readdir (DIR);
   closedir (TMP);
   opendir (FERTIG, $config{archivedir});
   my @fertigfiles = readdir (FERTIG);
   closedir (TMP);
   opendir (FERTIG, $config{archivedir});
   my @fertigfiles = readdir (FERTIG);
@@ -216,7 +216,7 @@ sub process_vote {
   my @header = split(/\n/, $entity->stringify_header);
   my $head = $entity->head;
   my $msgid = $head->get('Message-ID');
   my @header = split(/\n/, $entity->stringify_header);
   my $head = $entity->head;
   my $msgid = $head->get('Message-ID');
-  chomp($msgid) if defined($msgid);
+  chomp($msgid) if ($msgid);
 
   my @votes = ();              # the votes
   my @set;                     # interactively changed fields
 
   my @votes = ();              # the votes
   my @set;                     # interactively changed fields
This page took 0.015404 seconds and 4 git commands to generate.