> First to answer Kevin, the script is mainly for debugging and reviewing.
>
> I think it should be possible to do something like
>
> svn diff -r {2017-11-15} --diff-cmd /path/to/compare-rulefiles
> http://svn.apache.org/repos/asf/spamassassin/trunk/rulesrc/scores/72_scores.cf
>
> to get the changes to 72_scores.cf from last night. (cannot test right
> now because my linux svn here has no http support)

Actually that didn't work because svn adds a couple diff specific options
and arguments.

With a small wrapper shell script I can strip away those and then it works:

svn diff -r {`date --iso-8601=date`} --diff-cmd
'/path/to/compare-rulefiles-diffwrapper'
http://svn.apache.org/repos/asf/spamassassin/trunk/rulesrc/scores/72_scores.cf

If you runn this command after the rule generation you will get the rule
diff compared to the previous version. So you can easily see whats
changing each day. Could add it to a status mail or something.

Same thing could be done for the active.list to see which rules were
added/removed during rule promotion. (unfortunately we would need to
change the wrapper script for that to add the -r 0 option which is needed
for active.list)

See attachment for wrapper shell script, to be put in the same dir as the
compare-rulefiles perl script.

Cheers,
Merijn
#!/bin/sh

# Wrap compare-rulefiles for diff program (strips all options
# and arguments except the last two, which are the filenames).
# Put in same dir as the compare-rulefiles perl script.
#
# Usage:
# svn diff -r {`date --iso-8601=date`} \
#  --diff-cmd '/path/to/compare-rulefiles-diffwrapper' \
#  
http://svn.apache.org/repos/asf/spamassassin/trunk/rulesrc/scores/72_scores.cf

SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

$SCRIPTPATH/compare-rulefiles "${@: -2}" "${@: -1}"

Reply via email to