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

that's not a horrible kludge, it's quite elegant ;)

- --j.

[EMAIL PROTECTED] writes:
> Author: felicity
> Date: Mon Feb  6 04:04:08 2006
> New Revision: 375261
> 
> URL: http://svn.apache.org/viewcvs?rev=375261&view=rev
> Log:
> for now, use a horrible kluge to make sure that mkrules puts loadplugin lines 
> at the top of outputted files -- thereby letting the plugins get loaded 
> before the rules that need them.
> 
> Modified:
>     spamassassin/trunk/build/mkrules
> 
> Modified: spamassassin/trunk/build/mkrules
> URL: 
> http://svn.apache.org/viewcvs/spamassassin/trunk/build/mkrules?rev=375261&r1=375260&r2=375261&view=diff
> ==============================================================================
> --- spamassassin/trunk/build/mkrules (original)
> +++ spamassassin/trunk/build/mkrules Mon Feb  6 04:04:08 2006
> @@ -616,7 +616,21 @@
>      }
>    }
>  
> -  my @rulenames = sort keys %$rules;
> +  # this is a horrible kluge.
> +  # at this point in the game, we've lost the ordered list of rules, so the
> +  # loadplugin lines have no guarantee that they'll be loaded before the 
> rules
> +  # that require them.  so we kluge the sort to always have loadplugin lines
> +  # appear at the very top of the array so we know they'll be listed before
> +  # anything else.
> +  my @rulenames = sort {
> +    if ($a =~ /^loadplugin_/) {
> +      return -1;
> +    }
> +    elsif ($b =~ /^loadplugin_/) {
> +      return 1;
> +    }
> +    return $a cmp $b;
> +  } keys %$rules;
>    my %seen = ();
>  
>    # go through the rules looking for meta subrules we
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Exmh CVS

iD8DBQFD557yMJF5cimLx9ARAnFFAKC42lzpBQIfu8jxaK6k67lcWRFN3QCgrzcN
yCyg/+30O1i+br6ziiTlzto=
=CfoM
-----END PGP SIGNATURE-----

Reply via email to