From michael at stattmann.com Thu Sep 2 00:33:19 2004 From: michael at stattmann.com (michael@stattmann.com) Date: Thu, 2 Sep 2004 02:33:19 +0200 (CEST) Subject: [cvsspam-devel] collect_diffs.rb: invalid option -- on directory add Message-ID: <60183.213.39.153.228.1094085199.squirrel@mail.stattmann.com> hi, 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. all other functionality seems to work as expected. any ideas? cheers, michael From dave at badgers-in-foil.co.uk Thu Sep 2 09:54:41 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Thu, 2 Sep 2004 09:54:41 +0000 Subject: [cvsspam-devel] collect_diffs.rb: invalid option -- on directory add In-Reply-To: <60183.213.39.153.228.1094085199.squirrel@mail.stattmann.com> References: <60183.213.39.153.228.1094085199.squirrel@mail.stattmann.com> Message-ID: <20040902095440.GA22457@vhost.badgers-in-foil.co.uk> 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. Yeah, I think you're right. Looks like I fouled up testing that feature :( I'll try to fix it soon. Probably by checking for these arguments before attempting to use GetOpt. dave From dave at badgers-in-foil.co.uk Thu Sep 2 15:53:59 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Thu, 2 Sep 2004 15:53:59 +0000 Subject: [cvsspam-devel] [BUG] Long line problem / corrupted HTML Message-ID: <20040902155359.GA24756@vhost.badgers-in-foil.co.uk> On the off-chance that someone else is seeing this problem... CVSspam includes code to limit the visible length of lines in diff output. There is no limit, however, on the length of lines in the HTML source of messages. There are several spots where a very long line of HTML can get generated; in particular, deeply-nested paths with links to ViewCVS, etc. I've received some messages lately where the HTML has been corrupted, likely because line lengths are exceeding specified limits (http://ftp.rfc-editor.org/in-notes/rfc2822.txt), "2.1.1. Line Length Limits There are two limits that this standard places on the number of characters in a line. Each line of characters MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF." One of our mailservers enforces this limit, long lines being broken at about character 989, with an exclamation point being added at the new end of the line. Other mailservers may behave differently. If this forcible line-breaking happens in the middle of an HTML tag, the formatting can become severely muddled. If you see broken formatting, or links to ViewCVS that include an unexpected '!', this bug is probably the cause. The 'proper' way to fix this is probably to use 'quoted printable' encoding for CVSspam message bodies, but in the short term, hacking extra line-breaks into the generated HTML will avoid the issue in most cases. With luck, I'll get around to that for the next release. dave From skoehler at upb.de Thu Sep 9 19:07:59 2004 From: skoehler at upb.de (=?ISO-8859-15?Q?Sven_K=F6hler?=) Date: Thu, 09 Sep 2004 21:07:59 +0200 Subject: [cvsspam-devel] RFE and Gentoo-ebuild Message-ID: <4140AA0F.3050407@upb.de> Hi, your may like to hear, that i wrote an ebuild for Gentoo Linux that installs cvsspam: http://bugs.gentoo.org/show_bug.cgi?id=63463 You may link there on the cvsspam-homepage if you like. The other thing is, that i'd like to request an enhancement. I'm not that much into ruby, so i can't easily write a patch myself but i'd try if you point me at the right places in the source. It would greatly decrease the size of the CVS-mails, if cvsspam wouldn't include the diffs for new and deleted files. Users might want to have two new options for that in the cvsspam.conf-file. Thx Sven From javaswf-yahoo-group at badgers-in-foil.co.uk Fri Sep 10 10:44:49 2004 From: javaswf-yahoo-group at badgers-in-foil.co.uk (David Holroyd) Date: Fri, 10 Sep 2004 10:44:49 +0000 Subject: [cvsspam-devel] RFE and Gentoo-ebuild In-Reply-To: <4140AA0F.3050407@upb.de> References: <4140AA0F.3050407@upb.de> Message-ID: <20040910104448.GB18645@vhost.badgers-in-foil.co.uk> Hello! On Thu, Sep 09, 2004 at 09:07:59PM +0200, Sven K?hler wrote: > your may like to hear, that i wrote an ebuild for Gentoo Linux that > installs cvsspam: > http://bugs.gentoo.org/show_bug.cgi?id=63463 > > You may link there on the cvsspam-homepage if you like. Many thanks! But; I think you've been beaten to it... http://www.gentoo-portage.com/browse-program.php?program=8340 I like your package description better. The joke about 'flagging mails as spam' on the CVSspam home page wasn't intended to go this far. > The other thing is, that i'd like to request an enhancement. I'm not > that much into ruby, so i can't easily write a patch myself but i'd try > if you point me at the right places in the source. It would greatly > decrease the size of the CVS-mails, if cvsspam wouldn't include the > diffs for new and deleted files. Users might want to have two new > options for that in the cvsspam.conf-file. Well, you'll be pleased to know that suppressing output for removed files is already possible. Add this to your cvsspam.conf: $no_removed_file_diff = true I've noted the need for '$no_added_file_diff' in the TODO list. thanks, dave From skoehler at upb.de Fri Sep 10 10:55:28 2004 From: skoehler at upb.de (=?ISO-8859-1?Q?Sven_K=F6hler?=) Date: Fri, 10 Sep 2004 12:55:28 +0200 Subject: [cvsspam-devel] RFE and Gentoo-ebuild In-Reply-To: <20040910104448.GB18645@vhost.badgers-in-foil.co.uk> References: <4140AA0F.3050407@upb.de> <20040910104448.GB18645@vhost.badgers-in-foil.co.uk> Message-ID: <41418820.6010603@upb.de> >>your may like to hear, that i wrote an ebuild for Gentoo Linux that >>installs cvsspam: >>http://bugs.gentoo.org/show_bug.cgi?id=63463 > > Many thanks! But; I think you've been beaten to it... > > http://www.gentoo-portage.com/browse-program.php?program=8340 Oh, i didn't know that site yet. > I like your package description better. The joke about 'flagging > mails as spam' on the CVSspam home page wasn't intended to go this far. My ebuild ebuild might be added to the official portage some day, since i posted it to bugzilla. So change it as long as you can ;-) (for example the installation-path /opt/cvsspam might not be what people expect, what would you suggest?) >>The other thing is, that i'd like to request an enhancement. I'm not >>that much into ruby, so i can't easily write a patch myself but i'd try >>if you point me at the right places in the source. It would greatly >>decrease the size of the CVS-mails, if cvsspam wouldn't include the >>diffs for new and deleted files. Users might want to have two new >>options for that in the cvsspam.conf-file. > > Well, you'll be pleased to know that suppressing output for removed > files is already possible. Add this to your cvsspam.conf: > > $no_removed_file_diff = true Oops, should have better looked into cvsspam.conf, shouldn't i? Was it already there in 0.2.9? > I've noted the need for '$no_added_file_diff' in the TODO list. Thx. From skoehler at upb.de Fri Sep 10 12:35:34 2004 From: skoehler at upb.de (=?ISO-8859-1?Q?Sven_K=F6hler?=) Date: Fri, 10 Sep 2004 14:35:34 +0200 Subject: [cvsspam-devel] RFE and Gentoo-ebuild In-Reply-To: <41418820.6010603@upb.de> References: <4140AA0F.3050407@upb.de> <20040910104448.GB18645@vhost.badgers-in-foil.co.uk> <41418820.6010603@upb.de> Message-ID: <41419F96.4040604@upb.de> >> Many thanks! But; I think you've been beaten to it... >> >> http://www.gentoo-portage.com/browse-program.php?program=8340 > > > Oh, i didn't know that site yet. Oh, that site is about the official portage. >> I like your package description better. The joke about 'flagging >> mails as spam' on the CVSspam home page wasn't intended to go this far. > > My ebuild ebuild might be added to the official portage some day, since > i posted it to bugzilla. So change it as long as you can ;-) > (for example the installation-path /opt/cvsspam might not be what people > expect, what would you suggest?) Hmm, what do you like better? cvsspam's *.rb files in /opt/cvsspam, or in /bin ? i don't like them in /bin since cvsspam's files don't really blong into the PATH. From dave at badgers-in-foil.co.uk Fri Sep 10 14:11:30 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Fri, 10 Sep 2004 14:11:30 +0000 Subject: [cvsspam-devel] RFE and Gentoo-ebuild In-Reply-To: <41419F96.4040604@upb.de> References: <4140AA0F.3050407@upb.de> <20040910104448.GB18645@vhost.badgers-in-foil.co.uk> <41418820.6010603@upb.de> <41419F96.4040604@upb.de> Message-ID: <20040910141130.GA22540@vhost.badgers-in-foil.co.uk> On Fri, Sep 10, 2004 at 02:35:34PM +0200, Sven K?hler wrote: > Hmm, what do you like better? cvsspam's *.rb files in /opt/cvsspam, or > in /bin ? i don't like them in /bin since cvsspam's files don't really > blong into the PATH. CVSspam files certainly shouldn't be in /bin. I think that I'd put the files in /usr/lib/cvsspam/, but you should probably let Gentoo policy guide you (or the FHS[1], if Gentoo doesn't provide a policy). [1] http://www.pathname.com/fhs/pub/fhs-2.3.html dave From skoehler at upb.de Sat Sep 11 13:11:55 2004 From: skoehler at upb.de (=?ISO-8859-15?Q?Sven_K=F6hler?=) Date: Sat, 11 Sep 2004 15:11:55 +0200 Subject: [cvsspam-devel] Suggestion: reading conf-files in /etc _and_ CVSROOT Message-ID: <4142F99B.5000807@upb.de> Hi, cvsspam's current strategy is, to test if $CVSROOT/CVSROOT/cvsspam.conf exists, and to only load /etc/cvsspam/cvsspam.conf if the other file didn't exists. How about always reading /etc/cvsspam/cvsspam.conf and than reading $CVSROOT/CVSROOT/cvsspam.conf (or whatever config-file was specified on the command line)? CVSROOT/cvsspam.conf would than just override settings from /etc/cvsspam.conf. That might be quite useful. For example root can setup the correct sendmail-path or SMTP-server in /etc/cvsspam.conf and the "users" may use that value by simply not overriding it in CVSROOT/cvsspam.conf. Thx Sven From dave at badgers-in-foil.co.uk Mon Sep 13 01:00:33 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Mon, 13 Sep 2004 01:00:33 +0000 Subject: [cvsspam-devel] Suggestion: reading conf-files in /etc _and_ CVSROOT In-Reply-To: <4142F99B.5000807@upb.de> References: <4142F99B.5000807@upb.de> Message-ID: <20040913010033.GB4750@vhost.badgers-in-foil.co.uk> On Sat, Sep 11, 2004 at 03:11:55PM +0200, Sven K?hler wrote: > cvsspam's current strategy is, to test if $CVSROOT/CVSROOT/cvsspam.conf > exists, and to only load /etc/cvsspam/cvsspam.conf if the other file > didn't exists. > > How about always reading /etc/cvsspam/cvsspam.conf and than reading > $CVSROOT/CVSROOT/cvsspam.conf (or whatever config-file was specified on > the command line)? CVSROOT/cvsspam.conf would than just override > settings from /etc/cvsspam.conf. That might be quite useful. For example > root can setup the correct sendmail-path or SMTP-server in > /etc/cvsspam.conf and the "users" may use that value by simply not > overriding it in CVSROOT/cvsspam.conf. Good idea. I'll look into making that change. thanks, dave From skoehler at upb.de Mon Sep 13 02:29:29 2004 From: skoehler at upb.de (=?ISO-8859-1?Q?Sven_K=F6hler?=) Date: Mon, 13 Sep 2004 04:29:29 +0200 Subject: [cvsspam-devel] RFE and Gentoo-ebuild In-Reply-To: <20040910104448.GB18645@vhost.badgers-in-foil.co.uk> References: <4140AA0F.3050407@upb.de> <20040910104448.GB18645@vhost.badgers-in-foil.co.uk> Message-ID: <41450609.9010007@upb.de> > Well, you'll be pleased to know that suppressing output for removed > files is already possible. Add this to your cvsspam.conf: > > $no_removed_file_diff = true Does this already work in 0.2.10? Today i got a mail with a diff for a removed file. In the listing at the top of the mail, the file wasn't linked, but there was a diff for that file at the end of the mail. From dave at badgers-in-foil.co.uk Mon Sep 13 09:27:22 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Mon, 13 Sep 2004 09:27:22 +0000 Subject: [cvsspam-devel] RFE and Gentoo-ebuild In-Reply-To: <41450609.9010007@upb.de> References: <4140AA0F.3050407@upb.de> <20040910104448.GB18645@vhost.badgers-in-foil.co.uk> <41450609.9010007@upb.de> Message-ID: <20040913092722.GA12301@vhost.badgers-in-foil.co.uk> On Mon, Sep 13, 2004 at 04:29:29AM +0200, Sven K?hler wrote: > >Well, you'll be pleased to know that suppressing output for removed > >files is already possible. Add this to your cvsspam.conf: > > > > $no_removed_file_diff = true > > Does this already work in 0.2.10? > Today i got a mail with a diff for a removed file. In the listing at the > top of the mail, the file wasn't linked, but there was a diff for that > file at the end of the mail. Oh -- that would be a newly-added bug. :( I'll try to get around to fixing this soon. Thanks for letting me know about the problem, dave From dave at badgers-in-foil.co.uk Tue Sep 14 23:10:14 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 14 Sep 2004 23:10:14 +0000 Subject: [cvsspam-devel] RFE and Gentoo-ebuild In-Reply-To: <41450609.9010007@upb.de> References: <4140AA0F.3050407@upb.de> <20040910104448.GB18645@vhost.badgers-in-foil.co.uk> <41450609.9010007@upb.de> Message-ID: <20040914231013.GA10567@vhost.badgers-in-foil.co.uk> --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 13, 2004 at 04:29:29AM +0200, Sven K?hler wrote: > >Well, you'll be pleased to know that suppressing output for removed > >files is already possible. Add this to your cvsspam.conf: > > > > $no_removed_file_diff = true > > Does this already work in 0.2.10? > Today i got a mail with a diff for a removed file. In the listing at the > top of the mail, the file wasn't linked, but there was a diff for that > file at the end of the mail. Does the attached patch make this existing config option work for you? dave --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="no_removed_file_diff-patch.diff" Index: cvsspam.rb =================================================================== RCS file: /var/lib/cvs/cvsspam/cvsspam.rb,v retrieving revision 1.51 diff -u -r1.51 cvsspam.rb --- cvsspam.rb 24 Aug 2004 20:36:50 -0000 1.51 +++ cvsspam.rb 14 Sep 2004 23:01:58 -0000 @@ -362,6 +362,10 @@ def has_diff? @has_diff end + + def wants_diff_in_mail? + !removal? && $no_removed_file_diff + end end @@ -883,17 +887,19 @@ when 2 @lookahead = line when 3 - println($fileHeaderHtml) - @colour.start_output(@diffline, @lookahead, line) - else - unless $file.removal? && $no_removed_file_diff - @stats.consume(line) + if $file.wants_diff_in_mail? + println($fileHeaderHtml) + @colour.start_output(@diffline, @lookahead, line) end - if @stats.diffLines < $maxLinesPerDiff - @colour.consume(line) - elsif @stats.diffLines == $maxLinesPerDiff - @colour.consume(line) - @colour.teardown + else + @stats.consume(line) + if $file.wants_diff_in_mail? + if @stats.diffLines < $maxLinesPerDiff + @colour.consume(line) + elsif @stats.diffLines == $maxLinesPerDiff + @colour.consume(line) + @colour.teardown + end end end end @@ -904,7 +910,7 @@ elsif @lookahead =~ /Binary files .* and .* differ/ $file.isBinary = true else - unless $file.removal? && $no_removed_file_diff + if $file.wants_diff_in_mail? if @stats.diffLines > $maxLinesPerDiff println("") println("[truncated at #{$maxLinesPerDiff} lines; #{@stats.diffLines-$maxLinesPerDiff} more skipped]") --XsQoSWH+UP9D9v3l-- From skoehler at upb.de Tue Sep 14 23:20:56 2004 From: skoehler at upb.de (Sven =?ISO-8859-1?Q?K=F6hler?=) Date: Wed, 15 Sep 2004 01:20:56 +0200 Subject: [cvsspam-devel] RFE and Gentoo-ebuild In-Reply-To: <20040914231013.GA10567@vhost.badgers-in-foil.co.uk> References: <4140AA0F.3050407@upb.de> <20040910104448.GB18645@vhost.badgers-in-foil.co.uk> <41450609.9010007@upb.de> <20040914231013.GA10567@vhost.badgers-in-foil.co.uk> Message-ID: <1095204056.7790.0.camel@erni.sven.home-net> > > > $no_removed_file_diff = true > > > > Does this already work in 0.2.10? > > Today i got a mail with a diff for a removed file. In the listing at the > > top of the mail, the file wasn't linked, but there was a diff for that > > file at the end of the mail. > > Does the attached patch make this existing config option work for you? Yes. It works now. From dave at badgers-in-foil.co.uk Tue Sep 14 23:43:16 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 14 Sep 2004 23:43:16 +0000 Subject: [cvsspam-devel] RFE and Gentoo-ebuild In-Reply-To: <1095204056.7790.0.camel@erni.sven.home-net> References: <4140AA0F.3050407@upb.de> <20040910104448.GB18645@vhost.badgers-in-foil.co.uk> <41450609.9010007@upb.de> <20040914231013.GA10567@vhost.badgers-in-foil.co.uk> <1095204056.7790.0.camel@erni.sven.home-net> Message-ID: <20040914234316.GA11225@vhost.badgers-in-foil.co.uk> --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Sep 15, 2004 at 01:20:56AM +0200, Sven K?hler wrote: > > > > $no_removed_file_diff = true > > > > > > Does this already work in 0.2.10? > > > Today i got a mail with a diff for a removed file. In the listing at the > > > top of the mail, the file wasn't linked, but there was a diff for that > > > file at the end of the mail. > > > > Does the attached patch make this existing config option work for you? > > Yes. It works now. This patch, to be applied on top of the last one, should add a new $no_added_file_diff config option. Comments? ta, dave --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="no_added_file_diff-patch.diff" Index: cvsspam.rb =================================================================== RCS file: /var/lib/cvs/cvsspam/cvsspam.rb,v retrieving revision 1.53 diff -u -r1.53 cvsspam.rb --- cvsspam.rb 14 Sep 2004 23:26:46 -0000 1.53 +++ cvsspam.rb 14 Sep 2004 23:37:19 -0000 @@ -364,7 +364,7 @@ end def wants_diff_in_mail? - !removal? && $no_removed_file_diff + !(removal? && $no_removed_file_diff || addition? && $no_added_file_diff) end end @@ -1028,6 +1028,7 @@ $recipients = Array.new $sendmail_prog = "/usr/sbin/sendmail" $no_removed_file_diff = false +$no_added_file_diff = false $task_keywords = ['TODO', 'FIXME'] $bugzillaURL = nil $jiraURL = nil --0OAP2g/MAC+5xKAE-- From skoehler at upb.de Tue Sep 14 23:59:21 2004 From: skoehler at upb.de (Sven =?ISO-8859-1?Q?K=F6hler?=) Date: Wed, 15 Sep 2004 01:59:21 +0200 Subject: [cvsspam-devel] RFE and Gentoo-ebuild In-Reply-To: <20040914234316.GA11225@vhost.badgers-in-foil.co.uk> References: <4140AA0F.3050407@upb.de> <20040910104448.GB18645@vhost.badgers-in-foil.co.uk> <41450609.9010007@upb.de> <20040914231013.GA10567@vhost.badgers-in-foil.co.uk> <1095204056.7790.0.camel@erni.sven.home-net> <20040914234316.GA11225@vhost.badgers-in-foil.co.uk> Message-ID: <1095206361.20667.6.camel@erni.sven.home-net> > This patch, to be applied on top of the last one, should add a new > $no_added_file_diff config option. Thx! It works, but there is one "semantic" trouble: if there has been a file, i remove it, commit, and than add a file with the same name again, cvsspam still mails a diff, since the file isn't "new" to the repository. Is it possible for CVSspam to recognize cases in which the file has been "readded" ? On the other hand it does makes sense to mail a diff in such cases. You could make a third option for that case, or simply keep it the way it is, and just document this in the cvsspam.conf. From dave at badgers-in-foil.co.uk Wed Sep 15 07:54:07 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Wed, 15 Sep 2004 07:54:07 +0000 Subject: [cvsspam-devel] RFE and Gentoo-ebuild In-Reply-To: <1095206361.20667.6.camel@erni.sven.home-net> References: <4140AA0F.3050407@upb.de> <20040910104448.GB18645@vhost.badgers-in-foil.co.uk> <41450609.9010007@upb.de> <20040914231013.GA10567@vhost.badgers-in-foil.co.uk> <1095204056.7790.0.camel@erni.sven.home-net> <20040914234316.GA11225@vhost.badgers-in-foil.co.uk> <1095206361.20667.6.camel@erni.sven.home-net> Message-ID: <20040915075407.GA18123@vhost.badgers-in-foil.co.uk> On Wed, Sep 15, 2004 at 01:59:21AM +0200, Sven K?hler wrote: > > This patch, to be applied on top of the last one, should add a new > > $no_added_file_diff config option. > > Thx! It works, but there is one "semantic" trouble: > > if there has been a file, i remove it, commit, and than add a file with > the same name again, cvsspam still mails a diff, since the file isn't > "new" to the repository. Is it possible for CVSspam to recognize cases > in which the file has been "readded" ? On the other hand it does makes > sense to mail a diff in such cases. > > You could make a third option for that case, or simply keep it the way > it is, and just document this in the cvsspam.conf. It's a long-standing bug in CVSspam. It may be possible to further extend the commitinfo hook to explicitly get the status of files before they're commited, or possibly to get the extra info with 'cvs log/rlog'. It's on the TODO list. dave From dave at badgers-in-foil.co.uk Thu Sep 16 00:33:06 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Thu, 16 Sep 2004 00:33:06 +0000 Subject: [cvsspam-devel] Feature request: --nodiff option? In-Reply-To: <40C87719.4040401@rossvideo.com> References: <40C87719.4040401@rossvideo.com> Message-ID: <20040916003306.GA31006@vhost.badgers-in-foil.co.uk> --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 10, 2004 at 10:58:33AM -0400, Ralph Siemsen wrote: [...] > Unfortunately I don't know ruby so I thought it better to ask rather > than break things: would it be possible to add an option to suppress the > coloured diff portion of the output? Eg. I would just like to see the > summary, log message (the links to viewcvs suffice to give diffs for > those who need it). The attached patch applies on top of the two from the recent thread 'RFE and Gentoo-ebuild', and should allow a new $no_diff option in cvsspam.conf. Tell me if you need a patch against some released version of CVSspam to let you to test this. dave --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="no_diff-patch.diff" Index: cvsspam.rb =================================================================== RCS file: /var/lib/cvs/cvsspam/cvsspam.rb,v retrieving revision 1.54 diff -u -r1.54 cvsspam.rb --- cvsspam.rb 16 Sep 2004 00:10:00 -0000 1.54 +++ cvsspam.rb 16 Sep 2004 00:11:35 -0000 @@ -364,7 +364,9 @@ end def wants_diff_in_mail? - !(removal? && $no_removed_file_diff || addition? && $no_added_file_diff) + !($no_diff || + removal? && $no_removed_file_diff || + addition? && $no_added_file_diff) end end @@ -1029,6 +1031,7 @@ $sendmail_prog = "/usr/sbin/sendmail" $no_removed_file_diff = false $no_added_file_diff = false +$no_diff = false $task_keywords = ['TODO', 'FIXME'] $bugzillaURL = nil $jiraURL = nil --FCuugMFkClbJLl1L-- From Sebastian.Gonzalez at info.ucl.ac.be Mon Sep 20 10:46:34 2004 From: Sebastian.Gonzalez at info.ucl.ac.be (=?ISO-8859-1?Q?Sebasti=E1n_Gonz=E1lez?=) Date: Mon, 20 Sep 2004 12:46:34 +0200 Subject: [cvsspam-devel] encoding problem? Message-ID: <570AE588-0AF2-11D9-B212-0003935AE0E4@info.ucl.ac.be> --Apple-Mail-15--741606297 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hello, Today, upon making a CVS commit where the developer's comment had many=20= lines, CVSspam generated the invalid mail I'm sending attached. The=20 headers generated by CVSspam (MIME-Version, Content-Type, etc.) come=20 after all the rest (generated by the mail server), with some (invalid)=20= text separating the two groups of headers. This text corresponds to the=20= second and third lines of the commit log. Relevant facts: -The CVS client is Eclipse 3.1 running on Mac OS 10.3, it uses the=20 'ext' method through an SSH tunnel. -The CVS repository is on a Solaris machine. CVS's version on that=20 machine is 1.11. Ruby is 1.8.1. -CVSspam is configured to use SMTP directly. It seems to me that CVSspam is confused by the encoding of newline=20 characters in Mac OS, which is different from Solaris (and all the=20 other unices). Thanks, Sebasti=E1n Gonz=E1lez --Apple-Mail-15--741606297 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; x-unix-mode=0644; name="cvsspam.msg.txt" Content-Disposition: attachment; filename=cvsspam.msg.txt =46rom sgm@info.ucl.ac.be Fri Sep 17 12:47:00 2004 Return-Path: Received: from localhost.localdomain (bismarck [130.104.229.58]) by info.ucl.ac.be (8.12.11/8.12.11) with ESMTP id = i8H9l5cN020775; Fri, 17 Sep 2004 11:47:05 +0200 (MET DST) Message-Id: <200409170947.i8H9l5cN020775@info.ucl.ac.be> To: sgm@info.ucl.ac.be, km@info.ucl.ac.be, nv@info.ucl.ac.be, xmartin@info.ucl.ac.be From: sgm@info.ucl.ac.be Date: Fri, 17 Sep 2004 09:47:05 +0000 Subject: [CVS SINF1151] Added class LecteurTexte, which frees = Bibliotheque from I/O-specific functionality. X-INGI-MailScanner-Information: Please contact the ISP for more = information X-INGI-MailScanner: Found to be clean Content-Type: text Content-Length: 21959 Added fields to Ouvrage setters so that LecteurTexte can fill in the read info. Minor changes to othe MIME-Version: 1.0 Content-Type: text/html X-Mailer: CVSspam 0.2.10 = +72
Commit in = SINF1151 on MAIN
LecteurTexte.java+111added= 1.1
InterfaceClient.java-41.1 -> 1.2
InterfaceAdmin.java-41.1 -> 1.2
Bibliotheque.java+4-1521.3 -> 1.4
Bibliothecaire.java-171.3 -> 1.4
Ouvrage.java-101.2 -> = 1.3
Main.java+12-211.1 -> 1.2
+199-208
1 added + 6 modified, total 7 files
Added class LecteurTexte, which frees Bibliotheque from I/O-specific =
functionality.
Added fields to Ouvrage setters so that LecteurTexte can fill in the =
read info.
Minor changes to other classes.

