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 2005/07/12 03:23:41 UTC

svn commit: r215905 - /spamassassin/trunk/masses/enable-all-evolved-rules

Author: jm
Date: Mon Jul 11 18:23:39 2005
New Revision: 215905

URL: http://svn.apache.org/viewcvs?rev=215905&view=rev
Log:
trivial, non-R-T-C change for masses -- helper script to enable zeroed rules

Added:
    spamassassin/trunk/masses/enable-all-evolved-rules   (with props)

Added: spamassassin/trunk/masses/enable-all-evolved-rules
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/masses/enable-all-evolved-rules?rev=215905&view=auto
==============================================================================
--- spamassassin/trunk/masses/enable-all-evolved-rules (added)
+++ spamassassin/trunk/masses/enable-all-evolved-rules Mon Jul 11 18:23:39 2005
@@ -0,0 +1,58 @@
+#!/usr/bin/perl -w
+
+# enable-all-evolved-rules - ensure that all evolved rules are active in a file
+#
+# usage: enable-all-evolved-rules rules/50_scores.cf > rules/51_newscores.cf
+#        mv rules/51_newscores.cf rules/50_scores.cf
+#
+# Note: this will even enable network rules in the non-net scoresets.
+# However, this should have no effect, since those check their network
+# status before running anyway.  More serious is the proprietary tests;
+# these will also become enabled.  Some manual fixup afterwards is
+# required.
+#
+# <@LICENSE>
+# Copyright 2004 Apache Software Foundation
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# </...@LICENSE>
+
+use strict;
+
+while (<>) {
+  print;
+  last if /<gen:mutable>/;
+}
+
+while (<>) {
+  if (/^\s*score\s+(.+?)$/) {
+    my @vals = split(' ', $1);
+    my $new = '';
+    foreach my $score (@vals) {
+      if ($score =~ /^[\-\+]*\d/ && $score+0 == 0) {
+        $new .= "0.0001 ";      # replace all zeros with 0.0001
+      } else {
+        $new .= "$score ";
+      }
+    }
+    print "score $new\n";
+  }
+  else {
+    print;
+  }
+  last if /<\/gen:mutable>/;
+}
+
+while (<>) {
+  print;
+}

Propchange: spamassassin/trunk/masses/enable-all-evolved-rules
------------------------------------------------------------------------------
    svn:executable = *