From skoehler at upb.de Sun Oct 3 16:43:09 2004 From: skoehler at upb.de (=?ISO-8859-15?Q?Sven_K=F6hler?=) Date: Sun, 03 Oct 2004 18:43:09 +0200 Subject: [cvsspam-devel] [RFE] sorting the diffs Message-ID: <41602C1D.90404@upb.de> Hi, CVSSpam could sort the diffs according to the filesnames and paths they apply to. A diff for the file a/b/c/d should be prior to a diff for a file called c/d/e/f. That's all ;-) Thx Sven From dave at badgers-in-foil.co.uk Mon Oct 4 01:12:12 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Mon, 4 Oct 2004 01:12:12 +0000 Subject: [cvsspam-devel] [RFE] sorting the diffs In-Reply-To: <41602C1D.90404@upb.de> References: <41602C1D.90404@upb.de> Message-ID: <20041004011212.GA1353@vhost.badgers-in-foil.co.uk> On Sun, Oct 03, 2004 at 06:43:09PM +0200, Sven K?hler wrote: > CVSSpam could sort the diffs according to the filesnames and paths they > apply to. A diff for the file a/b/c/d should be prior to a diff for a > file called c/d/e/f. I think that CVSspam just presents the files in the order that the client submitted them to the CVS server. It seems that Eclipse doesn't submit files in order, unlike the CVS command-line client. I've added this to the TODO list. dave From skoehler at upb.de Mon Oct 4 02:12:50 2004 From: skoehler at upb.de (=?ISO-8859-1?Q?Sven_K=F6hler?=) Date: Mon, 04 Oct 2004 04:12:50 +0200 Subject: [cvsspam-devel] [RFE] sorting the diffs In-Reply-To: <20041004011212.GA1353@vhost.badgers-in-foil.co.uk> References: <41602C1D.90404@upb.de> <20041004011212.GA1353@vhost.badgers-in-foil.co.uk> Message-ID: <4160B1A2.6060709@upb.de> >>CVSSpam could sort the diffs according to the filesnames and paths they >>apply to. A diff for the file a/b/c/d should be prior to a diff for a >>file called c/d/e/f. > > I think that CVSspam just presents the files in the order that the > client submitted them to the CVS server. It seems that Eclipse doesn't > submit files in order, unlike the CVS command-line client. You're right. Eclipse does commit them in a somewhat "chaotic" but folder-wise order, and so the commit-mails are very chaotic too. On the other hand, i cannot imagine that the CVS client walks the directory in alphabetical ordner. I would have guessed, that it walks the directory structure in that ordner, the filesystem returns it, but i might be wrong. > I've added this to the TODO list. Thx. From dave at badgers-in-foil.co.uk Thu Oct 7 23:55:53 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Thu, 7 Oct 2004 23:55:53 +0000 Subject: [cvsspam-devel] Erraneous cvsspam.rb behavior on specific cvs comment In-Reply-To: <20040928225741.GB26262@vhost.badgers-in-foil.co.uk> References: <19116081716.20040928200216@gorkster.de> <20040928184536.GA24055@vhost.badgers-in-foil.co.uk> <147121502371.20040928213236@gorkster.de> <20040928225741.GB26262@vhost.badgers-in-foil.co.uk> Message-ID: <20041007235552.GA12541@vhost.badgers-in-foil.co.uk> --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Sep 28, 2004 at 10:57:41PM +0000, David Holroyd wrote: > On Tue, Sep 28, 2004 at 09:32:36PM +0200, Adam Malik wrote: > > >> Here is the output I get on checking in: > > >> > > >> /home/projects/homeaut/Repository/CVSROOT/cvsspam.rb:1406:in > > >> `write': Broken pipe (Errno::EPIPE) > sendmail (and indeed SMTP) mark the end of an email message body with a > single dot ('.') on a line on its own. CVSspam is, unfortunately, quite > happy to produce messages that contain this sequence in the middle of > the message body. You're seeing a broken pipe error because sendmail > stops processing input when it reaches the '.' in your message, and it > exits, closing its end of the interprocess pipe. > > The solution is to add a class to CVSspam to filter lines of output as > they are generated, and perform escaping on these special values, like, > > line.sub!(/^(\.+)$/, "#{$1}.") # turn the line '.' into '..', etc. I tried implementing this solution, and although this allowed the whole email though, the 'extra' dots added by the encoding still appeared in the delivered mail. It turns out that there's a sendmail switch to turn off the dot-terminates-message-body behavior. The attached patch adds -oi to the sendmail options; that fixes the problem, in my testcase. dave --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dot_alone_on_a_line-patch2.diff" Index: cvsspam.rb =================================================================== RCS file: /var/lib/cvs/cvsspam/cvsspam.rb,v retrieving revision 1.57 diff -u -r1.57 cvsspam.rb --- cvsspam.rb 18 Sep 2004 01:35:17 -0000 1.57 +++ cvsspam.rb 7 Oct 2004 23:46:24 -0000 @@ -1469,8 +1469,9 @@ class SendmailMailer def send(from, recipients) - blah("invoking #{$sendmail_prog} -t") - IO.popen("#{$sendmail_prog} -t", "w") do |mail| + cmd = "#{$sendmail_prog} -t -oi" + blah("invoking '#{cmd}'") + IO.popen(cmd, "w") do |mail| ctx = MailContext.new(mail) ctx.header("To", recipients.join(',')) ctx.header("From", from) if from --u3/rZRmxL6MmkK24-- From dave at badgers-in-foil.co.uk Sun Oct 10 22:47:12 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Sun, 10 Oct 2004 22:47:12 +0000 Subject: [cvsspam-devel] collect_diffs.rb: invalid option -- on directory add In-Reply-To: <20040902095440.GA22457@vhost.badgers-in-foil.co.uk> References: <60183.213.39.153.228.1094085199.squirrel@mail.stattmann.com> <20040902095440.GA22457@vhost.badgers-in-foil.co.uk> Message-ID: <20041010224711.GA32429@vhost.badgers-in-foil.co.uk> --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Sep 02, 2004 at 09:54:41AM +0000, David Holroyd wrote: > On Thu, Sep 02, 2004 at 02:33:19AM +0200, michael@stattmann.com wrote: > > i experience some strange behaviour on directory adding since i have updated > > to cvs 1.12.9. collect_diffs shows following errors: > > > > /opt/cvsspam/collect_diffs.rb: invalid option -- > > /usr/lib/ruby/1.8/getoptlong.rb:265:in `set_error': invalid option -- > > (GetoptLong::InvalidOption) > > from /usr/lib/ruby/1.8/getoptlong.rb:434:in `get_option' > > from /usr/lib/ruby/1.8/getoptlong.rb:458:in `each' > > from /usr/lib/ruby/1.8/getoptlong.rb:457:in `loop' > > from /usr/lib/ruby/1.8/getoptlong.rb:457:in `each' > > from /opt/cvsspam/collect_diffs.rb:338 > > > > i've seen this already on the list. but i'm using cvsspam 0.2.10 which > > should handle the new info format. > > i did a test with echo and it seems that there is no directory name passed > > from cvs. the arguments are: > > - New directory NONE NONE > > plus the date. i thing the stale hyphen is the cause for the problems. > I'll try to fix it soon. Probably by checking for these arguments > before attempting to use GetOpt. The attached patch checks for these arguments before normal GetOpt processing. It fixes those errors for me. Please give it a try an let me know if it helps. dave --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="handle_new_cvs_args-patch1.diff" Index: collect_diffs.rb =================================================================== RCS file: /var/lib/cvs/cvsspam/collect_diffs.rb,v retrieving revision 1.19 diff -u -r1.19 collect_diffs.rb --- collect_diffs.rb 23 Sep 2004 13:08:19 -0000 1.19 +++ collect_diffs.rb 10 Oct 2004 22:39:44 -0000 @@ -256,22 +256,6 @@ end -def choose_operation(op) - # in the CVS 1.12.x series, new directory notifications include versions - # 'NONE' and 'NONE', whereas older versions of CVS didn't include any version - # info here. The string ',NONE,NONE' is therefore optional in the regexp, - if op =~ / - New directory(?:,NONE,NONE)?$/ - blah("No action taken on directory creation") - consume_stdin() - elsif op =~ / - Imported sources$/ - blah("Imported not handled") - consume_stdin() - else - process_log(op) - mailtest - end -end - def mailtest lastdir = nil File.open("#{$datadir}/lastdir") do |file| @@ -336,6 +320,29 @@ end +def handle_operation?(args) + # The CVS 1.12.x series pass an argument with the value "- New directory" + # whereas previous versions passed "some/path - New directory". The newer + # syntax looks like a command-line switch, and confuses GetOpt. We check + # for that case before GetOpt processing + unless ARGV.detect{|el| el =~ /- New directory$/}.nil? + blah("No action taken on directory creation") + return false + end + unless ARGV.detect{|el| el =~ /- Imported sources$/}.nil? + blah("Imported not handled") + return false + end + return true +end + + +unless handle_operation?(ARGV) + consume_stdin() + exit +end + + require 'getoptlong' opts = GetoptLong.new( @@ -404,7 +411,7 @@ if ARGV.length % 3 != 0 $stderr.puts "Expected 3 arguments for each file" end - choose_operation(ARGV) + process_log(ARGV) else if ARGV.length != 1 $stderr.puts "Expected arguments missing" @@ -413,5 +420,6 @@ $stderr.puts " (the sequence '%{sVv}' is expanded by CVS, when found in CVSROOT/loginfo)" exit end - choose_operation(ARGV[0]) + process_log(ARGV[0]) end +mailtest --wRRV7LY7NUeQGEoC-- From dave at badgers-in-foil.co.uk Mon Oct 11 17:47:32 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Mon, 11 Oct 2004 17:47:32 +0000 Subject: [cvsspam-devel] [BUG] bad subject In-Reply-To: <20040927232136.GA8110@vhost.badgers-in-foil.co.uk> References: <41532406.30804@upb.de> <4154C561.6040002@upb.de> <20040925093947.GA20995@vhost.badgers-in-foil.co.uk> <41555E88.5070806@upb.de> <41555F2E.3080403@upb.de> <20040925124248.GB20995@vhost.badgers-in-foil.co.uk> <4155723F.50901@upb.de> <20040927232136.GA8110@vhost.badgers-in-foil.co.uk> Message-ID: <20041011174732.GA23155@vhost.badgers-in-foil.co.uk> On Mon, Sep 27, 2004 at 11:21:37PM +0000, David Holroyd wrote: > Well, I think the nest step is for me to work out what machine I've got > a copy of Eclipse installed on, and compare the values of these > variables to those they have when things are working. I tried using the version of Eclipse that's in Debian/unstable (2., IIRC), but it wouldn't let me add an extra '/'. I changed the value from '/var/lib/cvs' (which has worked in the past) to '/var/lib/cvs/', and was informed that this was an invalid repository path. Are we just using different versions of Eclipse, or do I have some additional configuration issue, do you think? dave From dave at badgers-in-foil.co.uk Wed Oct 13 13:49:14 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Wed, 13 Oct 2004 13:49:14 +0000 Subject: [cvsspam-devel] [BUG] bad subject In-Reply-To: <416ACAA8.5080800@upb.de> References: <41532406.30804@upb.de> <4154C561.6040002@upb.de> <20040925093947.GA20995@vhost.badgers-in-foil.co.uk> <41555E88.5070806@upb.de> <41555F2E.3080403@upb.de> <20040925124248.GB20995@vhost.badgers-in-foil.co.uk> <4155723F.50901@upb.de> <20040927232136.GA8110@vhost.badgers-in-foil.co.uk> <20041011174732.GA23155@vhost.badgers-in-foil.co.uk> <416ACAA8.5080800@upb.de> Message-ID: <20041013134913.GA26796@vhost.badgers-in-foil.co.uk> On Mon, Oct 11, 2004 at 08:02:16PM +0200, Sven K?hler wrote: > >I tried using the version of Eclipse that's in Debian/unstable > >(2., IIRC), but it wouldn't let me add an extra '/'. I > >changed the value from '/var/lib/cvs' (which has worked in the past) to > >'/var/lib/cvs/', and was informed that this was an invalid repository > >path. > > > >Are we just using different versions of Eclipse, or do I have some > >additional configuration issue, do you think? > > I'm using Eclipse 3.1M2, but i think it should work with Eclipse 3.0.1 > too. It doesn't warn me at all about additional slashes - strange ... I had someone at work try adding a '/' to the repository path using 3.1M2 (or possibly M1?). He also got a warning that this wasn't allowed. I notice that the CVS server we have at work is configured with '--allow-root=/cvs'. Is there an --allow-root value in your server's setup? Maybe that's why I see different results. dave From dave at badgers-in-foil.co.uk Wed Oct 13 14:25:03 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Wed, 13 Oct 2004 14:25:03 +0000 Subject: [cvsspam-devel] [BUG] bad subject In-Reply-To: <416D3633.6020704@upb.de> References: <20040925093947.GA20995@vhost.badgers-in-foil.co.uk> <41555E88.5070806@upb.de> <41555F2E.3080403@upb.de> <20040925124248.GB20995@vhost.badgers-in-foil.co.uk> <4155723F.50901@upb.de> <20040927232136.GA8110@vhost.badgers-in-foil.co.uk> <20041011174732.GA23155@vhost.badgers-in-foil.co.uk> <416ACAA8.5080800@upb.de> <20041013134913.GA26796@vhost.badgers-in-foil.co.uk> <416D3633.6020704@upb.de> Message-ID: <20041013142503.GA27543@vhost.badgers-in-foil.co.uk> On Wed, Oct 13, 2004 at 04:05:39PM +0200, Sven K?hler wrote: > >I had someone at work try adding a '/' to the repository path using > >3.1M2 (or possibly M1?). He also got a warning that this wasn't > >allowed. > > Was this a warning generated by Eclipse itself, or send by the CVS-Server? The message appeared in an Eclipse dialoge box with (I think) [Ignore] and [Cancel] buttons. I am not familiar with Eclipse's normal method of reporting errors from CVS, so I'd assume this is a message from the server. > >I notice that the CVS server we have at work is configured with > >'--allow-root=/cvs'. Is there an --allow-root value in your server's > >setup? Maybe that's why I see different results. > > I don't have any "--allow-root" in there. I also use CVS over SSH, not > pserver (i guess you're using pserver, am i right?). You are correct, we use pserver. When I next have a moment, I'll try altering my server's config to remove the --allow-root, and will test again. dave From luke at smgf.org Wed Oct 13 19:03:55 2004 From: luke at smgf.org (Luke Hutchison) Date: Wed, 13 Oct 2004 13:03:55 -0600 Subject: [cvsspam-devel] Problem with record_lastdir.rb Message-ID: <1097694235.14582.196.camel@smgf-wks12> Hi, I'm having a problem installing cvsspam. The problem is that record_lastdir.rb does this: File.open("CVS/Entries") do |file| However, there is no CVS/Entries in the CVS repository on the server, it only exists in checked-out copies of the repository. What am I doing wrong? Thanks, -- Luke Hutchison From dave at badgers-in-foil.co.uk Thu Oct 14 09:21:23 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Thu, 14 Oct 2004 09:21:23 +0000 Subject: [cvsspam-devel] Problem with record_lastdir.rb In-Reply-To: <1097694235.14582.196.camel@smgf-wks12> References: <1097694235.14582.196.camel@smgf-wks12> Message-ID: <20041014092122.GB11138@vhost.badgers-in-foil.co.uk> On Wed, Oct 13, 2004 at 01:03:55PM -0600, Luke Hutchison wrote: > Hi, > > I'm having a problem installing cvsspam. The problem is that > record_lastdir.rb does this: > > File.open("CVS/Entries") do |file| > > However, there is no CVS/Entries in the CVS repository on the server, it > only exists in checked-out copies of the repository. What am I doing > wrong? While true that such directories don't exist in the repository, CVSspam expects to be invoked in a context where these files are available. I think that on commit, what normally happens is that CVS creates a temp directory to hold committed files, and recreates something approximating a working directory there. It's from this temp directory that CVSspam expects to be able to open "CVS/Entries". The above is just based on some guesswork on my part, so maybe there are situations where it doesn't hold true. So, - What CVS client and server (versions) do you use? - If accessing the server over the network, what access method do you use? - Any other handy info you can give (error messages)? dave From luke at smgf.org Thu Oct 14 17:08:02 2004 From: luke at smgf.org (Luke Hutchison) Date: Thu, 14 Oct 2004 11:08:02 -0600 Subject: [cvsspam-devel] Problem with record_lastdir.rb In-Reply-To: <20041014092122.GB11138@vhost.badgers-in-foil.co.uk> References: <1097694235.14582.196.camel@smgf-wks12> <20041014092122.GB11138@vhost.badgers-in-foil.co.uk> Message-ID: <1097773682.14582.224.camel@smgf-wks12> I don't see any errors when I actually commit changes, but invoking lastdir.rb manually I get: ./record_lastdir.rb record_lastdir.rb:50:in `initialize': No such file or directory - CVS/Entries (Errno::ENOENT) from record_lastdir.rb:50:in `open' from record_lastdir.rb:50 I get the same thing if I invoke it as: ./record_lastdir.rb /home/cvsroot (inspired by the line in record_lastdir.rb which says $repositorydir = ARGV.shift). CVSROOT has been exported as /home/cvsroot, which is where I set up the CVS repository. The repository is on the same machine as the one I check out my own local copy to, but there are two other people who work on the same repository from different machines. We use pserver to connect. CVS version is 1.11.17. cvsspam files are checked into /home/cvsroot/CVSROOT. Does any of that help? Thanks, Luke Hutchison. On Thu, 2004-10-14 at 09:21 +0000, David Holroyd wrote: > On Wed, Oct 13, 2004 at 01:03:55PM -0600, Luke Hutchison wrote: > > Hi, > > > > I'm having a problem installing cvsspam. The problem is that > > record_lastdir.rb does this: > > > > File.open("CVS/Entries") do |file| > > > > However, there is no CVS/Entries in the CVS repository on the server, it > > only exists in checked-out copies of the repository. What am I doing > > wrong? > > While true that such directories don't exist in the repository, CVSspam > expects to be invoked in a context where these files are available. > > I think that on commit, what normally happens is that CVS creates a temp > directory to hold committed files, and recreates something approximating > a working directory there. It's from this temp directory that CVSspam > expects to be able to open "CVS/Entries". > > The above is just based on some guesswork on my part, so maybe there are > situations where it doesn't hold true. > > So, > > - What CVS client and server (versions) do you use? > > - If accessing the server over the network, what access method do you > use? > > - Any other handy info you can give (error messages)? > > > dave > > _______________________________________________ > cvsspam-devel mailing list > cvsspam-devel@lists.badgers-in-foil.co.uk > http://lists.badgers-in-foil.co.uk/mailman/listinfo/cvsspam-devel -- Luke Hutchison From dave at badgers-in-foil.co.uk Thu Oct 14 17:30:26 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Thu, 14 Oct 2004 17:30:26 +0000 Subject: [cvsspam-devel] Problem with record_lastdir.rb In-Reply-To: <1097773682.14582.224.camel@smgf-wks12> References: <1097694235.14582.196.camel@smgf-wks12> <20041014092122.GB11138@vhost.badgers-in-foil.co.uk> <1097773682.14582.224.camel@smgf-wks12> Message-ID: <20041014173026.GC14104@vhost.badgers-in-foil.co.uk> On Thu, Oct 14, 2004 at 11:08:02AM -0600, Luke Hutchison wrote: > I don't see any errors when I actually commit changes, but invoking > lastdir.rb manually I get: Ahhh. Well, the CVSspam scripts are not to be invoked 'by hand'. They're only intented to be run, automatically, at the point when a 'cvs commit' happens. Have you made the CVS configuration changes described here, http://www.badgers-in-foil.co.uk/projects/cvsspam/cvsspam-doc.html#AEN41 ? Is the problem simply that the documentation is rambling and nonsensical? (Any comments on the quality, or lack thereof, of the documentation will be gratefully recieved!) Or are you just running the scripts by hand to try and debug some other installation problem? (If so; that wont work.) dave From luke at smgf.org Thu Oct 14 18:47:53 2004 From: luke at smgf.org (Luke Hutchison) Date: Thu, 14 Oct 2004 12:47:53 -0600 Subject: [cvsspam-devel] Problem with record_lastdir.rb In-Reply-To: <20041014173026.GC14104@vhost.badgers-in-foil.co.uk> References: <1097694235.14582.196.camel@smgf-wks12> <20041014092122.GB11138@vhost.badgers-in-foil.co.uk> <1097773682.14582.224.camel@smgf-wks12> <20041014173026.GC14104@vhost.badgers-in-foil.co.uk> Message-ID: <1097779673.14582.256.camel@smgf-wks12> The problem is that the email was never getting sent. I tried running the scripts by hand to see if I could locate the source of the problem, and that's where it stopped. I did not know that CVS created the directory "CVS" and the file "CVS/Entries" during a commit operation, so I just thought that there was some confusion between server-side and client-side code. I followed the instructions in cvsspam-doc.html in detail, to no avail. I will try writing some debug statements to a log to see where this fails, but meanwhile, do you have any suggestions? As for feedback on the documentation: my main comment is that it would be nice to have a couple of concrete scenarios where an actual domain name, $CVSROOT value, set of users, and set of user email addresses is given, along with a set of actual changes to config files. Some of the config stuff is a little vague (e.g. the line "DEFAULT ..."). Users shouldn't have to think too hard about configuring their system :-) -- it's nice when you can say, "that is the same scenario as mine", and just substitute one email addr for another etc. Thanks.. Luke On Thu, 2004-10-14 at 17:30 +0000, David Holroyd wrote: > On Thu, Oct 14, 2004 at 11:08:02AM -0600, Luke Hutchison wrote: > > I don't see any errors when I actually commit changes, but invoking > > lastdir.rb manually I get: > > Ahhh. > > Well, the CVSspam scripts are not to be invoked 'by hand'. They're only > intented to be run, automatically, at the point when a 'cvs commit' > happens. > > Have you made the CVS configuration changes described here, > > http://www.badgers-in-foil.co.uk/projects/cvsspam/cvsspam-doc.html#AEN41 > > ? > > Is the problem simply that the documentation is rambling and nonsensical? > (Any comments on the quality, or lack thereof, of the documentation will > be gratefully recieved!) > > Or are you just running the scripts by hand to try and debug some other > installation problem? (If so; that wont work.) > > > dave > > _______________________________________________ > cvsspam-devel mailing list > cvsspam-devel@lists.badgers-in-foil.co.uk > http://lists.badgers-in-foil.co.uk/mailman/listinfo/cvsspam-devel -- Luke Hutchison From dave at badgers-in-foil.co.uk Thu Oct 14 20:50:15 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Thu, 14 Oct 2004 20:50:15 +0000 Subject: [cvsspam-devel] Problem with record_lastdir.rb In-Reply-To: <1097779673.14582.256.camel@smgf-wks12> References: <1097694235.14582.196.camel@smgf-wks12> <20041014092122.GB11138@vhost.badgers-in-foil.co.uk> <1097773682.14582.224.camel@smgf-wks12> <20041014173026.GC14104@vhost.badgers-in-foil.co.uk> <1097779673.14582.256.camel@smgf-wks12> Message-ID: <20041014205015.GA20305@vhost.badgers-in-foil.co.uk> On Thu, Oct 14, 2004 at 12:47:53PM -0600, Luke Hutchison wrote: > The problem is that the email was never getting sent. [...] > I followed the instructions in cvsspam-doc.html in detail, to no avail. > I will try writing some debug statements to a log to see where this > fails, but meanwhile, do you have any suggestions? First things first: Make sure any changes within the checked-out copy of the CVSROOT module are committed back to the repository, or you'll not see anything happen. Once you're sure that's not the problem, try adding the (secret!) command line switch --debug to the options given for collect_diffs.rb, in 'loginfo': DEFAULT $CVSROOT/CVSROOT/collect_diffs.rb --debug --to user@host %{sVv} (Or whatever the expression on the left hand side is, if not DEFAULT.) After committing that change, make a further commit to test things. You should see extra debug messages from CVSspam, amongst the normal CVS gumpf, like this: dave@castle:~/projects/testproject$ cvs commit modify.txt /cvs/testproject/modify.txt,v <-- modify.txt new revision: 1.3; previous revision: 1.2 collect_diffs.rb: CVSROOT is /cvs collect_diffs.rb: ARGV is , <1.2>, <1.3> collect_diffs.rb: about to run cvs -nq diff -Nu -r1.2 -r1.3 modify.txt collect_diffs.rb: sending spam. (I am /cvs/CVSROOT/collect_diffs.rb) cvsspam.rb: Using config '/cvs/CVSROOT/cvsspam.conf' cvsspam.rb: invoking '/usr/sbin/sendmail.rb -t -oi' cvsspam.rb: leaving file /tmp/#cvsspam.1431.1234-92581482/logfile.emailtmp ** Output placed in 'complex.html' rather than emailed ** collect_diffs.rb: leaving file /tmp/#cvsspam.1431.1234-92581482/logfile (Note that I actually faked that a bit, just to make the paths shorter; hopefuly this is undetectable.) If you could send that output (or any error mesages) in a reply, I can take a look, and see if there's anything obviously wrong. > As for feedback on the documentation: my main comment is that it would > be nice to have a couple of concrete scenarios where an actual domain > name, $CVSROOT value, set of users, and set of user email addresses is > given, along with a set of actual changes to config files. Some of the > config stuff is a little vague (e.g. the line "DEFAULT ..."). Users > shouldn't have to think too hard about configuring their system :-) > -- it's nice when you can say, "that is the same scenario as mine", and > just substitute one email addr for another etc. Yeah, that's a fair point. More concrete examples would be helpful. I've added that into the TODO list. dave From dave at badgers-in-foil.co.uk Sat Oct 23 15:37:41 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Sat, 23 Oct 2004 15:37:41 +0000 Subject: [cvsspam-devel] [BUG] bad subject In-Reply-To: <41555E88.5070806@upb.de> References: <41532406.30804@upb.de> <4154C561.6040002@upb.de> <20040925093947.GA20995@vhost.badgers-in-foil.co.uk> <41555E88.5070806@upb.de> Message-ID: <20041023153740.GA377@vhost.badgers-in-foil.co.uk> --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Sep 25, 2004 at 02:03:20PM +0200, Sven K?hler wrote: > >Could you try with the attached patch to collect_diffs.rb? > > /opt/cvsspam/collect_diffs.rb:102:in `collect_antique_style_args': > calculated repository path ('test') doesn't match start of command line > arg ('/test test.txt,1.4,1.5') (RuntimeError) > from /opt/cvsspam/collect_diffs.rb:161:in `process_log' > from /opt/cvsspam/collect_diffs.rb:262:in `choose_operation' > from /opt/cvsspam/collect_diffs.rb:408 I tried again to reproduce this using a server without any --allow-root specification, but Eclipse still wouldn't let me add a trailing slash. I was able to reproduce the error, by making artificial changes in the script to: 1. Leave cvsroot unchanged (i.e. no trailing slash) 2. add an extra slash inside the path to the committed files I think the original patch is probably close to the proper fix, but it just needs an extra nudge to address the above error. So here it is again, with the addition of a line that should strip the slash in '/test ...' that the exception above complains about. dave --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="sanitise_path-patch2.diff" Index: collect_diffs.rb =================================================================== RCS file: /var/lib/cvs/cvsspam/collect_diffs.rb,v retrieving revision 1.20 diff -u -r1.20 collect_diffs.rb --- collect_diffs.rb 14 Oct 2004 21:40:12 -0000 1.20 +++ collect_diffs.rb 23 Oct 2004 15:31:05 -0000 @@ -98,6 +98,10 @@ # unambiguously, but we make an effort to get it right in as many cases as # possible. def collect_antique_style_args(cvs_info) + # remove leading slashes that may appear due to the user entering trailing + # slashes in their CVSROOT specification + cvs_info.sub!(/^\/+/, "") + unless cvs_info.slice(0, $repository_path.length+1) == "#{$repository_path} " fail "calculated repository path ('#{$repository_path}') doesn't match start of command line arg ('#{cvs_info}')" end @@ -131,9 +135,13 @@ return changes end +# Replace multiple adjecent forward slashes with a single slash. +def sanitise_path(path) + path.gsub(/\/+/, "/") +end def process_log(cvs_info) - cvsroot = ENV['CVSROOT'] + cvsroot = sanitise_path(ENV['CVSROOT']) $datadir = find_data_dir() @@ -144,7 +152,7 @@ fail "Log preamble looks suspect (doesn't start 'Update of ...')" end - $path = $1 + $path = sanitise_path($1) unless $path.slice(0,cvsroot.length) == cvsroot fail "CVSROOT ('#{cvsroot}') doesn't match log preamble ('#{$path}')" end @@ -259,7 +267,7 @@ def mailtest lastdir = nil File.open("#{$datadir}/lastdir") do |file| - lastdir = file.gets + lastdir = sanitise_path(file.gets) end if $path == lastdir blah("sending spam. (I am #{$0})") --Q68bSM7Ycu6FN28Q--