SINF1151
LecteurTexte.java= added at 1.1
diff -N LecteurTexte.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ LecteurTexte.java	17 Sep 2004 09:47:03 -0000	1.1
@@ -0,0 +1,111 @@
+
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @auteur Kim Mens
+ * @auteur Sebasti=87n Gonz=87lez
+ * @creation Sep 13, 2004 11:43:03 AM
+ *=20
+ * Lit un fichier de texte avec donn=8Ees bibliographiques et construit =
des objets
+ * representant ces donn=8Ees.
+ */
+public class LecteurTexte {
+
+	// fichier texte subyacent
+	private BufferedReader fichier;
+
+	/**
+	 * =20
+	 */
+	public LecteurTexte(String nomFichier) {
+		System.out.println("Ouverture du fichier " + nomFichier =
+ ".");
+		try {
+			fichier =3D new BufferedReader(new =
FileReader(nomFichier));
+		} catch (FileNotFoundException e) {
+			System.out.println("Le fichier avec nom " + =
nomFichier
+					+ " n'a pas =8Et=8E trouv=8E.");
+			System.exit(1);
+		}
+	}
+
+	/**
+	 *=20
+	 * @return
+	 */
+	public List listeCompl=8FteOuvrages() {
+		List liste =3D new LinkedList();
+		while(true) {
+			Ouvrage ouvrage =3D lisOuvrage();
+			if(ouvrage =3D=3D null)
+				break;
+			liste.add(ouvrage);
+
+			System.out.println("---------------");
+			ouvrage.afficher(System.out);
+		}
+		System.out.println("---------------");
+		return liste;
+	}
+
+	/**
+	 * =20
+	 */
+	private Ouvrage lisOuvrage() {
+
+		try {
+			String ligne;
+			do {
+				ligne =3D fichier.readLine();
+				// Arretez sans succes s'il ne restent =
plus de lignes
+				if(ligne =3D=3D null)
+					return null;
+				// Ignorez les lignez vides
+			} while(ligne.equals(""));
+
+			Ouvrage ouvrage =3D new Ouvrage();
+
+			// Lisez tous les lignes non-vides qui suivent
+			do {
+				if (ligne.startsWith("%A"))
+					=
ouvrage.ajouterAuteur(ligne.substring(3));
+				if (ligne.startsWith("%T"))
+					=
ouvrage.changerTitre(ligne.substring(3));
+				if (ligne.startsWith("%S"))
+					=
ouvrage.changerS=8Erie(ligne.substring(3));
+				if (ligne.startsWith("%D"))
+					=
ouvrage.changerDatePub(ligne.substring(3));
+				if (ligne.startsWith("%I"))
+					=
ouvrage.changerEditeur(ligne.substring(3));
+				if (ligne.startsWith("%W"))
+					=
ouvrage.changerCote(ligne.substring(3));
+				/* il y en a plus de types de champs,
+				 	mais on les ignore pour le =
moment */
+			=09
+				ligne =3D fichier.readLine();
+			=09
+			} while(ligne !=3D null && =
ligne.length() > 0);
+		=09
+			return ouvrage;
+
+		} catch (IOException e) {
+			System.out.println("Erreur pendant la lecture du =
fichier");
+			System.exit(1);
+		}
+		return null;
+	}
+
+	/**
+	 * exporte les descriptions des livres qui se trouvent en =
m=8Emoire vers un
+	 * fichier avec un nom donn=8E; renvoie false en cas d'erreurs =
lors de la
+	 * cr=8Eation ou l'=8Ecriture du fichier
+	 */
+	public boolean exporte(String nomFichier) {
+		// To be implemented
+		return false;
+	}
+}
\ No newline at end of file

SINF1151
InterfaceClient.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- InterfaceClient.java	14 Sep 2004 12:19:26 -0000	1.1
+++ InterfaceClient.java	17 Sep 2004 09:47:03 -0000	1.2
@@ -11,10 +11,6 @@
 		=
utilisateur =3D new Emprunteur();
 	}
 =09
