spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j.@apache.org
Subject svn commit: r562498 - /spamassassin/trunk/masses/rule-qa/corpus-hourly
Date Fri, 03 Aug 2007 15:21:59 GMT
Author: jm
Date: Fri Aug  3 08:21:58 2007
New Revision: 562498

URL: http://svn.apache.org/viewvc?view=rev&rev=562498
Log:
right; fixed.  WEEK was only a day (must have accidentally deleted something here), and before
and after were listed in *the wrong order* in the damn split statement

Modified:
    spamassassin/trunk/masses/rule-qa/corpus-hourly

Modified: spamassassin/trunk/masses/rule-qa/corpus-hourly
URL: http://svn.apache.org/viewvc/spamassassin/trunk/masses/rule-qa/corpus-hourly?view=diff&rev=562498&r1=562497&r2=562498
==============================================================================
--- spamassassin/trunk/masses/rule-qa/corpus-hourly (original)
+++ spamassassin/trunk/masses/rule-qa/corpus-hourly Fri Aug  3 08:21:58 2007
@@ -25,7 +25,7 @@
 use Cwd 'abs_path';
 use POSIX qw(nice strftime);
 
-use constant WEEK => 60*60*24;
+use constant WEEK => 7*60*60*24;
 nice(15);
 
 # daterevs -- e.g. "20060429/r239832-r" -- are aligned to 0800 UTC, just before
@@ -248,16 +248,15 @@
 sub time_filter_fileset {
   my ($fileary, $outname, $after, $before) = @_;
 
-  my $timet_before = (defined $before ? ($time_start - ($before * WEEK)) : undef);
-  my $timet_after  = (defined $after ? ($time_start - ($after * WEEK)) : undef);
+  my $timet_before = (defined $before ? ($time_start - ($before * WEEK)) : $time_start+1);
+  my $timet_after  = (defined $after ? ($time_start - ($after * WEEK)) : 0);
 
   open(TMP, "> $outname") or warn "cannot write $outname";
   for my $file (@{$fileary}) {
     open(IN, $file) or warn "cannot read $file";
     while (<IN>) {
       next unless /\btime=(\d+)/;
-      next if (defined($timet_after) && $1 < $timet_after);
-      next if (defined($timet_before) && $1 > $timet_before);
+      next if ($1 < $timet_after || $1 > $timet_before);
       print TMP;
     }
     close IN;
@@ -451,7 +450,7 @@
       my @output;
 
       for my $which (("0-1", "1-2", "2-3", "3-6")) {
-        my ($after, $before) = split(/-/, $which);
+        my ($before, $after) = split(/-/, $which);
         # get and filter logs
         chdir $corpusdir;
         time_filter_fileset(\@ham, "$opt{tmp}/ham.log.$$", $after, $before);



Mime
View raw message