SA Bugzilla – Bug 1794
Code submission - Not a Bug
Last modified: 2003-04-27 15:48:42 UTC
I am submitting a stats package for possible inclusion in the next release. Reports useful info on what SpamAssassin's been up to.
Created attachment 896 [details] Perl script for stats package
Brad, in order for us to consider this for inclusion in the SpamAssassin tarball, there are some licensing issues that need to be cleared up. Firstly, it is necessary that this script be under a dual PAL/GPL license. We would probably require you to agree to our CONTRIB_CERT which is available at: http://www.spamassassin.org/dist/CONTRIB_CERT Secondly, the script doesn't work with the latest CVS and has a few warnings. Scalar value @ARGV[0] better written as $ARGV[0] at /home/daf/downloads/sastats.pl line 79. Scalar value @ARGV[0] better written as $ARGV[0] at /home/daf/downloads/sastats.pl line 288. Name "main::oldfh" used only once: possible typo at /home/daf/downloads/sastats.pl line 192. and then, Argument "" isn't numeric in numeric eq (==) at sastats.pl line 106, <LOG> line 4. Argument "" isn't numeric in numeric eq (==) at sastats.pl line 106, <LOG> line 4. Argument "4.0)" isn't numeric in addition (+) at sastats.pl line 135, <LOG> line 4. Argument "4.0)" isn't numeric in addition (+) at sastats.pl line 135, <LOG> line 8. Argument "4.0)" isn't numeric in addition (+) at sastats.pl line 135, <LOG> line 24. etc. etc. Chances are the format of the log files have changed since you wrote this. It would also be nice if the configuration options could be done by command line option, using Getopt::Long or something similar. Thanks for your interest... this script looks promising.
and i'll take this bug
Created attachment 906 [details] Cleanup of stats script with Getopt::Long support, POD docs, strict/warn clean
Thanks for your help, Bob, but the licensing issue still remains... I now need _both_ of you to agree to the CONTRIB_CERT (preferably by GPG/PGP signed e-mail) to spamassassin-devel@lists.sourceforge.net. Thanks.
Ok, my CONTRIB_CERT should be in. Sorry for the awkward flopping around and any toes inadvertently stepped on. I made a first-pass refactoring to add Getopt::Long support, and clean up some of the date formatting code (POSIX::strftime is your friend.) It runs clean under -w and 'use strict;'. I also added POD docs, --usage and --help options, tweaked some of the formatting (mostly eliminating tabs and adjusting format specifiers), and converted 'nonspam' to 'ham' to be more consistent with our terminology and added the obligatory 'ham' = 'nonspam' note in the report. Oops. I've tested this against 2.53 but not against CVS. Let me know how this looks.
Subject: Re: Code submission - Not a Bug Thanks for the help. My toes are just fine. Didn't have time just now to clean it up properly. I just thought it would be useful to someone else and submitted it. My Perl coding skills are coming along, but aren't all the way up to snuff yet! I just sent a signed CONTRIB_CERT as well, so we should be good to go. ----------------------------------------- Brad > Ok, my CONTRIB_CERT should be in. Sorry for the awkward flopping around and > any toes inadvertently stepped on. > > I made a first-pass refactoring to add Getopt::Long support, and clean up some > of the date formatting code (POSIX::strftime is your friend.) It runs clean > under -w and 'use strict;'. I also added POD docs, --usage and --help options, > tweaked some of the formatting (mostly eliminating tabs and adjusting format > specifiers), and converted 'nonspam' to 'ham' to be more consistent with our > terminology and added the obligatory 'ham' = 'nonspam' note in the report. > Oops. > > I've tested this against 2.53 but not against CVS. Let me know how this looks.
Anyways... now that we've got your CONTRIB_CERTs, I've started doing some work to clean up the code even more. I intend to fix up the date parsing a little bit (making it even more elegant!), and I've fixed the whole option parsing thing. In doing so, I've removed the --owner option, as I think most will agree that's a somewhat pointless option. I have no problem with giving credit where credit is due, and I feel the manpage is sufficient for the author's name... if you really want your name in the output somewhere, let me know.... (After all that's been happening on debian-devel@lists.debian.org recently, I'm really sick of this issue...) I'll try to fix this up and commit it tomorrow.
FWIW, the option processing routine is something I've been using for a few years, mostly in a corporate setting. --owner came about because tracing accountability was difficult in our organization; nobody in California took responsibility for their code and it was inconvenient for us in Texas to find who owned what, not being able to chat up the right people in the hall; call it leading by example. The intent was less related to ego and more about taking responsibility; regardless, I have no idea about debian-devel so don't take --owner as a continuation of that. --owner is disposable, as are --verbose and --debug as they don't currently do anything.
Subject: Re: Code submission - Not a Bug I assumed it wasn't an egotistical thing. There's a big flamewar going on right now on debian-devel@lists.debian.org because someone removed a pageworth of credits and sponsors from the output of mkreiserfs or something like that, so I figured I'd better ask :-)
Subject: Re: Code submission - Not a Bug I certainly don't care, either. Knock yourself out. I contributed it for the good of the community, not for fame and fortune. I certainly don't think that particular hack was worthy of too much of my ego, anyway! If you'd like to substantially reduce the comment block at the top, that wouldn't hurt my feelings, either. Use it, abuse it, mangle it, whatever. At least I was finally able to contribute something back to my favorite project! ----------------------------------------- Brad > > I assumed it wasn't an egotistical thing. There's a big flamewar going > on right now on debian-devel@lists.debian.org because someone removed > a pageworth of credits and sponsors from the output of mkreiserfs or > something like that, so I figured I'd better ask :-)
Subject: Re: [SAdev] Code submission - Not a Bug On Wed, 23 Apr 2003 09:01:39 -0700 (PDT) bugzilla-daemon@hughes-family.org wrote: > Use it, abuse it, mangle it, whatever. At least I was finally able to > contribute something back to my favorite project! Speaking of which, is anyone interested in my bogus local address patch? Should I submit a report? If not, I'll just maintain it locally. ---------------------------------------------------------------------- | Jim Hranicky, Senior SysAdmin UF/CISE Department | | E314D CSE Building Phone (352) 392-1499 | | jfh@cise.ufl.edu http://www.cise.ufl.edu/~jfh | ----------------------------------------------------------------------
Checked into the tools/ directory of the tree. This is significantly different from the 2 versions already posted here. (Requires Date::Manip) Closing. Bugs in the new sa-stats.pl can be filed directly as new bugs. This has not been (well) tested. Thanks for the code submission.