You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sysadmins@spamassassin.apache.org by Merijn van den Kroonenberg <me...@web2all.nl> on 2017/11/02 13:22:42 UTC

Optimize score-ranges-from-freqs (needless run of parse-rules-for-masses)

Hi,

This is about /masses and intended as a possible future todo, so i'll just
drop it in this list.

The makefile contains:

tmp/rules_${SCORESET}.pl: tmp/.created ../build/parse-rules-for-masses
	perl ../build/parse-rules-for-masses -d $(RULES) -s $(SCORESET) \
            -o tmp/rules_${SCORESET}.pl

Which generates for example a rules_0.pl.

In the same makefile is:

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 1
	mv tmp/ranges.data-new tmp/ranges.data

As you can see it runs score-ranges-from-freqs. In score-ranges-from-freqs
is this code:

my $tmpf = "tmp/rules$$.pl";
system "../build/parse-rules-for-masses ".
      "-d \"$argcffile\" -s $scoreset -o $tmpf" and die;
require $tmpf;
unlink $tmpf;

Which is doing the same thing.

So I would say change the makefile to add dependency
tmp/rules_${SCORESET}.pl to tmp/ranges.data.

And then use the tmp/rules_${SCORESET}.pl directly from
score-ranges-from-freqs.

And to be consistent also add dependencies add-hitless-active-to-freqs
lock-scores to tmp/ranges.data as they are all needed.

Cheers,
Merijn