You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2007/06/14 15:09:30 UTC

svn commit: r547242 - in /spamassassin/trunk/masses/rule-qa: automc/ruleqa.cgi corpus-hourly

Author: jm
Date: Thu Jun 14 06:09:29 2007
New Revision: 547242

URL: http://svn.apache.org/viewvc?view=rev&rev=547242
Log:
compress the OVERLAP files, they're pretty big

Modified:
    spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi
    spamassassin/trunk/masses/rule-qa/corpus-hourly

Modified: spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi
URL: http://svn.apache.org/viewvc/spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi?view=diff&rev=547242&r1=547241&r2=547242
==============================================================================
--- spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi (original)
+++ spamassassin/trunk/masses/rule-qa/automc/ruleqa.cgi Thu Jun 14 06:09:29 2007
@@ -735,8 +735,11 @@
 
   my $file = $self->{datadir}.$key;
   if (!open (IN, "<$file")) {
-    warn "cannot read $file";
-    return;
+    $file =~ s/'//gs;
+    if (!-f "$file.gz" || !open (IN, "gunzip -cd < '$file.gz' |")) {
+      warn "cannot read $file";
+      return;
+    }
   }
 
   $self->{freqs_head}{$key}=<IN>;

Modified: spamassassin/trunk/masses/rule-qa/corpus-hourly
URL: http://svn.apache.org/viewvc/spamassassin/trunk/masses/rule-qa/corpus-hourly?view=diff&rev=547242&r1=547241&r2=547242
==============================================================================
--- spamassassin/trunk/masses/rule-qa/corpus-hourly (original)
+++ spamassassin/trunk/masses/rule-qa/corpus-hourly Thu Jun 14 06:09:29 2007
@@ -466,6 +466,14 @@
     $bytes = (-s OUT);
     close(OUT);
     rename($tmpfname, $fname) or warn "cannot rename $tmpfname to $fname";
+
+    # compress for certain classes
+    if ($class eq "OVERLAP") {
+      $fname =~ s/'//gs;
+      system ("gzip '$fname'"); 
+      # takes care of keeping the original around so we don't have to
+      if ($? >> 8 != 0) { warn "gzip '$fname' failed"; }
+    }
   }
 
   $when = scalar localtime time;