-	public static void =
main(String[] args) {
-		new InterfaceClient().ouvre(new Bibliothecaire());
-	}
-
 	/**
 	 * Ouvre l'interface utilisateur client qui permet un
 	 * client normal d'int=8Eragir avec l'application BISC-8.

SINF1151
InterfaceAdmin.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- InterfaceAdmin.java	14 Sep 2004 12:19:25 -0000	1.1
+++ InterfaceAdmin.java	17 Sep 2004 09:47:03 -0000	1.2
@@ -7,10 +7,6 @@
  */
 public class InterfaceAdmin extends InterfaceUtilisateur {
=20
-	public static void =
main(String[] args) {
-		new InterfaceAdmin().ouvre(Main.getBibliotheque());
-	}
-
 	/**
 	 * Ouvre l'interface administrateur qui permet au
 	 * biblioth=8Ecaire d'int=8Eragir avec l'application BISC-8.

SINF1151
Bibliotheque.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- Bibliotheque.java	15 Sep 2004 10:06:17 -0000	1.3
+++ Bibliotheque.java	17 Sep 2004 09:47:03 -0000	1.4
@@ -1,7 +1,3 @@
-import =
java.io.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
 import java.util.LinkedList;
 import java.util.List;
=20
@@ -13,167 +9,22 @@
  */
 public class Bibliotheque {
=20
-	private LinkedList =
livres;
-	private String nomFichier =3D null; =09
-
-	public Bibliotheque() {
-		super();
-	}
+	private List livres;
=20
 	/**
-	 * @param string
 	 */
 	public Bibliotheque(String nomFichier) {
 		System.out.println("Initialiser la biblioth=8Fque.");
-		this.nomFichier =
=3D nomFichier;
-		this.importe();
-	}
-
-	public static void main(String[] args) {
-	}
-
-	private String getNomFichier() {
-		if (nomFichier !=3D null) {
-			this.setNomFichier(this.lisNomFichier());
-		};
-		return nomFichier;
-	}
-=09
-	public void setNomFichier(String nomFichier) {
-		this.nomFichier =3D nomFichier;
+		LecteurTexte =
sourceDonnes =3D new LecteurTexte(nomFichier);
+		livres =3D sourceDonnes.listeCompl=8FteOuvrages();
 	}
=20
-	private String =
lisNomFichier() {
-		System.out.println("Quel est le nom du fichier contenant =
les donn=8Ees de la biblioth=8Fque?");
-		System.out.println("Bibliotheque>>lisNomFichier() =
TO BE IMPLEMENTED");
-		return null;
-	}
-=09
 	// renvoie une liste de =
livres dont le nom d'un de ses
 	// auteurs contient partieNom
 	public List recherche(String partieNom) {
 		// To be implemented
 		return new LinkedList();	=09
 	}
-=09
-	/**
-	 * @param nomFichier est le nom d'un fichier, qui se trouve dans
-	 *   le r=8Epertoire actuel
-	 * @post=20
-	 * @return=20
-	 *  true est renvoy=8E si le fichier a =8Et=8E lu et les donn=8Ees=
 ont
-	 *   =8Et=8E mis dans la structure de donn=8Ees interne
-	 * 	false est renvoy=8E si le fichier n'a pas =8Et=8E =
trouv=8E, s'il y avait un
-	 *   probl=8Fme pendant la lecture du fichier, ou si le fichier =
n'a pas pu =90tre
-	 *   fermer.
-	 */
-	public boolean importe() {
-		System.out.println("Importer les donn=8Ees.");
-		// Avant de lire un fichier il faut d'abord ouvrir ce =
fichier.
-		BufferedReader fichier =3D ouvre();
-		// Lecture du fichier
-		boolean ok =3D lis(fichier);
-		// N'oubliez pas de fermer le fichier apr=8Fs lecture.
-		return ferme(fichier);
-	}
-
-	/**
-	 * @param nomFichier est le nom d'un fichier, qui se trouve dans
-	 *   le r=8Epertoire actuel
-	 * @post=20
-	 * @return=20
-	 *  soit un FileReader pour le fichier avec le nom donn=8E
-	 * 	soit null si le fichier n'a pas =8Et=8E trouv=8E
-	 * */
-	private BufferedReader ouvre() {
-		FileReader fichier;
-		System.out.println("Ouverture du fichier " + nomFichier =
+ ".");
-		try {
-			fichier =3D new FileReader(nomFichier);
-		} catch (FileNotFoundException e) {
-			System.out.println("Le fichier avec nom " + =
nomFichier + " n'a pas =8Et=8E trouv=8E.");
-			return null;
-		}
-		return new BufferedReader(fichier);
-	}=09
-
-	/**
-	 * @param fichier est un "lecteur" d'un fichier nomm=8E =
nomFichier, ou est null
-	 *   quand un fichier avec ce nom n'a pas pu =90tre ouvert
-	 * @post=20
-	 * @return=20
-	 *  true est renvoy=8E si le fichier a =8Et=8E ferm=8E =
correctement,
-	 *  sinon false est renvoy=8E
-	 * */
-	private boolean ferme(BufferedReader fichier) {
-		System.out.println("Fermeture du fichier " + nomFichier =
+ ".");
-		// N=8Ecessaire pour g=8Fre le cas ou le fichier n'a =
jamais =8Et=8E ouvert
-		// et n'existe donc pas.
-		if (fichier =3D=3D null) { return false; };
-		// Fermeture du fichier, si possible
-		try {
-			fichier.close();
-		} catch (IOException e1) {
-			System.out.println("Le fichier avec nom " + =
nomFichier + " n'a pas pu =90tre fermer.");
-			return false;
-		}
-		System.out.println();
-		return true;
-	}=09
-
-	private boolean lis(BufferedReader fichier) {
-		System.out.print("Lecture du fichier " + nomFichier + =
".");
-		// N=8Ecessaire pour g=8Fre le cas ou le fichier n'a =
jamais =8Et=8E ouvert
-		// et n'existe donc pas.
-		if (fichier =3D=3D null) {
-			return false;
-		};
-		// Lecture du fichier, si possible
-		while (lisOuvrage(fichier));
-		System.out.println();
-		return true;
-	}
-
-	/**
-	 * @param fichier
-	 */
-	private boolean lisOuvrage(BufferedReader fichier) {
-		try {
-//			System.out.print(".");
-			=
System.out.println("**********************************************");
-			String ligne =3D fichier.readLine();
-			// Arretez sans succes s'il ne restent plus de =
lignes
-			if (ligne =3D=3D null)
-				return false;
-			// Ignorez les lignez vides
-			while (ligne !=3D null & ligne.equals("")) {
-				ligne =3D fichier.readLine();
-			};
-			// Lisez tous les lignes non-vides qui suivent
-			while (ligne !=3D null && =
!ligne.equals("")) {
-				if (ligne.startsWith("%A"))
-				  System.out.println(ligne);
-				ligne =3D fichier.readLine();
-			}
-		} catch (IOException e) {
-			System.out.println(
-				"Erreur pendant la lecture du fichier =
avec nom "
-					+ nomFichier
-					+ ".");
-			return false;
-		}
-		return true;
-	}
-
-	/**
-	 * exporte les descriptions des livres qui se trouvent en =
m=8Emoire
-	 * vers un fichier avec un nom donn=8E; renvoie false en cas =
d'erreurs
-	 * lors de la cr=8Eation ou l'=8Ecriture du fichier=20
-	 */
-	public boolean exporte(String nomFichier) {
-		// To be implemented
-		return false;
-	}
=20
 	public void retourne(Exemplaire exemplaire) {
 		// To be implemented
@@ -199,6 +50,7 @@
 		// To be =
implemented
 		return new LinkedList();
 	}
+=09
 	private List =
livresEnRetard(Ouvrage livre) {
 		// To be implemented
 		return new LinkedList();

SINF1151
Bibliothecaire.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- Bibliothecaire.java	15 Sep 2004 10:06:17 -0000	1.3
+++ Bibliothecaire.java	17 Sep 2004 09:47:03 -0000	1.4
@@ -11,14 +11,6 @@
 public class =
Bibliothecaire extends Utilisateur {
=20
 	/**
-	 *=20
-	 */
-	public Bibliothecaire() {
-		super();
-		// TODO Auto-generated constructor stub
-	}
-
-	/**
 	 * @param biblio
 	 */
 	public Bibliothecaire(Bibliotheque biblio) {
@@ -32,15 +24,6 @@
 	public =
Bibliotheque getBibliotheque() {
 		return biblio;
 	}
-=09
-	public boolean lis(String nomFichier) {
-		biblio.setNomFichier(nomFichier);
-		return biblio.importe();
-	}
-=09
-	public boolean ecris(String nomFichier) {
-		return biblio.exporte(nomFichier);	=09
-	}
=20
 	public Exemplaire empruntePour(Ouvrage livre, Date de, Date a, =
Emprunteur client) {
 		// To be implemented

SINF1151
Ouvrage.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- Ouvrage.java	14 Sep 2004 14:33:35 -0000	1.2
+++ Ouvrage.java	17 Sep 2004 09:47:03 -0000	1.3
@@ -1,8 +1,13 @@
+import =
java.util.HashSet;
+import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Set;
+import java.io.PrintStream;
=20
 /**
- * @auteur kimmens
+ * @auteur Kim Mens
+ * @auteur Sebasti=87n Gonz=87lez
  * @creation Sep 14, 2004 =
11:15:10 AM
  *
  * Cette classe repr=8Esente un ouvrage, dont la biblioth=8Fque peut =
poss=8Eder
@@ -14,17 +19,75 @@
 public class Ouvrage {
=20
 	List livres =3D new LinkedList();
-	String referenceUnique;
+	String r=8Ef=8Erence;
+
+	// Donn=8Ees d'ouvrage
+	Set auteurs =3D new HashSet();
+	String titre;
+	String date;
+	String s=8Erie;
+	int nombrePages;
+	String =8Editeur;
+
+	public void changerCote(String cote) {
+		this.r=8Ef=8Erence =3D cote;
+	}
+=09
+	public void changerS=8Erie(String s=8Erie) {
+		this.s=8Erie =3D s=8Erie;
+	}
+
+	public void changerEditeur(String =8Editeur) {
+		this.=8Editeur =3D =8Editeur;
+	}
+
+	public void ajouterAuteur(String nom) {
+		auteurs.add(nom);
+	}
 =09
-	/**
-	 *=20
-	 */
-	public Ouvrage() {
-		super();
-		// TODO Auto-generated constructor stub
+	public void =
changerTitre(String titre) {
+		this.titre =3D titre;
 	}
=20
-	public static void =
main(String[] args) {
+	public void =
changerDatePub(String date) {
+		this.date =3D date;
+	}
+
+	public void changerNombrePages(int nombrePages) {
+		this.nombrePages =3D nombrePages;
+	}
+
+	public String toString() {
+		return "Ouvrage(cote: " + r=8Ef=8Erence + ")";
+	}
+=09
+	public void afficher(PrintStream out) {
+
+		if(titre !=3D null)
+			out.println("Titre: " + titre);
+	=09
+		Iterator iter =3D auteurs.iterator();
+		if(iter.hasNext()) {
+			out.print("Auteurs: ");
+			while(true) {
+				out.print(iter.next());
+				if(iter.hasNext())
+					out.print(", ");
+				else break;
+			}
+			out.println();
+		}
+
+		if(r=8Ef=8Erence !=3D null)
+			out.println("Cote: " + r=8Ef=8Erence);
+		if(date !=3D null)
+			out.println("Date: " + date);
+		if(=8Editeur !=3D null)
+			out.println("Editeur: " + =8Editeur);
+		if(s=8Erie !=3D null)
+			out.println("Series: " + s=8Erie);
+		if(nombrePages > 0)
+			out.println("N. pages: " + nombrePages);
 	}
 =09
 	public boolean recherche(String partieNom) {
@@ -36,5 +99,4 @@
 		// To be =
implemented
 		return false;
 	}
-
 }

SINF1151
Main.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- Main.java	14 Sep 2004 12:19:25 -0000	1.1
+++ Main.java	17 Sep 2004 09:47:03 -0000	1.2
@@ -1,5 +1,6 @@
 /**
- * @auteur kimmens
+ * @auteur Kim Mens
+ * @auteur Sebasti=87n Gonz=87lez
  * @creation Sep 13, 2004 =
10:45:40 AM
  *
  * Le but de cette classe Main est de lancer l'application BISC-8
@@ -10,31 +11,21 @@
=20
 	// Nom du fichier contenant les exemplaires des ouvrages dont
 	// la biblioth=8Fque poiss=8Fde.
-	static String nomFichier =
=3D "bib.txt";
-	// La biblioth=8Fque contenant tous ces exemplaires
-	static Bibliotheque biblio =3D new Bibliotheque(nomFichier);
-=09
-	// Les interfaces utilisateurs pour clients et administrateurs
-	private static InterfaceAdmin admin =3D new InterfaceAdmin();
-	private static InterfaceClient client =3D new InterfaceClient();
-
-	public Main() {
-	}
+	private static final =
String nomFichier =3D "bib_small.txt";
=20
 	public static void main(String[] args) {
-		Main.lance();
-	}
=20
-	public static =
Bibliotheque getBibliotheque() {
-		return biblio;
-	};
-=09
-	public static void lance() {
 		=
System.out.println("**************");
 		System.out.println("*** BISC-8 ***");
-		=
System.out.println("**************");
-	=09
+		=
System.out.println("**************\n");
+
+		// La biblioth=8Fque contenant tous ces exemplaires
+		Bibliotheque biblio =3D new Bibliotheque(nomFichier);
+
+		InterfaceAdmin admin =3D new InterfaceAdmin();
 		=
admin.ouvre(biblio);
-		=
client.ouvre(admin.getBibliothecaire());	=09
+	=09
+		InterfaceClient client =3D new InterfaceClient();
+		client.ouvre(admin.getBibliothecaire());
 	}
 }
CVSspam 0.2.10
--Apple-Mail-15--741606297 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed --Apple-Mail-15--741606297-- From dave at badgers-in-foil.co.uk Mon Sep 20 13:06:32 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Mon, 20 Sep 2004 13:06:32 +0000 Subject: [cvsspam-devel] encoding problem? In-Reply-To: <570AE588-0AF2-11D9-B212-0003935AE0E4@info.ucl.ac.be> References: <570AE588-0AF2-11D9-B212-0003935AE0E4@info.ucl.ac.be> Message-ID: <20040920130632.GA23464@vhost.badgers-in-foil.co.uk> --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 20, 2004 at 12:46:34PM +0200, Sebasti?n Gonz?lez wrote: > Hello, > > Today, upon making a CVS commit where the developer's comment had many > lines, CVSspam generated the invalid mail I'm sending attached. The > headers generated by CVSspam (MIME-Version, Content-Type, etc.) come > after all the rest (generated by the mail server), with some (invalid) > text separating the two groups of headers. This text corresponds to the > second and third lines of the commit log. > > Relevant facts: > -The CVS client is Eclipse 3.1 running on Mac OS 10.3, it uses the > 'ext' method through an SSH tunnel. > -The CVS repository is on a Solaris machine. CVS's version on that > machine is 1.11. Ruby is 1.8.1. > -CVSspam is configured to use SMTP directly. > > It seems to me that CVSspam is confused by the encoding of newline > characters in Mac OS, which is different from Solaris (and all the > other unices). Thanks for a very clear problem report. I can also reproduce this issue if I both: - Fake Mac-style end-of-line characters in the commit log - Use SMTP directly If CVSspam messages are sent via /usr/sbin/sendmail (which is an alias for Exim, on my system), it appears to fix things up for me, whereas an SMTP connection to localhost (actually the same copy of Exim) exhibits the issue you report. Please apply the attached patch to collect_diffs.rb. To test, make a cvs commit from the Mac client, supplying a multi-line log comment. ta! dave --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mac_commitlog_format-patch1.diff" Index: collect_diffs.rb =================================================================== RCS file: /var/lib/cvs/cvsspam/collect_diffs.rb,v retrieving revision 1.18 diff -u -r1.18 collect_diffs.rb --- collect_diffs.rb 22 Aug 2004 19:57:26 -0000 1.18 +++ collect_diffs.rb 20 Sep 2004 12:52:09 -0000 @@ -168,7 +168,18 @@ File.open("#{$datadir}/logfile", File::WRONLY|File::CREAT|File::APPEND) do |file| $stdin.each do |line| - file.puts "#> #{line}" + # remove any trailing whitespace; we don't want the split() below to + # produce empty trailing items due to '\r' at the end of the line + # (if input is 'DOS' style), + part.sub!(/\s*$/, "") + + # 'Mac' clients sending logs to a unix server may demote end-of-line with + # carriage-return, defeating the $stdin.each (above). We handle this + # case explicitly here, so that cvsspam.rb's Subject header generation + # doesn't break, + line.split(/\r/).each do |part| + file.puts "#> #{part}" + end end changes.each do |change| --liOOAslEiF7prFVr-- From Sebastian.Gonzalez at info.ucl.ac.be Mon Sep 20 15:13:39 2004 From: Sebastian.Gonzalez at info.ucl.ac.be (=?ISO-8859-1?Q?Sebasti=E1n_Gonz=E1lez?=) Date: Mon, 20 Sep 2004 17:13:39 +0200 Subject: [cvsspam-devel] encoding problem? In-Reply-To: <20040920130632.GA23464@vhost.badgers-in-foil.co.uk> References: <570AE588-0AF2-11D9-B212-0003935AE0E4@info.ucl.ac.be> <20040920130632.GA23464@vhost.badgers-in-foil.co.uk> Message-ID: On 20 Sep 2004, at 15:06, David Holroyd wrote: > Thanks for a very clear problem report. > > I can also reproduce this issue if I both: > - Fake Mac-style end-of-line characters in the commit log > - Use SMTP directly > > > If CVSspam messages are sent via /usr/sbin/sendmail (which is an alias > for Exim, on my system), it appears to fix things up for me, whereas = an > SMTP connection to localhost (actually the same copy of Exim) exhibits > the issue you report. > > > Please apply the attached patch to collect_diffs.rb. To test, make a > cvs commit from the Mac client, supplying a multi-line log comment. > > > ta! > dave > Hello Dave, Thanks a lot for the promptly answer and for the patch. I patched collect_diffs.rb, and tried it by committing with a=20 multiple-line comment. I got the following error: /usr/staff/sgm/var/cvs/CVSROOT/collect_diffs.rb:174:in `process_log':=20 undefined local variable or method `part' for main:Object (NameError) from /usr/staff/sgm/var/cvs/CVSROOT/collect_diffs.rb:170:in=20 `each' from /usr/staff/sgm/var/cvs/CVSROOT/collect_diffs.rb:170:in=20 `process_log' from /usr/staff/sgm/var/cvs/CVSROOT/collect_diffs.rb:169:in=20 `open' from /usr/staff/sgm/var/cvs/CVSROOT/collect_diffs.rb:169:in=20 `process_log' from /usr/staff/sgm/var/cvs/CVSROOT/collect_diffs.rb:269:in=20 `choose_operation' from /usr/staff/sgm/var/cvs/CVSROOT/collect_diffs.rb:415 Those lines correspond to: File.open("#{$datadir}/logfile",=20 File::WRONLY|File::CREAT|File::APPEND) do |file| $stdin.each do |line| # remove any trailing whitespace; we don't want the split() below=20= to # produce empty trailing items due to '\r' at the end of the line # (if input is 'DOS' style), part.sub!(/\s*$/, "") # <------ line 174=20 ------------------------------------ # 'Mac' clients sending logs to a unix server may demote=20 end-of-line with # carriage-return, defeating the $stdin.each (above). We handle=20= this # case explicitly here, so that cvsspam.rb's Subject header=20 generation # doesn't break, line.split(/\r/).each do |part| file.puts "#> #{part}" end end ... In line 174 I replaced "part" by "line", and now it seems to work. This=20= is a "blind" change since I don't know Ruby and I'm not acquainted with=20= CVSspam's implementation (though I'm starting to be :-), but I hope=20 it's valid. Cheers, Sebasti=E1n From dave at badgers-in-foil.co.uk Mon Sep 20 15:35:07 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Mon, 20 Sep 2004 15:35:07 +0000 Subject: [cvsspam-devel] encoding problem? In-Reply-To: References: <570AE588-0AF2-11D9-B212-0003935AE0E4@info.ucl.ac.be> <20040920130632.GA23464@vhost.badgers-in-foil.co.uk> Message-ID: <20040920153506.GB23464@vhost.badgers-in-foil.co.uk> On Mon, Sep 20, 2004 at 05:13:39PM +0200, Sebasti?n Gonz?lez wrote: > I patched collect_diffs.rb, and tried it by committing with a > multiple-line comment. > I got the following error: > > /usr/staff/sgm/var/cvs/CVSROOT/collect_diffs.rb:174:in `process_log': > undefined local variable or method `part' for main:Object (NameError) [...] > In line 174 I replaced "part" by "line", and now it seems to work. This > is a "blind" change since I don't know Ruby and I'm not acquainted with > CVSspam's implementation (though I'm starting to be :-), but I hope > it's valid. Oops. I suppose that implementation was rather blind too. I thought I'd only added comments to the code after testing, forgetting I'd re-ordered some lines too. Sorry about that. Many thanks for reporting the problem, and testing/correcting the fix. This will be in the next release. dave From skoehler at upb.de Thu Sep 23 19:29:10 2004 From: skoehler at upb.de (=?ISO-8859-15?Q?Sven_K=F6hler?=) Date: Thu, 23 Sep 2004 21:29:10 +0200 Subject: [cvsspam-devel] [BUG] bad subject Message-ID: <41532406.30804@upb.de> Hi, today i've got a commit-mail with a subject like [CVS #] commit comment I cannot reproduce the error yet, since this is caused by a configuration of a friend's CVS-client. I saw the same error some time ago, and i remember, that there was a "/" too much in one of the path-names. Can your imagine how that bug may be triggered? Thx Sven From skoehler at upb.de Sat Sep 25 01:09:53 2004 From: skoehler at upb.de (=?ISO-8859-15?Q?Sven_K=F6hler?=) Date: Sat, 25 Sep 2004 03:09:53 +0200 Subject: [cvsspam-devel] [BUG] bad subject In-Reply-To: <41532406.30804@upb.de> References: <41532406.30804@upb.de> Message-ID: <4154C561.6040002@upb.de> > today i've got a commit-mail with a subject like > [CVS #] commit comment The error is reproducable. If i append a trailing / to the cvs-path in the eclipse-cvs-configuration, than the subject will be of the form above. The problem is, that this is not reproducable with the normal command line cvs-client. The appropiate line would be cvs -d user@host:/path/to/cvs/ ... but the cvs-client seems to strip the trailing / from the path. Would you say, that this is more an Eclipse-Bug, and can this be fixed within CVSspam? From dave at badgers-in-foil.co.uk Sat Sep 25 09:39:47 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Sat, 25 Sep 2004 09:39:47 +0000 Subject: [cvsspam-devel] [BUG] bad subject In-Reply-To: <4154C561.6040002@upb.de> References: <41532406.30804@upb.de> <4154C561.6040002@upb.de> Message-ID: <20040925093947.GA20995@vhost.badgers-in-foil.co.uk> --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Sep 25, 2004 at 03:09:53AM +0200, Sven K?hler wrote: > >today i've got a commit-mail with a subject like > > [CVS #] commit comment > > The error is reproducable. If i append a trailing / to the cvs-path in > the eclipse-cvs-configuration, than the subject will be of the form above. > > The problem is, that this is not reproducable with the normal command > line cvs-client. The appropiate line would be > cvs -d user@host:/path/to/cvs/ ... > but the cvs-client seems to strip the trailing / from the path. > > Would you say, that this is more an Eclipse-Bug, and can this be fixed > within CVSspam? I think I can see how this would cause a problem. collect_diffs.rb might be seeing a path containing two slashes, and ony removes one of them, passing a path with a leading slash to cvsspam.rb. cvsspam.rb's regex for finding the 'repository' looks for the text up-to the first '/' in the path, and that will fail if '/' is the first character. Could you try with the attached patch to collect_diffs.rb? If there is still a problem even with this patch, could you pass the --debug option to collect_diffs.rb in your loginfo file, and after a test commit, post the contents of the temp file named like... /tmp/#cvsspam.3569.1000-63301406/logfile ...so that I can look at the file paths it contains. ta, dave --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="sanitise_path-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 25 Sep 2004 09:25:11 -0000 @@ -131,9 +131,13 @@ return changes end +# substitutes multiple adjacent occurences of '/' with a single '/' +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 +148,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 --Nq2Wo0NMKNjxTN9z-- From skoehler at upb.de Sat Sep 25 12:03:20 2004 From: skoehler at upb.de (=?ISO-8859-1?Q?Sven_K=F6hler?=) Date: Sat, 25 Sep 2004 14:03:20 +0200 Subject: [cvsspam-devel] [BUG] bad subject In-Reply-To: <20040925093947.GA20995@vhost.badgers-in-foil.co.uk> References: <41532406.30804@upb.de> <4154C561.6040002@upb.de> <20040925093947.GA20995@vhost.badgers-in-foil.co.uk> Message-ID: <41555E88.5070806@upb.de> > I think I can see how this would cause a problem. collect_diffs.rb might > be seeing a path containing two slashes, and ony removes one of them, > passing a path with a leading slash to cvsspam.rb. cvsspam.rb's regex for > finding the 'repository' looks for the text up-to the first '/' in the > path, and that will fail if '/' is the first character. > > 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 think it is because you don't strip the trailing slash from the CVSROOT. I think we need cvsroot = sanitise_path(ENV['CVSROOT']) cvsroot = path.gsub(/\/$/, "") From skoehler at upb.de Sat Sep 25 12:06:06 2004 From: skoehler at upb.de (=?ISO-8859-1?Q?Sven_K=F6hler?=) Date: Sat, 25 Sep 2004 14:06:06 +0200 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: <41555F2E.3080403@upb.de> > I think it is because you don't strip the trailing slash from the > CVSROOT. I think we need > cvsroot = sanitise_path(ENV['CVSROOT']) > cvsroot = path.gsub(/\/$/, "") path? well, there is no variable like path in that focus, but you know what i mean, don't you? From dave at badgers-in-foil.co.uk Sat Sep 25 12:42:48 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Sat, 25 Sep 2004 12:42:48 +0000 Subject: [cvsspam-devel] [BUG] bad subject In-Reply-To: <41555F2E.3080403@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> Message-ID: <20040925124248.GB20995@vhost.badgers-in-foil.co.uk> On Sat, Sep 25, 2004 at 02:06:06PM +0200, Sven K?hler wrote: > >I think it is because you don't strip the trailing slash from the > >CVSROOT. I think we need > > cvsroot = sanitise_path(ENV['CVSROOT']) > > cvsroot = path.gsub(/\/$/, "") > > path? well, there is no variable like path in that focus, but you know > what i mean, don't you? So is stripping any trailing '/' all that really needs to be done? I've just noticed that later on, we say... if $path == lastdir blah("sending spam. (I am #{$0})") ...so my earlier patch that changed '$path' without also changing 'lastdir' was in error. dave From skoehler at upb.de Sat Sep 25 13:27:27 2004 From: skoehler at upb.de (=?ISO-8859-1?Q?Sven_K=F6hler?=) Date: Sat, 25 Sep 2004 15:27:27 +0200 Subject: [cvsspam-devel] [BUG] bad subject In-Reply-To: <20040925124248.GB20995@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> Message-ID: <4155723F.50901@upb.de> >>> cvsroot = sanitise_path(ENV['CVSROOT']) >>> cvsroot = path.gsub(/\/$/, "") >> >>path? well, there is no variable like path in that focus, but you know >>what i mean, don't you? > > So is stripping any trailing '/' all that really needs to be done? I hoped so, but it doesn't work either. I'm still getting the error: /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 And i don't know why. Is the line cvsroot=cvsroot.gsub(/\/+$/, "") correct Ruby, and does it do what i intend? It should have fixed the RuntimeError as far as i understand what's going on. I guess that stripping the trailing / would be sufficient, but i'm not quite sure though. From dave at badgers-in-foil.co.uk Mon Sep 27 23:21:37 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Mon, 27 Sep 2004 23:21:37 +0000 Subject: [cvsspam-devel] [BUG] bad subject In-Reply-To: <4155723F.50901@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> Message-ID: <20040927232136.GA8110@vhost.badgers-in-foil.co.uk> I must apologise, as I'm rather busy with other things at the moment, but, On Sat, Sep 25, 2004 at 03:27:27PM +0200, Sven K?hler wrote: > >So is stripping any trailing '/' all that really needs to be done? > > I hoped so, but it doesn't work either. I'm still getting the error: > > /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 > > And i don't know why. Is the line > cvsroot=cvsroot.gsub(/\/+$/, "") > correct Ruby, and does it do what i intend? It should have fixed the > RuntimeError as far as i understand what's going on. Yes, that should do what you intend. Rather more ruby-ish would be.. cvsroot.sub!(/\/+$/, "") # change orig string; no need for global subst ..but I don't see that making any difference to the result. > I guess that stripping the trailing / would be sufficient, but i'm not > quite sure though. 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. Not sure I'll have the time for a week or two though :( dave From skoehler at upb.de Tue Sep 28 03:37:13 2004 From: skoehler at upb.de (Sven =?ISO-8859-1?Q?K=F6hler?=) Date: Tue, 28 Sep 2004 05:37:13 +0200 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: <1096342633.7556.3.camel@erni.sven.home-net> > 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. Not sure I'll have > the time for a week or two though :( Well, you asked me for the debug-output. I haven't had the time yet, but i will setup a test-CVS in a few days if you don't have working patch already. I will than supply you with the needed information, i hope. From Adam Malik Tue Sep 28 18:02:16 2004 From: Adam Malik (Adam Malik) Date: Tue, 28 Sep 2004 20:02:16 +0200 Subject: [cvsspam-devel] =?ISO-8859-15?B?L2hvbWUvcHJvamVjdHMvaG9tZWF1dC9SZXBvc2l0b3J5L0NWU1JPT1Qv?= =?ISO-8859-15?B?Y3Zzc3BhbS5yYjoxNDA2OmluIGB3cml0ZSc6IEJyb2tlbiBwaXBlIChF?= =?ISO-8859-15?B?cnJubzo6RVBJUEUpDQogICAgICAgIGZyb20gL2hvbWUvcHJvamVjdHMv?= =?ISO-8859-15?B?aG9tZWF1dC9SZXBvc2l0b3J5L0NWU1JPT1QvY3Zzc3BhbS5yYjoxNDA2?= =?ISO-8859-15?B?OmluIGBwdXRzJw0KICAgICAgICBmcm9tIC9ob21lL3Byb2plY3RzL2hv?= =?ISO-8859-15?B?bWVhdXQvUmVwb3NpdG9yeS9DVlNST09UL2N2c3NwYW0ucmI6MTQwNjpp?= =?ISO-8859-15?B?biBgbWFrZV9odG1sX2VtYWlsJw0KICAgICAgICBmcm9tIC9ob21lL3By?= =?ISO-8859-15?B?b2plY3RzL2hvbWVhdXQvUmVwb3NpdG9yeS9DVlNST09UL2N2c3NwYW0u?= =?ISO-8859-15?B?cmI6MTQwNTppbiBgZWFjaCcNCiAgICAgICAgZnJvbSAvaG9tZS9wcm9q?= =?ISO-8859-15?B?ZWN0cy9ob21lYXV0L1JlcG9zaXRvcnkvQ1ZTUk9PVC9jdnNzcGFtLnJi?= =?ISO-8859-15?B?OjE0MDU6aW4gYG1ha2VfaHRtbF9lbWFpbCcNCiAgICAgICAgZnJvbSAv?= =?ISO-8859-15?B?aG9tZS9wcm9qZWN0cy9ob21lYXV0L1JlcG9zaXRvcnkvQ1ZTUk9PVC9j?= =?ISO-8859-15?B?dnNzcGFtLnJiOjE0MDQ6aW4gYG9wZW4nDQogICAgICAgIGZyb20gL2hv?= =?ISO-8859-15?B?bWUvcHJvamVjdHMvaG9tZWF1dC9SZXBvc2l0b3J5L0NWU1JPT1QvY3Zz?= =?ISO-8859-15?B?c3BhbS5yYjoxNDA0OmluIGBtYWtlX2h0bWxfZW1haWwnDQogICAgICAg?= =?ISO-8859-15?B?IGZyb20gL2hvbWUvcHJvamVjdHMvaG9tZWF1dC9SZXBvc2l0b3J5L0NW?= =?ISO-8859-15?B?U1JPT1QvY3Zzc3BhbS5yYjoxNTM5DQogICAgICAgIGZyb20gL2hvbWUv?= =?ISO-8859-15?B?cHJvamVjdHMvaG9tZWF1dC9SZXBvc2l0b3J5L0NWU1JPT1QvY3Zzc3Bh?= =?ISO-8859-15?B?bS5yYjoxNTM4OmluIGBib2R5Jw0KICAgICAgICBmcm9tIC9ob21lL3By?= =?ISO-8859-15?B?b2plY3RzL2hvbWVhdXQvUmVwb3NpdG9yeS9DVlNST09UL2N2c3NwYW0u?= =?ISO-8859-15?B?cmI6MTUzOA0KICAgICAgICBmcm9tIC9ob21lL3Byb2plY3RzL2hvbWVh?= =?ISO-8859-15?B?dXQvUmVwb3NpdG9yeS9DVlNST09UL2N2c3NwYW0ucmI6MTUyMjppbiBg?= =?ISO-8859-15?B?c2VuZCcNCiAgICAgICAgZnJvbSAvaG9tZS9wcm9qZWN0cy9ob21lYXV0?= =?ISO-8859-15?B?L1JlcG9zaXRvcnkvQ1ZTUk9PVC9jdnNzcGFtLnJiOjE0NjY6aW4gYHBv?= =?ISO-8859-15?B?cGVuJw0KICAgICAgICBmcm9tIC9ob21lL3Byb2plY3RzL2hvbWVhdXQv?= =?ISO-8859-15?B?UmVwb3NpdG9yeS9DVlNST09UL2N2c3NwYW0ucmI6MTQ2NjppbiBgc2Vu?= =?ISO-8859-15?B?ZCcNCiAgICAgICAgZnJvbSAvaG9tZS9wcm9qZWN0cy9ob21lYXV0L1Jl?= =?ISO-8859-15?B?cG9zaXRvcnkvQ1ZTUk9PVC9jdnNzcGFtLnJiOjE1MjINCi9ob21lL3By?= =?ISO-8859-15?B?b2plY3RzL2hvbWVhdXQvUmVwb3NpdG9yeS9DVlNST09UL2NvbGxlY3Rf?= =?ISO-8859-15?B?ZGlmZnMucmI6MjczOmluIGBtYWlsdGVzdCc6IHByb2JsZW0gcnVubmlu?= =?ISO-8859-15?B?Zw0KJy9ob21lL3Byb2plY3RzL2hvbWVhdXQvUmVwb3NpdG9yeS9DVlNS?= =?ISO-8859-15?B?T09UL2N2c3NwYW0ucmInIChSdW50aW1lRXJyb3IpDQogICAgICAgIGZy?= =?ISO-8859-15?B?b20gL2hvbWUvcHJvamVjdHMvaG9tZWF1dC9SZXBvc2l0b3J5L0NWU1JP?= =?ISO-8859-15?B?T1QvY29sbGVjdF9kaWZmcy5yYjoyNTk6aW4gYGNob29zZV9vcGVyYXRp?= =?ISO-8859-15?B?b24nDQpFcnJhbmVvdXMgY3Zzc3BhbS5yYiBiZWhhdmlvciBvbiBzcGVj?= =?ISO-8859-15?B?aWZpYyBjdnMgY29tbWVudA==?= Message-ID: <19116081716.20040928200216@gorkster.de> SGksDQoNCmkgcmVjZW50bHkgbWFuYWdlZCB0byBsZXQgY3Zzc3BhbSBiZWhhdmUgaW5jb3Jy ZWN0bHkgYnkgbWFraW5nIGENCmNvbW1pdCB3aGVyZSB0aGUgY29tbWVudCB3YXMganVzdCBh IHNpbmdsZSBkb3QgKCIuIikuDQoNCkZyb20gdGhhdCBwb2ludCBhbGwgb2YgbXkgY29tbWl0 cyBwcm9kdWNlZCBlcnJvcnMgb24gY2hlY2tpbmcgaW4sIGFuZA0KZXJyYW5lb3VzIGN2c3Nw YW0gbWFpbHMuDQpBbGwgY2hhbmdlcyB0byBhbnkgZmlsZSBmcm9tIHRoYXQgcG9pbnQgaW4g dGltZSBnZXQgc3R1ZmZlZCBpbnRvIHRoZQ0KY3Zzc3BhbSBtYWlsLiBTbyBpZiBJIHdvdWxk IGNoYW5nZSBmaWxlMSwgY29tbWl0LCBjaGFuZ2UgZmlsZTIsDQpjb21taXQsIHRoZSBzZWNv bmQgbWFpbCB3b3VsZCBjb250YWluIHRoZSBkaWZmIGluZm8gb2YgZmlsZTEsIHRvby4NCg0K SSBkaWRuJ3QgZmluZCBhIHdheSB0byBnZXQgcmlkIG9mIHRoaXMgcHJvYmxlbSBzbyBmYXIu IEFuZCBpdCBvbmx5DQpoYXBwZW5zIHRvIG15IGFjY291bnQsIG90aGVyIGN2cyB1c2VycyBh cmUgdW5hZmZlY3RlZC4NCg0KSGVyZSBpcyB0aGUgb3V0cHV0IEkgZ2V0IG9uIGNoZWNraW5n IGluOg0KDQovaG9tZS9wcm9qZWN0cy9ob21lYXV0L1JlcG9zaXRvcnkvQ1ZTUk9PVC9jdnNz cGFtLnJiOjE0MDY6aW4gYHdyaXRlJzogQnJva2VuIHBpcGUgKEVycm5vOjpFUElQRSkNCiAg ICAgICAgZnJvbSAvaG9tZS9wcm9qZWN0cy9ob21lYXV0L1JlcG9zaXRvcnkvQ1ZTUk9PVC9j dnNzcGFtLnJiOjE0MDY6aW4gYHB1dHMnDQogICAgICAgIGZyb20gL2hvbWUvcHJvamVjdHMv aG9tZWF1dC9SZXBvc2l0b3J5L0NWU1JPT1QvY3Zzc3BhbS5yYjoxNDA2OmluIGBtYWtlX2h0 bWxfZW1haWwnDQogICAgICAgIGZyb20gL2hvbWUvcHJvamVjdHMvaG9tZWF1dC9SZXBvc2l0 b3J5L0NWU1JPT1QvY3Zzc3BhbS5yYjoxNDA1OmluIGBlYWNoJw0KICAgICAgICBmcm9tIC9o b21lL3Byb2plY3RzL2hvbWVhdXQvUmVwb3NpdG9yeS9DVlNST09UL2N2c3NwYW0ucmI6MTQw NTppbiBgbWFrZV9odG1sX2VtYWlsJw0KICAgICAgICBmcm9tIC9ob21lL3Byb2plY3RzL2hv bWVhdXQvUmVwb3NpdG9yeS9DVlNST09UL2N2c3NwYW0ucmI6MTQwNDppbiBgb3BlbicNCiAg ICAgICAgZnJvbSAvaG9tZS9wcm9qZWN0cy9ob21lYXV0L1JlcG9zaXRvcnkvQ1ZTUk9PVC9j dnNzcGFtLnJiOjE0MDQ6aW4gYG1ha2VfaHRtbF9lbWFpbCcNCiAgICAgICAgZnJvbSAvaG9t ZS9wcm9qZWN0cy9ob21lYXV0L1JlcG9zaXRvcnkvQ1ZTUk9PVC9jdnNzcGFtLnJiOjE1MzkN CiAgICAgICAgZnJvbSAvaG9tZS9wcm9qZWN0cy9ob21lYXV0L1JlcG9zaXRvcnkvQ1ZTUk9P VC9jdnNzcGFtLnJiOjE1Mzg6aW4gYGJvZHknDQogICAgICAgIGZyb20gL2hvbWUvcHJvamVj dHMvaG9tZWF1dC9SZXBvc2l0b3J5L0NWU1JPT1QvY3Zzc3BhbS5yYjoxNTM4DQogICAgICAg IGZyb20gL2hvbWUvcHJvamVjdHMvaG9tZWF1dC9SZXBvc2l0b3J5L0NWU1JPT1QvY3Zzc3Bh bS5yYjoxNTIyOmluIGBzZW5kJw0KICAgICAgICBmcm9tIC9ob21lL3Byb2plY3RzL2hvbWVh dXQvUmVwb3NpdG9yeS9DVlNST09UL2N2c3NwYW0ucmI6MTQ2NjppbiBgcG9wZW4nDQogICAg ICAgIGZyb20gL2hvbWUvcHJvamVjdHMvaG9tZWF1dC9SZXBvc2l0b3J5L0NWU1JPT1QvY3Zz c3BhbS5yYjoxNDY2OmluIGBzZW5kJw0KICAgICAgICBmcm9tIC9ob21lL3Byb2plY3RzL2hv bWVhdXQvUmVwb3NpdG9yeS9DVlNST09UL2N2c3NwYW0ucmI6MTUyMg0KL2hvbWUvcHJvamVj dHMvaG9tZWF1dC9SZXBvc2l0b3J5L0NWU1JPT1QvY29sbGVjdF9kaWZmcy5yYjoyNzM6aW4g YG1haWx0ZXN0JzogcHJvYmxlbSBydW5uaW5nDQonL2hvbWUvcHJvamVjdHMvaG9tZWF1dC9S ZXBvc2l0b3J5L0NWU1JPT1QvY3Zzc3BhbS5yYicgKFJ1bnRpbWVFcnJvcikNCiAgICAgICAg ZnJvbSAvaG9tZS9wcm9qZWN0cy9ob21lYXV0L1JlcG9zaXRvcnkvQ1ZTUk9PVC9jb2xsZWN0 X2RpZmZzLnJiOjI1OTppbiBgY2hvb3NlX29wZXJhdGlvbicNCiAgICAgICAgZnJvbSAvaG9t ZS9wcm9qZWN0cy9ob21lYXV0L1JlcG9zaXRvcnkvQ1ZTUk9PVC9jb2xsZWN0X2RpZmZzLnJi OjQwNA0KDQpDaGVlcnMsDQpBZGFtDQo= From dave at badgers-in-foil.co.uk Tue Sep 28 18:45:36 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 28 Sep 2004 18:45:36 +0000 Subject: [cvsspam-devel] Erraneous cvsspam.rb behavior on specific cvs comment In-Reply-To: <19116081716.20040928200216@gorkster.de> References: <19116081716.20040928200216@gorkster.de> Message-ID: <20040928184536.GA24055@vhost.badgers-in-foil.co.uk> Wow! I remove the stack-trace from your mail subject ;) On Tue, Sep 28, 2004 at 08:02:16PM +0200, Adam Malik wrote: > Hi, > > i recently managed to let cvsspam behave incorrectly by making a > commit where the comment was just a single dot ("."). > > From that point all of my commits produced errors on checking in, and > erraneous cvsspam mails. > All changes to any file from that point in time get stuffed into the > cvsspam mail. So if I would change file1, commit, change file2, > commit, the second mail would contain the diff info of file1, too. > > I didn't find a way to get rid of this problem so far. And it only > happens to my account, other cvs users are unaffected. > > Here is the output I get on checking in: > > /home/projects/homeaut/Repository/CVSROOT/cvsspam.rb:1406:in `write': Broken pipe (Errno::EPIPE) Ouch, that's bad. So, - What version of CVSspam are you using (so that I can look up that line number in the correct version of the code)? - How are you delivering email (sendmail / direct-SMTP)? - If the contents aren't confidential, or overly long, could you post the temp file created by CVSspam.. /tmp/#cvsspam..-/logfile ..so that we can try to work out what's going on To work around the problem you're having with subsequent emails, try moving the '#cvsspam....' directory from /tmp/ into your home dir (don't delete it straight away, as the content might be useful for debugging the problem). thanks for reporting this! dave From dave at badgers-in-foil.co.uk Tue Sep 28 22:57:41 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 28 Sep 2004 22:57:41 +0000 Subject: [cvsspam-devel] Erraneous cvsspam.rb behavior on specific cvs comment In-Reply-To: <147121502371.20040928213236@gorkster.de> References: <19116081716.20040928200216@gorkster.de> <20040928184536.GA24055@vhost.badgers-in-foil.co.uk> <147121502371.20040928213236@gorkster.de> Message-ID: <20040928225741.GB26262@vhost.badgers-in-foil.co.uk> 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) > DH> - How are you delivering email (sendmail / direct-SMTP)? > > The default (sendmail). > > DH> - If the contents aren't confidential, or overly long, could you post > DH> the temp file created by CVSspam.. > DH> /tmp/#cvsspam..-/logfile > DH> ..so that we can try to work out what's going on > > Well thats one of the problems i ran into when trying to debug this > problem by myself, i could not find any trace of a temporary file. > There are various tmpdirs on that system, but there are nowhere traces > of cvsspam. > Since cvsspam checks for $tmpdir = ENV["TMPDIR"] || "/tmp" there are > not too much possibilites. I also did a locate cvsspam, and grepped > around in the repository to find anything useful. > Maybe i'm just blind, do you have any suggestions? The only thing I can think of is that for the cvs server process, and therefore any child processes it forks, $TMPDIR may be something different than 'normal' value you get when log in to this server as a standard user. The way to verify this setting would be to add a rule for some project, in 'loginfo', to run 'set'. This will list out all environmental variables to your console next time you commit (at least, it will when $SHELL==/bin/bash). Anyway, I'm pretty sure I can see what the problem is here: 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've added this item to the TODO list. thanks for pointing out this oversight in the script, dave From Adam Malik Wed Sep 29 08:35:01 2004 From: Adam Malik (Adam Malik) Date: Wed, 29 Sep 2004 10:35:01 +0200 Subject: Re[2]: [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: <192168447504.20040929103501@gorkster.de> Hi David, on 29.09.2004, 00:57, you wrote: >> DH> - If the contents aren't confidential, or overly long, could you post >> DH> the temp file created by CVSspam.. >> DH> /tmp/#cvsspam..-/logfile >> DH> ..so that we can try to work out what's going on >> Well thats one of the problems i ran into when trying to debug this >> problem by myself, i could not find any trace of a temporary file. DH> The only thing I can think of is that for the cvs server process, and DH> therefore any child processes it forks, $TMPDIR may be something DH> different than 'normal' value you get when log in to this server as a DH> standard user. I found the reason for my blindness, i totally ignored the fact that the cvs server is different from my working machine, so, looking onto the correct machine i found the cvsspam tempfiles, i will send them to you in a separate mail. You pointed out that the single-dot "." comment messes up the email, but does that explain the weird behavior afterwards? After the "dot-incident", each cvsspam mail looks like that: Subject: [CVS module1,module2] . (Every module i touch from that point will be added to the modules list in the subject) Body: All commit messages that have taken place, again and again. If i change a file more than once, it gets listed more than once. The comment field in the Mail is empty, and no diffs appear. This is probably where the dot comes in. Hope thats enough for debugging, after moving away my temp folder everything is working again. Gruß, Adam From dave at badgers-in-foil.co.uk Wed Sep 29 13:45:22 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Wed, 29 Sep 2004 13:45:22 +0000 Subject: [cvsspam-devel] Erraneous cvsspam.rb behavior on specific cvs comment In-Reply-To: <192168447504.20040929103501@gorkster.de> 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> <192168447504.20040929103501@gorkster.de> Message-ID: <20040929134519.GB7514@vhost.badgers-in-foil.co.uk> On Wed, Sep 29, 2004 at 10:35:01AM +0200, Adam Malik wrote: > You pointed out that the single-dot "." comment messes up the email, but > does that explain the weird behaviour afterwards? Yeah, I think this is because there's a failure sending the email, so CVSspam doesn't delete its temporary log files. The next commit will append further data to the logs, and will try to deliver the same email (plus some new entries added at the end), and fail again when it reaches the line with a dot on its own. In it's normal mode of operation, CVSspam needs to append data to the log over the course of several invocations of the CVS 'loginfo' hook, so this behaviour isn't all that surprising. dave From dave at badgers-in-foil.co.uk Wed Sep 29 14:03:50 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Wed, 29 Sep 2004 14:03:50 +0000 Subject: [cvsspam-devel] Erraneous cvsspam.rb behavior on specific cvs comment In-Reply-To: <33168976425.20040929104350@gorkster.de> 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> <33168976425.20040929104350@gorkster.de> Message-ID: <20040929140349.GC7514@vhost.badgers-in-foil.co.uk> On Wed, Sep 29, 2004 at 10:43:50AM +0200, Adam Malik wrote: > On another cvs server i extended cvsspam.rb a bit to > put the repository name into the mail subject. > Is that already on your todo list? It's a good idea, and one I have considered... > i added this (around line 1120): > > if $repository_name == GUESS > # use the last component of the repository path as the name > ENV['CVSROOT'] =~ /([^\/]+$)/ > $the_repository_name = $1 > end > > and this (around line 1174): > > if $subjectPrefix == nil > $subjectPrefix = "[CVS " + $the_repository_name + " #{Repository.array.join(',')}]" > end > > Just a quick hack, but maybe someone will request that in the future. Works without problems with multiple repositories and config option "guess" so far. I'd actually thought of just replacing the "CVS" at the start of the subject prefix with the repository name. On both of the main servers I use, the repository is in a directory called "cvs" anyway, so this would result only is a change of case, for me. (I wonder if some people need to have the server's hostname in there too?) dave From skoehler at upb.de Thu Sep 30 02:49:33 2004 From: skoehler at upb.de (=?ISO-8859-15?Q?Sven_K=F6hler?=) Date: Thu, 30 Sep 2004 04:49:33 +0200 Subject: [cvsspam-devel] [RFE] ignore whitespace Message-ID: <415B743D.3020607@upb.de> Hi, i don't want to bather you again with an RFE, but is cvsspam also abled to have the "ignore whitespace" switch turned on? That can be useful to make diffs smaller and more useful. I mean: who's really interested in changes made to whitespaces? I see problesm when cvsspam computes it's own special in-line-diffs to color them right. The algorithm needs to be extended to "ignore whitespace" too, but that's not a must-have in the first version of this. Thx Sven From skoehler at upb.de Thu Sep 30 02:52:11 2004 From: skoehler at upb.de (=?ISO-8859-15?Q?Sven_K=F6hler?=) Date: Thu, 30 Sep 2004 04:52:11 +0200 Subject: [cvsspam-devel] [RFE] ignore whitespace In-Reply-To: <415B743D.3020607@upb.de> References: <415B743D.3020607@upb.de> Message-ID: <415B74DB.8030001@upb.de> > i don't want to bather you again with an RFE, but is cvsspam also abled > to have the "ignore whitespace" switch turned on? s/bather/bother/ From dave at badgers-in-foil.co.uk Thu Sep 30 10:22:15 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Thu, 30 Sep 2004 10:22:15 +0000 Subject: [cvsspam-devel] [RFE] ignore whitespace In-Reply-To: <415B743D.3020607@upb.de> References: <415B743D.3020607@upb.de> Message-ID: <20040930102214.GA24962@vhost.badgers-in-foil.co.uk> On Thu, Sep 30, 2004 at 04:49:33AM +0200, Sven K?hler wrote: > That can be useful to make diffs smaller and more useful. I mean: who's > really interested in changes made to whitespaces? Surely the whole point of using CVSspam is to beat-up on people when they don't do indentation exactly to one's own tastes? That's 90% of the reason why I wrote it, anyway ;) That said, it wouldn't be very much effort to implement a config switch that causes '-w' to be added to the options for 'cvs diff'. > I see problesm when cvsspam computes it's own special in-line-diffs to > color them right. The algorithm needs to be extended to "ignore > whitespace" too, but that's not a must-have in the first version of this. Being serious, part of my motivation for adding the inline-highlighting function was to make it more obvious when the only change in a line was some otherwise-invisible change to whitespace. (That wasn't the sole motivation, of course.) Unfortunately, the code to syntax-highlight diffs is very hairy. I fear attempting anything that requires touching it, so any enhancements here will probably require a rewrite of, at least, UnifiedDiffColouriser. dave