-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Menschel writes:
> > require_version n.n.n
> 
> > Indicates that the entire file, from this line on, requires a certain
> > version of SpamAssassin to run. If a different (older or newer) version
> > of SpamAssassin tries to read the configuration from this file, it will
> > output a warning instead, and ignore it.   
> 
> > Note: The version must be in the internal SpamAssassin version format
> > which is: x.yyyzzz. x is major version, y is minor version, and z is
> > maintenance version. So 3.0.0 is 3.000000, and 3.4.80 is 3.004080.
> 
> I'd like to begin using this in the SARE rules files I maintain. How is
> this intended to be used?
> 
> For instance, if I have a file which includes RULEA, suitable for all
> versions of SA, RULEB, which is an addition-based meta rule, therefore
> needing 2.50 or higher, and RULEC which greatly overlaps a new 3.0.0 rule
> and therefore should be used only in 2.xx versions, is it possible to
> create a file that looks like the following?  Is there a better way to do
> this?

Hey Bob --

the idea is that once "require_version" is hit, the entire file is
affected.   so this type of thing (scoped conditionals) isn't supported
yet :(

So in my opinion it'd be something like:

    ifversion ($version > 2.006000 && $version < 3.000000)
    ....
    endif

we already have conditional support added in 3.0.0 for "ifplugin",
so this wouldn't be too hard -- it's just a bit late for it (sorry
about that, it hadn't occurred to me at all!)

(the idea of using a fake var like "$version" instead of just the simple
require_version type format, is so that arbitrarily complex arithmetic and
conditionals can be used.)

Could you open a bugzilla bug about it, and hopefully we can
get it in quickly?

- --j.

> Bob Menschel
> 
> require_version 2.004000
> RULEA
> RULEC
> 
> require_version 2.004001
> RULEA
> RULEC
> 
> require_version 2.004002
> RULEA
> RULEC
> 
> require_version 2.004003
> RULEA
> RULEC
> 
> require_version 2.005000
> RULEA
> RULEB
> RULEC
> 
> require_version 2.005001
> RULEA
> RULEB
> RULEC
> 
> require_version 2.005002
> RULEA
> RULEB
> RULEC
> 
> require_version 2.005003
> RULEA
> RULEB
> RULEC
> 
> require_version 2.006000
> RULEA
> RULEB
> RULEC
> 
> require_version 2.006001
> RULEA
> RULEB
> RULEC
> 
> require_version 2.006002
> RULEA
> RULEB
> RULEC
> 
> require_version 2.006003
> RULEA
> RULEB
> RULEC
> 
> require_version 2.006004
> RULEA
> RULEB
> RULEC
> 
> require_version 3.000000
> RULEA
> RULEB
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Exmh CVS

iD8DBQFBFVxVQTcbUG5Y7woRAoJoAKDWgDttsKPzKYfsQiVs+QQtPx1bkQCgof9K
8PhejX/sLIIN/ZEspZEQ+So=
=z2cX
-----END PGP SIGNATURE-----

Reply via email to