You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by do...@apache.org on 2007/04/24 20:41:00 UTC
svn commit: r532038 - in
/spamassassin/rules/trunk/sandbox/dos/new-rule-score-gen:
generate-new-scores lock-scores masses-Makefile.patch
Author: dos
Date: Tue Apr 24 11:40:59 2007
New Revision: 532038
URL: http://svn.apache.org/viewvc?view=rev&rev=532038
Log:
lock scores to zero for no longer active rules that appear in mass-check logs that were based on older active.list logs (like what happens mid-week when rules that were active in the net check are no longer active)
Modified:
spamassassin/rules/trunk/sandbox/dos/new-rule-score-gen/generate-new-scores
spamassassin/rules/trunk/sandbox/dos/new-rule-score-gen/lock-scores
spamassassin/rules/trunk/sandbox/dos/new-rule-score-gen/masses-Makefile.patch
Modified: spamassassin/rules/trunk/sandbox/dos/new-rule-score-gen/generate-new-scores
URL: http://svn.apache.org/viewvc/spamassassin/rules/trunk/sandbox/dos/new-rule-score-gen/generate-new-scores?view=diff&rev=532038&r1=532037&r2=532038
==============================================================================
--- spamassassin/rules/trunk/sandbox/dos/new-rule-score-gen/generate-new-scores (original)
+++ spamassassin/rules/trunk/sandbox/dos/new-rule-score-gen/generate-new-scores Tue Apr 24 11:40:59 2007
@@ -94,6 +94,7 @@
svn co -r $REVISION https://svn.apache.org/repos/asf/spamassassin/trunk trunk-new-rules-set$SCORESET
svn co https://svn.apache.org/repos/asf/spamassassin/tags/spamassassin_release_3_2_0_rc_2/rules trunk-new-rules-set$SCORESET/rules-base
+svn co https://svn.apache.org/repos/asf/spamassassin/trunk/rules trunk-new-rules-set$SCORESET/rules-current
cd trunk-new-rules-set$SCORESET
svn up -r $REVISION rulesrc/
Modified: spamassassin/rules/trunk/sandbox/dos/new-rule-score-gen/lock-scores
URL: http://svn.apache.org/viewvc/spamassassin/rules/trunk/sandbox/dos/new-rule-score-gen/lock-scores?view=diff&rev=532038&r1=532037&r2=532038
==============================================================================
--- spamassassin/rules/trunk/sandbox/dos/new-rule-score-gen/lock-scores (original)
+++ spamassassin/rules/trunk/sandbox/dos/new-rule-score-gen/lock-scores Tue Apr 24 11:40:59 2007
@@ -1,11 +1,23 @@
#!/usr/bin/perl
+# locks the score ranges for the base release rules to their original scores
+# from 50_scores.cf
+
+# if called with a 1 parameter new rules that aren't in the most current copy
+# of the active.list file will be locked to zero so that the GA can ignore
+# rules that aren't in the most current update (this is used for zeroing rules
+# found in the weekly net checks that are no longer in the nightly non-net
+# checks which 6 of 7 updates a week are based on)
+
use strict;
use warnings;
my $scoreset = 0; # default
my %rulescores;
+my %currently_active;
+
+my $only_currently_active_rules = (defined $ARGV[0] && $ARGV[0] == 1 ? 1 : 0);
open(CONFIG, "config") or die "Cannot open config file: $!";
while (<CONFIG>) {
@@ -32,6 +44,13 @@
}
close ORIG;
+if ($only_currently_active_rules) {
+ open(ACTIVE, "../rules-current/active.list") or die "Cannot open rules-current/active.list: $!";
+ while(<ACTIVE>) {
+ $currently_active{$1} = undef if (/^(?!#)(\S+)$/);
+ }
+ close ACTIVE;
+}
open(ORIG, "tmp/ranges.data") or die "Cannot open original range.data file: $!";
open(NEW, ">tmp/ranges.data-new") or die "Cannot open range.data-new file: $!";
@@ -40,7 +59,15 @@
if (defined $rulescores{$1}) {
print NEW "$rulescores{$1} $rulescores{$1} 0 $1\n";
} else {
- print NEW $_;
+ if ($only_currently_active_rules) {
+ if (exists $currently_active{$1}) {
+ print NEW $_;
+ } else {
+ print NEW "0 0 0 $1\n";
+ }
+ } else {
+ print NEW $_;
+ }
}
} else {
print NEW $_;
Modified: spamassassin/rules/trunk/sandbox/dos/new-rule-score-gen/masses-Makefile.patch
URL: http://svn.apache.org/viewvc/spamassassin/rules/trunk/sandbox/dos/new-rule-score-gen/masses-Makefile.patch?view=diff&rev=532038&r1=532037&r2=532038
==============================================================================
--- spamassassin/rules/trunk/sandbox/dos/new-rule-score-gen/masses-Makefile.patch (original)
+++ spamassassin/rules/trunk/sandbox/dos/new-rule-score-gen/masses-Makefile.patch Tue Apr 24 11:40:59 2007
@@ -8,7 +8,7 @@
tmp/ranges.data: tmp/.created freqs score-ranges-from-freqs
+ perl add-hitless-active-to-freqs
perl score-ranges-from-freqs $(RULES) $(SCORESET) < freqs
-+ perl lock-scores
++ perl lock-scores 1
+ mv tmp/ranges.data-new tmp/ranges.data
freqs: spam.log ham.log