You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2006/02/19 22:40:09 UTC

svn commit: r378959 - /spamassassin/trunk/build/mkrules

Author: felicity
Date: Sun Feb 19 13:40:08 2006
New Revision: 378959

URL: http://svn.apache.org/viewcvs?rev=378959&view=rev
Log:
if a config line was in a conditional, and another related line came along, the conditional could be erased (ie: score FOO 0, lang de describe FOO blah)

Modified:
    spamassassin/trunk/build/mkrules

Modified: spamassassin/trunk/build/mkrules
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/build/mkrules?rev=378959&r1=378958&r2=378959&view=diff
==============================================================================
--- spamassassin/trunk/build/mkrules (original)
+++ spamassassin/trunk/build/mkrules Sun Feb 19 13:40:08 2006
@@ -333,7 +333,7 @@
       if (!$rules->{$name}) { $rules->{$name} = rule_entry_create(); }
       $rules->{$name}->{issandbox} = $issandbox;
       $rules->{$name}->{origname} = $origname;
-      $rules->{$name}->{cond} = $current_conditional;
+      $rules->{$name}->{cond} ||= $current_conditional;
       $rules->{$name}->{text} .= $current_comments . $orig;
       $rules->{$name}->{srcfile} = $f;
 
@@ -458,7 +458,7 @@
       unless ($rules->{$name}) {
         $rules->{$name} = rule_entry_create();
       }
-      $rules->{$name}->{cond} = $cond;
+      $rules->{$name}->{cond} ||= $cond;
       $rules->{$name}->{issandbox} = $issandbox;
       $rules->{$name}->{forceactive} = 1;
       $rules->{$name}->{iscommand} = 1;



Re: svn commit: r378959 - /spamassassin/trunk/build/mkrules

Posted by Theo Van Dinter <fe...@apache.org>.
On Sun, Feb 19, 2006 at 09:40:09PM -0000, felicity@apache.org wrote:
> if a config line was in a conditional, and another related line came along, the conditional could be erased (ie: score FOO 0, lang de describe FOO blah)

Just so it's more clear what I was talking about here...  In r378706
(via updates.spamassassin.org), we have the following in 72_active.cf:

##{ HASHCASH_20
score HASHCASH_20 -0.500
lang de describe HASHCASH_20 Enthält korrekteHashcashh-Kennzeichnung (20 bits)
##} HASHCASH_20

without a ifplugin conditional around it, this gets lint errors because
the plugin isn't loaded and therefore the rules doesn't exist (the actual
rule is enclosed in a conditional).  What's happening is:

as mkrules goes through:

[...]
rulesrc/core/50_scores.cf: 476 active rules, 244 other
rulesrc/core/60_whitelist_spf.cf: 4 active rules, 0 other
rulesrc/lang/de/30_text_de.cf: 353 active rules, 211 other
[...]

while the score is ifplugin'ed in 50_scores.cf, 30_text_de.cf has no such
conditional in place.  Since it's read last, the lack of conditional
overwrites what was there before, and the knowledge of the conditional
goes away. :(

-- 
Randomly Generated Tagline:
"On the one hand, we'll never experience childbirth. On the other hand,
 we can open all our own jars."
         - Jeff Green (on the difference between men and women)