[cvsspam-devel] fix to collect_diff.rb

Fred alphasnd at gmail.com
Wed Sep 21 17:24:24 UTC 2005


  Hello,

  I'm running cvsspam on a linux box (debian) but i got some problem
when perfoming the 'diff' with cvsspam. Somewhat the second version
argument contained a newline for some files (not all, and it seemed
very random). Here is what i got when i enbaled the --debug flag:

collect_diffs.rb: CVSROOT is /home/cvs/xxxxx
collect_diffs.rb: ARGV is <BuildAll.bat>, <1.15>, <1.16
>
collect_diffs.rb: 1.16
collect_diffs.rb: about to run cvs -nq diff -Nu -r1.15 -r1.16
 BuildAll.bat
cvs [diff aborted]: Numeric tag 1.16
 contains characters other than digits and '.'
collect_diffs.rb: sending spam.  (I am /home/cvs/cvsspam/collect_diffs.rb)
cvsspam.rb: Using config '/home/cvs/xxxxxx/CVSROOT/cvsspam.conf'
cvsspam.rb: invoking '/usr/sbin/sendmail -t -oi'
cvsspam.rb: Mail From not set
cvsspam.rb: leaving file /tmp/#cvsspam.4633.1000-85846936/logfile.emailtmp
collect_diffs.rb: leaving file /tmp/#cvsspam.4633.1000-85846936/logfile

The newline after the 1.16 is really present, it's not a mail issue
:). So to fix this, i just added a .strip to the line which build the
cvs diff:

diff_cmd << "-D1/26/1977" << "-r#{change.toVer.strip}"

and

diff_cmd << "-r#{change.fromVer}" << "-r#{change.toVer.strip}"

I spend some times on it, so i tough it could be useful to other
people. That's why i post it. This changes shouldn't affect other
stuffs. Whith this all is working nicely :).

-- 

    Best regards,

           Fred.



More information about the cvsspam-devel mailing list