From topping at codehaus.org Sun Feb 6 22:52:15 2005 From: topping at codehaus.org (Brian Topping) Date: Sun, 06 Feb 2005 17:52:15 -0500 Subject: [cvsspam-devel] Fisheye support? Message-ID: <42069F9F.4030008@codehaus.org> This is a cryptographically signed message in MIME format. --------------ms010702000005020807030603 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Howdy! Thanks for a great tool. Not sure that it matters too much, but would be nice to have Fisheye support. Where links to ViewCVS look like: http://cvs.dentaku.codehaus.org/dentaku/example-web/project.xml?rev=1.13&content-type=text/vnd.viewcvs-markup The equivalent Fisheye looks like: http://cvs.dentaku.codehaus.org/viewrep/dentaku/dentaku/example-web/project.xml?r=1.13 Hope that helps! Brian --------------ms010702000005020807030603 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIII9TCC AtUwggI+oAMCAQICAw3WgTANBgkqhkiG9w0BAQQFADBiMQswCQYDVQQGEwJaQTElMCMGA1UE ChMcVGhhd3RlIENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNv bmFsIEZyZWVtYWlsIElzc3VpbmcgQ0EwHhcNMDUwMTE5MDAxMjAwWhcNMDYwMTE5MDAxMjAw WjBGMR8wHQYDVQQDExZUaGF3dGUgRnJlZW1haWwgTWVtYmVyMSMwIQYJKoZIhvcNAQkBFhR0 b3BwaW5nQGNvZGVoYXVzLm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ6W Ed8U9Bo+CdrE7RRn+R+KgsKwUH/fsr1w+7uvXPMFNXTS2WsRlvdTJ7t1NUgdYESnjxFPtHvj ud8Ynvlg4ADq6TzFW1GzVYFIauOfTv1iswnCNC1k35Yb0BiUz9XHoZoq9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AJBgNVBAYT AlpBMSUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNU aGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQQIDDdaBMA0GCSqGSIb3DQEBAQUA BIIBAICZJ97qnvZbhVE9nWUS8LRvwvi2MyCCLhGmvTq8+MbVE83jcylor2PUfNVImxM6TlhP 3ToYBj/BsRBehFxpbtGPlrDPy8B+oahzVjbWujOA1UnFvAIIZeaAxuwyeNBaCicePdMnx56F NdC4KiuiCmyk7pOtjgXc5fZbK3gq7M6yfzzqQyj1cA2L5EvyFyu+CU4QsDKeIXkgMYzA0vBo hljTNx8fb9KmUsErfh63Hf7Ob37aMDMfiApICrfeeppxcvSJeJc5TRbTp4FUvWc4pgTc/gu1 tXgayHZWjKA/ZGpFXd++YJb3YAFX8vfHRwibFY8+Ol87yug4Lg8iD774YvwAAAAAAAA= --------------ms010702000005020807030603-- From dave at badgers-in-foil.co.uk Tue Feb 8 11:18:12 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 8 Feb 2005 11:18:12 +0000 Subject: [cvsspam-devel] Fisheye support? In-Reply-To: <42069F9F.4030008@codehaus.org> References: <42069F9F.4030008@codehaus.org> Message-ID: <20050208111811.GA13516@vhost.badgers-in-foil.co.uk> --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Feb 06, 2005 at 05:52:15PM -0500, Brian Topping wrote: > Howdy! > > Thanks for a great tool. Not sure that it matters too much, but would > be nice to have Fisheye support. > > Where links to ViewCVS look like: > http://cvs.dentaku.codehaus.org/dentaku/example-web/project.xml?rev=1.13&content-type=text/vnd.viewcvs-markup > > The equivalent Fisheye looks like: > http://cvs.dentaku.codehaus.org/viewrep/dentaku/dentaku/example-web/project.xml?r=1.13 The attached patch to cvsspam.rb is entirely untested, but it would be great if you could give it a go! You'll need to set values for parameters $fisheyeURL and $repository_name in your cvsspam.conf if you do try it out. thanks for suggesting this feature, dave -- http://david.holroyd.me.uk/ --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fisheye_frontend-patch1.diff" --- cvsspam.rb.orig 2005-02-08 10:58:00.000000000 +0000 +++ cvsspam.rb 2005-02-08 11:09:37.000000000 +0000 @@ -748,6 +748,29 @@ end end +# Link to Fisheye +class FisheyeFrontend < WebFrontend + def initialize(base_url) + super(base_url) + end + + def path_url(path, tag) + if tag == nil + "#{@base_url}#{urlEncode(@repository_name)}/#{urlEncode(path)}" + else + "#{@base_url}~br=#{urlEncode(tag)}/#{urlEncode(@repository_name)}/#{urlEncode(path)}" + end + end + + def version_url(path, version) + "#{@base_url}#{urlEncode(@repository_name)}/#{urlEncode(path)}?r=#{version}" + end + + def diff_url(file) + "#{@base_url}#{urlEncode(@repository_name)}/#{urlEncode(file.path)}.diff?r1=#{file.fromVer}&r2=#{file.toVer}" + end +end + # in need of refactoring... @@ -1163,6 +1186,7 @@ $viewcvsURL = nil $choraURL = nil $cvswebURL = nil +$fisheyeURL = nil $from_address = nil $subjectPrefix = nil $files_in_subject = false; @@ -1239,6 +1263,9 @@ elsif $cvswebURL !=nil $cvswebURL << "/" unless $cvswebURL =~ /\/$/ $frontend = CVSwebFrontend.new($cvswebURL) +elsif $fisheyeURL !=nil + $fisheyeURL << "/" unless $fisheyeURL =~ /\/$/ + $frontend = FisheyeFrontend.new($fisheyeURL) else $frontend = NoFrontend.new end --VS++wcV0S1rZb1Fb-- From mjory at datamirror.com Mon Feb 14 19:47:34 2005 From: mjory at datamirror.com (Mike Jory) Date: Mon, 14 Feb 2005 14:47:34 -0500 Subject: [cvsspam-devel] Don't use /bin/true in *info files Message-ID: <02F390712FF39143A9B96C5523B43CEF4E3C97@dmcnt017.DataMirror.com> There are several reports of people receiving "broken pipe" errors, especially when using Eclipse and CVS along with CVSspam. c.f.=20 http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-vcm-hom e/docs/online/cvs_features2.0/cvs-faq.html#server_8 After some investigation, I have discovered the problem to be the incorrect CVSspam documentation or possibly a misinterpretation of the CVSspam documentation. In section 1.2, and possibly other places, there is the following example commitinfo snippet: # always allow commits to CVSROOT ^CVSROOT /bin/true Using /bin/true will cause the broken pipe error. The problem is that /bin/true does not read the contents of the pipe before it exits. Any process that is specified here needs to read the full contents of the pipe before exiting. By making this change, I was able to get rid of all my "broken pipe" errors. Mike From dave at badgers-in-foil.co.uk Tue Feb 15 11:11:43 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 15 Feb 2005 11:11:43 +0000 Subject: [cvsspam-devel] Don't use /bin/true in *info files In-Reply-To: <02F390712FF39143A9B96C5523B43CEF4E3C97@dmcnt017.DataMirror.com> References: <02F390712FF39143A9B96C5523B43CEF4E3C97@dmcnt017.DataMirror.com> Message-ID: <20050215111143.GA23046@vhost.badgers-in-foil.co.uk> On Mon, Feb 14, 2005 at 02:47:34PM -0500, Mike Jory wrote: > There are several reports of people receiving "broken pipe" errors, > After some investigation, I have discovered the problem to be the > incorrect CVSspam documentation or possibly a misinterpretation of the > CVSspam documentation. In section 1.2, and possibly other places, there > is the following example commitinfo snippet: > # always allow commits to CVSROOT > ^CVSROOT /bin/true That's a good point. This issue has already been fixed in CVSspam itself, thanks to Tony Garnock-Jones[1]. I think that with the suggested configuration, you should only see broken-pipe errors when changing the CVSROOT folder. Is that correct? > Using /bin/true will cause the broken pipe error. The problem is that > /bin/true does not read the contents of the pipe before it exits. Any > process that is specified here needs to read the full contents of the > pipe before exiting. By making this change, I was able to get rid of all > my "broken pipe" errors. I will note this in the documenation, however the /bin/true trick is very important for people who will need to wait for an administrator to fix their repository when a bad install b0rks it. The simplest alternative to the above I can think of that also consumes stdin is, /bin/cat>/dev/null;/bin/true Far more scope for typos though; can anyone do better? Thanks for pointing this problem out! dave [1]http://lists.badgers-in-foil.co.uk/pipermail/cvsspam-devel/2004-August/000162.html -- http://david.holroyd.me.uk/ From tonyg at lshift.net Tue Feb 15 11:19:16 2005 From: tonyg at lshift.net (Tony Garnock-Jones) Date: Tue, 15 Feb 2005 11:19:16 +0000 Subject: [cvsspam-devel] Don't use /bin/true in *info files In-Reply-To: <20050215111143.GA23046@vhost.badgers-in-foil.co.uk> References: <02F390712FF39143A9B96C5523B43CEF4E3C97@dmcnt017.DataMirror.com> <20050215111143.GA23046@vhost.badgers-in-foil.co.uk> Message-ID: <4211DAB4.9010407@lshift.net> David Holroyd wrote: > /bin/cat>/dev/null;/bin/true No need for the /bin/true: 'cat' will exit with 0 status by itself, thus /bin/cat >/dev/null Tony -- [][][] Tony Garnock-Jones | Mob: +44 (0)7905 974 211 [][] LShift Ltd | Tel: +44 (0)20 7729 7060 [] [] www.lshift.net | Email: tonyg@lshift.net From dave at badgers-in-foil.co.uk Tue Feb 15 12:58:47 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 15 Feb 2005 12:58:47 +0000 Subject: [cvsspam-devel] Don't use /bin/true in *info files In-Reply-To: <4211DAB4.9010407@lshift.net> References: <02F390712FF39143A9B96C5523B43CEF4E3C97@dmcnt017.DataMirror.com> <20050215111143.GA23046@vhost.badgers-in-foil.co.uk> <4211DAB4.9010407@lshift.net> Message-ID: <20050215125846.GB23046@vhost.badgers-in-foil.co.uk> On Tue, Feb 15, 2005 at 11:19:16AM +0000, Tony Garnock-Jones wrote: > David Holroyd wrote: > > /bin/cat>/dev/null;/bin/true > > No need for the /bin/true: 'cat' will exit with 0 status by itself, thus > > /bin/cat >/dev/null I suppose cat's chances of failing are tiny. I'll go with that. ta, dave -- http://david.holroyd.me.uk/ From glen at delfi.ee Tue Feb 15 20:41:30 2005 From: glen at delfi.ee (Elan =?iso-8859-1?q?Ruusam=E4e?=) Date: Tue, 15 Feb 2005 22:41:30 +0200 Subject: [cvsspam-devel] processing CVSROOT/users Message-ID: <200502152241.31186.glen@delfi.ee> --Boundary-00=_75lECKJ+cdmZywo Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline hi cvsspam has support of parsing CVSROOT/users. according to the link in documentation, http://cvsbook.red-bean.com/cvsbook.html#users users file can contain spaces, but then the address must be enclosed in quotes. (there are few other programs rely also on the quoting) attached is patch which parses email address properly out in such cases -- glen --Boundary-00=_75lECKJ+cdmZywo Content-Type: text/x-diff; charset="iso-8859-1"; name="cvsspam-users-quote.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cvsspam-users-quote.patch" --- ./cvsspam.rb 2004-12-10 01:51:21.000000000 +0200 +++ ./cvsspam.rb 2005-02-15 21:46:58.000000000 +0200 @@ -1568,9 +1568,9 @@ if File.exists?($users_file) File.open($users_file) do |io| io.each_line do |line| - if line =~ /^([^:]+)\s*:\s*([^\n\r]+)/ + if line =~ /^([^:]+)\s*:\s*(['"]?)([^\n\r]+)(\2)/ if address == $1 - return $2 + return $3 end end end --Boundary-00=_75lECKJ+cdmZywo-- From glen at delfi.ee Tue Feb 15 20:49:48 2005 From: glen at delfi.ee (Elan =?iso-8859-1?q?Ruusam=E4e?=) Date: Tue, 15 Feb 2005 22:49:48 +0200 Subject: [cvsspam-devel] TODO FIXME hilighting Message-ID: <200502152249.48189.glen@delfi.ee> hi maybe it's a feature, but when TODO and FIXME are on same line, only the last one is hilighted. i really expected all of them hilighted when tested the feature. -- glen From glen at delfi.ee Tue Feb 15 21:26:19 2005 From: glen at delfi.ee (Elan =?iso-8859-1?q?Ruusam=E4e?=) Date: Tue, 15 Feb 2005 23:26:19 +0200 Subject: [cvsspam-devel] --charset arg Message-ID: <200502152326.20256.glen@delfi.ee> --Boundary-00=_8jmECm3NHHlEh7O Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline hi as our cvs repository contains files with different encodings. so i hacked cvsstat a little and added --charset argument, so it is able to send out the mails in proper encoding. as it's my first day hacking ruby code, i don't know is there better way to do it, i created temp variable not to do args parsing twice, as the charset is first readed from config file (after args parsing) also i didn't find appropriate short option to use, so i left it out. and patch attached, feel free to correct it :) -- glen --Boundary-00=_8jmECm3NHHlEh7O Content-Type: text/x-diff; charset="us-ascii"; name="cvsspam-charset-arg.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cvsspam-charset-arg.patch" --- ./collect_diffs.rb~ 2004-12-10 01:51:21.000000000 +0200 +++ ./collect_diffs.rb 2005-02-15 23:09:26.000000000 +0200 @@ -357,13 +357,14 @@ [ "--to", "-t", GetoptLong::REQUIRED_ARGUMENT ], [ "--config", "-c", GetoptLong::REQUIRED_ARGUMENT ], [ "--debug", "-d", GetoptLong::NO_ARGUMENT ], - [ "--from", "-u", GetoptLong::REQUIRED_ARGUMENT ] + [ "--from", "-u", GetoptLong::REQUIRED_ARGUMENT ], + [ "--charset", GetoptLong::REQUIRED_ARGUMENT ] ) # arguments to pass though to 'cvsspam.rb' $passthroughArgs = Array.new opts.each do |opt, arg| - if ["--to", "--config", "--from"].include?(opt) + if ["--to", "--config", "--from", "--charset"].include?(opt) $passthroughArgs << opt << arg end if ["--debug"].include?(opt) --- ./cvsspam.rb~ 2005-02-15 23:23:15.000000000 +0200 +++ ./cvsspam.rb 2005-02-15 23:22:24.000000000 +0200 @@ -1170,6 +1170,7 @@ $repository_name = nil # 2MiB limit on attached diffs, $mail_size_limit = 1024 * 1024 * 2 +$arg_charset = nil require 'getoptlong' @@ -1177,7 +1178,8 @@ [ "--to", "-t", GetoptLong::REQUIRED_ARGUMENT ], [ "--config", "-c", GetoptLong::REQUIRED_ARGUMENT ], [ "--debug", "-d", GetoptLong::NO_ARGUMENT ], - [ "--from", "-u", GetoptLong::REQUIRED_ARGUMENT ] + [ "--from", "-u", GetoptLong::REQUIRED_ARGUMENT ], + [ "--charset", GetoptLong::REQUIRED_ARGUMENT ] ) opts.each do |opt, arg| @@ -1185,6 +1187,8 @@ $config = arg if opt=="--config" $debug = true if opt=="--debug" $from_address = arg if opt=="--from" + # must use different variable as the config is readed later. + $arg_charset = arg if opt == "--charset" end @@ -1227,6 +1231,10 @@ blah("Config file '#{$config}' not found, ignoring") end +if $arg_charset != nil + $charset = $arg_charset +end + if $recipients.empty? fail "No email recipients defined" end --Boundary-00=_8jmECm3NHHlEh7O-- From glen at delfi.ee Tue Feb 15 21:34:54 2005 From: glen at delfi.ee (Elan =?iso-8859-1?q?Ruusam=E4e?=) Date: Tue, 15 Feb 2005 23:34:54 +0200 Subject: [cvsspam-devel] encoding from header Message-ID: <200502152334.54960.glen@delfi.ee> hi as from CVSROOT/users file there's possibility to have non-ascii marks in= From=20 line, there's the need to encode also From: header. simple test case: $ echo "$USER:'M=E4=E4m=E4=E4 <$USER@localhost>'" >> $CVSROOT/users and call cvsspam as with "--from $USER" argument --=20 glen From dave at badgers-in-foil.co.uk Tue Feb 15 23:03:05 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 15 Feb 2005 23:03:05 +0000 Subject: [cvsspam-devel] processing CVSROOT/users In-Reply-To: <200502152241.31186.glen@delfi.ee> References: <200502152241.31186.glen@delfi.ee> Message-ID: <20050215230305.GB697@vhost.badgers-in-foil.co.uk> On Tue, Feb 15, 2005 at 10:41:30PM +0200, Elan Ruusam?e wrote: > cvsspam has support of parsing CVSROOT/users. > according to the link in documentation, > http://cvsbook.red-bean.com/cvsbook.html#users > users file can contain spaces, but then the address must be enclosed in > quotes. (there are few other programs rely also on the quoting) > > attached is patch which parses email address properly out in such cases Patch applied, with thanks, dave -- http://david.holroyd.me.uk/ From dave at badgers-in-foil.co.uk Tue Feb 15 23:11:32 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 15 Feb 2005 23:11:32 +0000 Subject: [cvsspam-devel] TODO FIXME hilighting In-Reply-To: <200502152249.48189.glen@delfi.ee> References: <200502152249.48189.glen@delfi.ee> Message-ID: <20050215231131.GC697@vhost.badgers-in-foil.co.uk> On Tue, Feb 15, 2005 at 10:49:48PM +0200, Elan Ruusam?e wrote: > maybe it's a feature, but when TODO and FIXME are on same line, only the last > one is hilighted. i really expected all of them hilighted when tested the > feature. When I have a line, on the same line, TODO and FIXME appear the first keyword "TODO" is highlighted, and the text hoisted to the top of the message is "TODO and FIXME appear". I'd never really considered that people would enter (or be able to fit) multiple entries on one line. Is this something you really use in day-to-day coding, or just a testcase? dave -- http://david.holroyd.me.uk/ From glen at delfi.ee Wed Feb 16 12:36:26 2005 From: glen at delfi.ee (Elan =?iso-8859-1?q?Ruusam=E4e?=) Date: Wed, 16 Feb 2005 14:36:26 +0200 Subject: [cvsspam-devel] TODO FIXME hilighting In-Reply-To: <20050215231131.GC697@vhost.badgers-in-foil.co.uk> References: <200502152249.48189.glen@delfi.ee> <20050215231131.GC697@vhost.badgers-in-foil.co.uk> Message-ID: <200502161436.26337.glen@delfi.ee> On Wednesday 16 February 2005 01:11, David Holroyd wrote: > On Tue, Feb 15, 2005 at 10:49:48PM +0200, Elan Ruusam?e wrote: > > maybe it's a feature, but when TODO and FIXME are on same line, only the > > last one is hilighted. i really expected all of them hilighted when > > tested the feature. > > When I have a line, > > on the same line, TODO and FIXME appear > > the first keyword "TODO" is highlighted, and the text hoisted to the top > of the message is "TODO and FIXME appear". > > I'd never really considered that people would enter (or be able to fit) > multiple entries on one line. Is this something you really use in > day-to-day coding, or just a testcase? i was just testing, how it worked. but later i saw that the TODO is not hilighted in commit message. maybe hilite it there too? -- glen From Anatol Pomozov Wed Feb 16 13:59:56 2005 From: Anatol Pomozov (Anatol Pomozov) Date: Wed, 16 Feb 2005 15:59:56 +0200 Subject: [cvsspam-devel] Subversion support Message-ID: <3665a1a0050216055962e3829a@mail.gmail.com> Probably this question was asked million times but I realy want to know answer. Is any movements with Subversion support by cvsspam??? Our company successfully used cvsspam when developed projects on CVS but recently we have moved on Subversion, so now we are miss pretty cvsspam messages. I saw that svn support planned on 3.0 version. Is any defined due date for this release?? I eager to test cvsspam [svnspam]. -- anatol From dave at badgers-in-foil.co.uk Wed Feb 16 14:41:42 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Wed, 16 Feb 2005 14:41:42 +0000 Subject: [cvsspam-devel] Subversion support In-Reply-To: <3665a1a0050216055962e3829a@mail.gmail.com> References: <3665a1a0050216055962e3829a@mail.gmail.com> Message-ID: <20050216144142.GA12956@vhost.badgers-in-foil.co.uk> On Wed, Feb 16, 2005 at 03:59:56PM +0200, Anatol Pomozov wrote: > Probably this question was asked million times but I realy want to know answer. > Is any movements with Subversion support by cvsspam??? > > Our company successfully used cvsspam when developed projects on CVS > but recently we have moved on Subversion, so now we are miss pretty > cvsspam messages. > > I saw that svn support planned on 3.0 version. Is any defined due date > for this release?? I eager to test cvsspam [svnspam]. There are no movements towards, or defined due-dates for, Subversion support, I'm sorry to say. A while ago. Ian P. Cardenas did supply some perl glue that provided a very basic level of support for Subversion, but I never got around to folding that into CVSspam-proper: http://lists.badgers-in-foil.co.uk/pipermail/svnspam-dev/2004-May/000002.html If I can make the switch from CVS to Subversion at the company I work for, I would probably make this happen. As it is, I simply don't make any use of Subversion in a collaborative environment right now. In the meantime, David Wheeler is doing excellent work with his SVN::Notify package. It seems to support most CVSspam features, and has the plain-text email support I wish I'd built into CVSspam from the start: http://www.justatheory.com/computers/programming/perl/modules/ http://www.justatheory.com/computers/programming/perl/modules/svnnotify-2.40_colordiff_example.html I'd give that a try, if you haven't already. dave -- http://david.holroyd.me.uk/ From dave at badgers-in-foil.co.uk Wed Feb 16 15:08:33 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Wed, 16 Feb 2005 15:08:33 +0000 Subject: [cvsspam-devel] encoding from header In-Reply-To: <200502152334.54960.glen@delfi.ee> References: <200502152334.54960.glen@delfi.ee> Message-ID: <20050216150833.GB12956@vhost.badgers-in-foil.co.uk> On Tue, Feb 15, 2005 at 11:34:54PM +0200, Elan Ruusam?e wrote: > as from CVSROOT/users file there's possibility to have non-ascii marks > in From line, there's the need to encode also From: header. > > simple test case: > $ echo "$USER:'M??m?? <$USER@localhost>'" >> $CVSROOT/users > and call cvsspam as with "--from $USER" argument This raises the question, what charset is CVSROOT/users stored in? Intuition tells me that it should probably be interpreted with the system-default, but that may be at odds with any charset specified in CVSspam's config. I'll need to read-up on encoding in From headers. dave -- http://david.holroyd.me.uk/ From dave at badgers-in-foil.co.uk Wed Feb 16 16:08:12 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Wed, 16 Feb 2005 16:08:12 +0000 Subject: [cvsspam-devel] --charset arg In-Reply-To: <200502152326.20256.glen@delfi.ee> References: <200502152326.20256.glen@delfi.ee> Message-ID: <20050216160811.GC12956@vhost.badgers-in-foil.co.uk> On Tue, Feb 15, 2005 at 11:26:19PM +0200, Elan Ruusam?e wrote: > as our cvs repository contains files with different encodings. so i hacked > cvsstat a little and added --charset argument, so it is able to send out the > mails in proper encoding. > > as it's my first day hacking ruby code, i don't know is there better way to do > it, i created temp variable not to do args parsing twice, as the charset is > first readed from config file (after args parsing) > > also i didn't find appropriate short option to use, so i left it out. > > and patch attached, feel free to correct it :) Looks good. I'll try to make time to apply this later in the week. dave -- http://david.holroyd.me.uk/ From glen at delfi.ee Wed Feb 16 17:55:50 2005 From: glen at delfi.ee (Elan =?iso-8859-1?q?Ruusam=E4e?=) Date: Wed, 16 Feb 2005 19:55:50 +0200 Subject: [cvsspam-devel] encoding from header In-Reply-To: <20050216150833.GB12956@vhost.badgers-in-foil.co.uk> References: <200502152334.54960.glen@delfi.ee> <20050216150833.GB12956@vhost.badgers-in-foil.co.uk> Message-ID: <200502161955.50472.glen@delfi.ee> On Wednesday 16 February 2005 17:08, David Holroyd wrote: > On Tue, Feb 15, 2005 at 11:34:54PM +0200, Elan Ruusam?e wrote: > > as from CVSROOT/users file there's possibility to have non-ascii marks > > in From line, there's the need to encode also From: header. > > > > simple test case: > > $ echo "$USER:'M??m?? <$USER@localhost>'" >> $CVSROOT/users > > and call cvsspam as with "--from $USER" argument > > This raises the question, what charset is CVSROOT/users stored in? > Intuition tells me that it should probably be interpreted with the > system-default, but that may be at odds with any charset specified in > CVSspam's config. the same question i had. and only reasonable way is to default to the one specified in cvsspam config, and allow it override charset for CVSROOT/users file, just in case. -- glen From glen at delfi.ee Wed Feb 16 18:05:55 2005 From: glen at delfi.ee (Elan =?iso-8859-1?q?Ruusam=E4e?=) Date: Wed, 16 Feb 2005 20:05:55 +0200 Subject: [cvsspam-devel] bug in anchors Message-ID: <200502162005.55871.glen@delfi.ee> the anchors seem to be off by one there's href to file1, but file anchors start from file2 [...] -- glen From dave at badgers-in-foil.co.uk Wed Feb 16 18:15:43 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Wed, 16 Feb 2005 18:15:43 +0000 Subject: [cvsspam-devel] bug in anchors In-Reply-To: <200502162005.55871.glen@delfi.ee> References: <200502162005.55871.glen@delfi.ee> Message-ID: <20050216181543.GD12956@vhost.badgers-in-foil.co.uk> On Wed, Feb 16, 2005 at 08:05:55PM +0200, Elan Ruusam?e wrote: > the anchors seem to be off by one > > there's href to file1, but file anchors start from file2 > > > [...] > This will be fixed in the next release. You can find a patch for the problem here: http://lists.badgers-in-foil.co.uk/pipermail/cvsspam-devel/2005-January/000255.html Thanks for taking the time to point out all these issues! dave -- http://david.holroyd.me.uk/ From glen at delfi.ee Wed Feb 16 19:49:31 2005 From: glen at delfi.ee (Elan =?iso-8859-1?q?Ruusam=E4e?=) Date: Wed, 16 Feb 2005 21:49:31 +0200 Subject: [cvsspam-devel] bug in anchors In-Reply-To: <20050216181543.GD12956@vhost.badgers-in-foil.co.uk> References: <200502162005.55871.glen@delfi.ee> <20050216181543.GD12956@vhost.badgers-in-foil.co.uk> Message-ID: <200502162149.32273.glen@delfi.ee> On Wednesday 16 February 2005 20:15, David Holroyd wrote: > This will be fixed in the next release. You can find a patch for the > problem here: > > > http://lists.badgers-in-foil.co.uk/pipermail/cvsspam-devel/2005-January/000 >255.html thanks, are there any other issues in current version and list of patches for them? > Thanks for taking the time to point out all these issues! > dave -- glen From skoehler at upb.de Wed Feb 16 20:16:58 2005 From: skoehler at upb.de (=?ISO-8859-1?Q?Sven_K=F6hler?=) Date: Wed, 16 Feb 2005 21:16:58 +0100 Subject: [cvsspam-devel] bug in anchors In-Reply-To: <200502162149.32273.glen@delfi.ee> References: <200502162005.55871.glen@delfi.ee> <20050216181543.GD12956@vhost.badgers-in-foil.co.uk> <200502162149.32273.glen@delfi.ee> Message-ID: <4213AA3A.6060308@upb.de> This is a multi-part message in MIME format. --------------000703090604050004000001 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit >>http://lists.badgers-in-foil.co.uk/pipermail/cvsspam-devel/2005-January/000 >>255.html > > thanks, are there any other issues in current version and list of patches for > them? My Gentoo-ebuild currently applies the ones attached. Thay are all i know of. --------------000703090604050004000001 Content-Type: application/x-bzip2; name="patch-0.2.11-2.patch.bz2" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="patch-0.2.11-2.patch.bz2" QlpoOTFBWSZTWYw91yoAAEPfgGowXP//92YQAAS/59+6MAElChKKZEwT0JpqPU0aZMgDNDUG 1PSZqCVNSehlNBpoD1BoAAAAA0OYACYAAmAAAAAFJiQe9jVNslgubWpC1ByiHVUxBh9LGaIs +PiOLIn9MOvTd3XkNGSigc/vLe9ZK/nXt4JYnkjyOURXC9B55xGTFBGXpBGMhwi6oi1S+CIY sITWIDBw8bF6JaUDBamcsaaY2KpszEcWOSixxmDrT7pMqMTcHoVVtegFwHkhtE7bTFyINCfj ICP4vRu0bqi4MQvZsnaTEVV6SpgsooqmP9jIN9JMRbp2VFyKQUVJ0WkZMOkRJzI1OL5a0rSY fVCK+UrEyKLKPlWITkfzZUy4Xc+Q4kNxoYIqMjRFRKemgJw5apSmSOutHmD6oXx8QauImGqc YTMOZPZ/i7kinChIRh7rlQA= --------------000703090604050004000001 Content-Type: application/x-bzip2; name="patch-0.2.11-1.patch.bz2" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="patch-0.2.11-1.patch.bz2" QlpoOTFBWSZTWQZorLwAAENfgCIwfO//0kgAnQW/5/8qMAFlttTDUyRqGJk2kBpp6gBoZGEa aGg0QSemFPU9QAAAaAAAAlNRMJqnhT9KepoNAAGgAaANQzSvuEltiVUqNt0gQBCGI7sY2UtB ND8MeyExWtqz9VWtZwWkvG64G8Hn4h5iSi8ZL69LioDkN8kSAkFtB3DeGBxQZlbBsDvPFm6D 0BwqmgZCVfBq0igL1slERLoICwGMkbKQLtuLomqDRH+Dyr0EiBqKlJVtknjnUHZQc87w5PDo CzFRRTUdVYYJtxBgRMhI797LbMSiPB5HOZHsBiZ/oPb8E73gGTUUGXLitMR8QFfoSqOScgZQ 8zVso4NuMDyji782mxG0FHJCVuKY2BEKXkKmFmQxrawU2gPMSbac0t0aSmSK2kIcaltQCCnG mUDAjPIJ3xDML5yyay+4LqCdbQmfrYxIpwTefNxuDVkSC0pNyWDz3joya95msFayZ7qgoNn/ TsMHDToBF9RGFfxdyRThQkAZorLw --------------000703090604050004000001-- From dave at badgers-in-foil.co.uk Sun Feb 20 01:12:10 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Sun, 20 Feb 2005 01:12:10 +0000 Subject: [cvsspam-devel] question about cvsspam-0.2.8 and addition/removal of binary files In-Reply-To: <20050108113149.GB4316@vhost.badgers-in-foil.co.uk> References: <20050108113149.GB4316@vhost.badgers-in-foil.co.uk> Message-ID: <20050220011209.GA17650@vhost.badgers-in-foil.co.uk> --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jan 08, 2005 at 11:31:49AM +0000, David Holroyd wrote: > On Fri, Jan 07, 2005 at 10:28:13PM +0000, Corporate Gadfly wrote: > > Whenever a binary file (for example a .pdf file) is > > added to the repository CVSspam provides the whole contents of the file as > > a diff instead of just providing the link. As you can see this is probably > > not the desired behavior. Has anyone else seen the same behavior? [...] > > Working revision: 1.2 > > Repository revision: 1.2 /www/REPO/sis/src/t2202a-flat-fill-03b.pdf,v > > Sticky Tag: (none) > > Sticky Date: (none) > > Sticky Options: -kb > > > > As you can see -kb is set. [...] > It would be resonable to use the presence of the -kb option as an > additional hint to control the handling of the file. I will try to get > around to implementing this at some point -- I've added it to the TODO > list. The attached patch causes collect_diffs.rb to skip files with the -kb option set, and report them as binary files to the code that generates the email. Maybe someone could give it a whirl? ta, dave -- http://david.holroyd.me.uk/ --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="optkb_binary_hint-patch1.diff" Index: collect_diffs.rb =================================================================== RCS file: /var/lib/cvs/cvsspam/collect_diffs.rb,v retrieving revision 1.22 diff -u -r1.22 collect_diffs.rb --- collect_diffs.rb 22 Dec 2004 13:41:25 -0000 1.22 +++ collect_diffs.rb 20 Feb 2005 01:01:08 -0000 @@ -196,6 +196,8 @@ # record version information file.puts "#V #{change.fromVer},#{change.toVer}" + # remember that the 'binary' option was set for this file + binary_file = false # note if the file is on a branch tag = nil if change.isRemoval @@ -210,6 +212,10 @@ if status =~ /^\s*Sticky Tag:\s*(.+) \(branch: +/m tag = $1 end + + if status =~ /^\s*Sticky Options:\s*-kb/m + binary_file = true + end end file.puts "#T #{tag}" unless tag.nil? @@ -232,17 +238,25 @@ end file.puts "#{$repository_path}/#{change.file}" diff_cmd << change.file - # do a cvs diff and place the output into our temp file - blah("about to run #{diff_cmd.join(' ')}") - safer_popen(*diff_cmd) do |pipe| - # skip over cvs-diff's preamble - pipe.each do |line| - break if line =~ /^diff / - end - file.puts "#U #{line}" - pipe.each do |line| - file.puts "#U #{line}" - end + if binary_file + blah("not diffing #{change.file}; has -kb set") + # fake diff lines that will cause cvsspam.rb to consider this a binary + # file, + file.puts "#U diff x x" + file.puts "#U Binary files x and y differ" + else + # do a cvs diff and place the output into our temp file + blah("about to run #{diff_cmd.join(' ')}") + safer_popen(*diff_cmd) do |pipe| + # skip over cvs-diff's preamble + pipe.each do |line| + break if line =~ /^diff / + end + file.puts "#U #{line}" + pipe.each do |line| + file.puts "#U #{line}" + end + end end # TODO: don't how to do this reliably on different systems... #fail "cvsdiff did not give exit status 1 for invocation: #{diff_cmd.join(' ')}" unless ($?>>8)==1 --6TrnltStXW4iwmi0-- From dave at badgers-in-foil.co.uk Sun Feb 20 17:33:00 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Sun, 20 Feb 2005 17:33:00 +0000 Subject: [cvsspam-devel] encoding from header In-Reply-To: <200502152334.54960.glen@delfi.ee> References: <200502152334.54960.glen@delfi.ee> Message-ID: <20050220173300.GD25328@vhost.badgers-in-foil.co.uk> --jL2BoiuKMElzg3CS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Feb 15, 2005 at 11:34:54PM +0200, Elan Ruusam?e wrote: > as from CVSROOT/users file there's possibility to have non-ascii marks > in From line, there's the need to encode also From: header. The attached patch implements a slightly more sophisticated internal representation for email addresses, and allows words in the 'personal name' part of an address to be encoded per RFC 2047. I don't claim that this handles all possible configurations of an RFC 822 address; but it does do a better job than the previous implementation. dave -- http://david.holroyd.me.uk/ --jL2BoiuKMElzg3CS Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="encode_email_personal_name-patch1.diff" Index: cvsspam.rb =================================================================== RCS file: /var/lib/cvs/cvsspam/cvsspam.rb,v retrieving revision 1.65 diff -u -r1.65 cvsspam.rb --- cvsspam.rb 20 Feb 2005 13:35:15 -0000 1.65 +++ cvsspam.rb 20 Feb 2005 17:25:01 -0000 @@ -122,24 +122,49 @@ # long values with header continuation lines as needed def rfc2047_encode_quoted(io, start, rest) raise "no charset" if @charset.nil? - code_begin = "=?#{@charset}?#{@encoding}?" + code_begin = marker_start_quoted start << code_begin - rest.each_byte do |b| - code = if b>126 || b==UNDERSCORE || b==TAB - sprintf("=%02x", b) - elsif b == SPACE - "_" - else - b.chr - end - + each_char_encoded(rest) do |code| if start.length+code.length+2 > @right_margin - io.puts(start + "?=") + io.puts(start + marker_end_quoted) start = " " + code_begin end start << code end - io.puts(start + "?=") + io.puts(start + marker_end_quoted) + end + + # return a string representing the given character-code in quoted-printable + # format + def quoted_encode_char(b) + if b>126 || b==UNDERSCORE || b==TAB + sprintf("=%02x", b) + elsif b == SPACE + "_" + else + b.chr + end + end + + public + + # yields a quoted-printable version of each byte in the given string + def each_char_encoded(text) + text.each_byte do |b| + yield quoted_encode_char(b) + end + end + + # gives the string "?=",which is used to mark the end of a quoted-printable + # characte rsequence + def marker_end_quoted + "?=" + end + + # gives a string starting "=?", and including a charset specification, that + # marks the start of a quoted-printable character sequence + def marker_start_quoted + "=?#{@charset}?#{@encoding}?" end # test to see of the given string contains non-ASCII characters @@ -1145,6 +1170,60 @@ end end +# an RFC 822 email address +class EmailAddress + def initialize(text) + if text =~ /^\s*([^<]+?)\s*<\s*([^>]+?)\s*>\s*$/ + @personal_name = $1 + @address = $2 + else + @personal_name = nil + @address = text + end + end + + attr_accessor :personal_name, :address + + def has_personal_name? + return !@personal_name.nil? + end + + def encoded + if has_personal_name? + "#{encoded_personal_name} <#{address}>" + else + @address + end + end + + def to_s + if has_personal_name? + "#{personal_name} <#{address}>" + else + @address + end + end + + private + + def encoded_personal_name + personal_name.split(" ").map{|word| encode_word(word)}.join(" ") + end + + # rfc2047 encode the word, if it contains non-ASCII characters + def encode_word(word) + if $encoder.requires_rfc2047?(word) + encoded = $encoder.marker_start_quoted + $encoder.each_char_encoded(word) do |code| + encoded << code + end + encoded << $encoder.marker_end_quoted + return encoded + end + word + end +end + cvsroot_dir = "#{ENV['CVSROOT']}/CVSROOT" $config = "#{cvsroot_dir}/cvsspam.conf" @@ -1183,10 +1262,10 @@ ) opts.each do |opt, arg| - $recipients << arg if opt=="--to" + $recipients << EmailAddress.new(arg) if opt=="--to" $config = arg if opt=="--config" $debug = true if opt=="--debug" - $from_address = arg if opt=="--from" + $from_address = EmailAddress.new(arg) if opt=="--from" # must use different variable as the config is readed later. $arg_charset = arg if opt == "--charset" end @@ -1218,7 +1297,7 @@ end # helper function called from the 'config file' def addRecipient(email) - $recipients << email + $recipients << EmailAddress.new(email) end # 'constant' used from the 'config file' class GUESS @@ -1333,6 +1412,7 @@ end $encoder = HeaderEncoder.new +# TODO: maybe we should use the system-default value instead of ISO Latin 1? $encoder.charset = $charset.nil? ? "ISO-8859-1" : $charset @@ -1572,19 +1652,19 @@ # Tries to look up an 'alias' email address for the given string in the # CVSROOT/users file, if the file exists. The argument is returned unchanged # if no alias is found. -def sender_alias(address) +def sender_alias(email) if File.exists?($users_file) File.open($users_file) do |io| io.each_line do |line| if line =~ /^([^:]+)\s*:\s*(['"]?)([^\n\r]+)(\2)/ - if address == $1 - return $3 + if email.address == $1 + return EmailAddress.new($3) end end end end end - address + email end # A handle for code that needs to add headers and a body to an email being @@ -1628,13 +1708,13 @@ blah("invoking '#{cmd}'") IO.popen(cmd, "w") do |mail| ctx = MailContext.new(mail) - ctx.header("To", recipients.join(',')) + ctx.header("To", recipients.map{|addr| addr.encoded}.join(',')) if from blah("Mail From: <#{from}>") else blah("Mail From not set") end - ctx.header("From", from) if from + ctx.header("From", from.encoded) if from yield ctx end end @@ -1662,19 +1742,19 @@ def send(from, recipients) if from == nil - from = ENV['USER'] || ENV['USERNAME'] || 'cvsspam' + from = EmailAddress.new(ENV['USER'] || ENV['USERNAME'] || 'cvsspam') end - unless from =~ /@/ - from = "#{from}@#{ENV['HOSTNAME']||'localhost'}" + unless from.address =~ /@/ + from.address = "#{from.address}@#{ENV['HOSTNAME']||'localhost'}" end smtp = Net::SMTP.new(@smtp_host) blah("connecting to '#{@smtp_host}'") smtp.start() - smtp.ready(from, recipients) do |mail| + smtp.ready(from.address, recipients.map{|addr| addr.address}) do |mail| ctx = MailContext.new(IOAdapter.new(mail)) - ctx.header("To", recipients.join(',')) + ctx.header("To", recipients.map{|addr| addr.encoded}.join(',')) blah("Mail From: <#{from}>") - ctx.header("From", from) if from + ctx.header("From", from.encoded) if from ctx.header("Date", Time.now.utc.strftime(DATE_HEADER_FORMAT)) yield ctx end --jL2BoiuKMElzg3CS-- From glen at delfi.ee Mon Feb 21 19:59:12 2005 From: glen at delfi.ee (Elan =?iso-8859-15?q?Ruusam=E4e?=) Date: Mon, 21 Feb 2005 21:59:12 +0200 Subject: [cvsspam-devel] encoding from header In-Reply-To: <20050220173300.GD25328@vhost.badgers-in-foil.co.uk> References: <200502152334.54960.glen@delfi.ee> <20050220173300.GD25328@vhost.badgers-in-foil.co.uk> Message-ID: <200502212159.13217.glen@delfi.ee> --Boundary-00=_R2jGC89UWwaOd/q Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sunday 20 February 2005 19:33, David Holroyd wrote: > On Tue, Feb 15, 2005 at 11:34:54PM +0200, Elan Ruusam?e wrote: > > as from CVSROOT/users file there's possibility to have non-ascii marks > > in From line, there's the need to encode also From: header. > > The attached patch implements a slightly more sophisticated internal > representation for email addresses, and allows words in the 'personal > name' part of an address to be encoded per RFC 2047. > > I don't claim that this handles all possible configurations of an > RFC 822 address; but it does do a better job than the previous > implementation. nice. i will be testing it tomorrow (including with the -kb option patch) but wanted to let you know that this did not apply to clean release version, as the diff was against to some debug code :) attached is diff of the patch :) > dave -- glen --Boundary-00=_R2jGC89UWwaOd/q Content-Type: text/x-diff; charset="iso-8859-15"; name="cvsspam-encode_email_personal_name.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cvsspam-encode_email_personal_name.patch" =================================================================== RCS file: /cvsroot/SOURCES/cvsspam-encode_email_personal_name.patch,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SOURCES/cvsspam-encode_email_personal_name.patch 2005/02/21 19:53:20 1.1 +++ SOURCES/cvsspam-encode_email_personal_name.patch 2005/02/21 19:55:45 1.2 @@ -1,10 +1,5 @@ -Index: cvsspam.rb -=================================================================== -RCS file: /var/lib/cvs/cvsspam/cvsspam.rb,v -retrieving revision 1.65 -diff -u -r1.65 cvsspam.rb ---- cvsspam.rb 20 Feb 2005 13:35:15 -0000 1.65 -+++ cvsspam.rb 20 Feb 2005 17:25:01 -0000 +--- cvsspam-0.2.11/cvsspam.rb 2005-02-21 21:52:45.000000000 +0200 ++++ cvsspam-0.2.11.patched/cvsspam.rb 2005-02-21 21:52:18.000000000 +0200 @@ -122,24 +122,49 @@ # long values with header continuation lines as needed def rfc2047_encode_quoted(io, start, rest) @@ -182,23 +177,18 @@ end # A handle for code that needs to add headers and a body to an email being -@@ -1628,13 +1708,13 @@ +@@ -1628,8 +1708,8 @@ blah("invoking '#{cmd}'") IO.popen(cmd, "w") do |mail| ctx = MailContext.new(mail) - ctx.header("To", recipients.join(',')) -+ ctx.header("To", recipients.map{|addr| addr.encoded}.join(',')) - if from - blah("Mail From: <#{from}>") - else - blah("Mail From not set") - end - ctx.header("From", from) if from ++ ctx.header("To", recipients.map{|addr| addr.encoded}.join(',')) + ctx.header("From", from.encoded) if from yield ctx end end -@@ -1662,19 +1742,19 @@ +@@ -1657,18 +1737,18 @@ def send(from, recipients) if from == nil @@ -217,9 +207,8 @@ + smtp.ready(from.address, recipients.map{|addr| addr.address}) do |mail| ctx = MailContext.new(IOAdapter.new(mail)) - ctx.header("To", recipients.join(',')) -+ ctx.header("To", recipients.map{|addr| addr.encoded}.join(',')) - blah("Mail From: <#{from}>") - ctx.header("From", from) if from ++ ctx.header("To", recipients.map{|addr| addr.encoded}.join(',')) + ctx.header("From", from.encoded) if from ctx.header("Date", Time.now.utc.strftime(DATE_HEADER_FORMAT)) yield ctx --Boundary-00=_R2jGC89UWwaOd/q-- From glen at delfi.ee Sun Feb 27 16:16:13 2005 From: glen at delfi.ee (Elan =?iso-8859-1?q?Ruusam=E4e?=) Date: Sun, 27 Feb 2005 18:16:13 +0200 Subject: [cvsspam-devel] rather strange error Message-ID: <200502271816.13803.glen@delfi.ee> hi $ cvs ci -m '- use imap protocol, works at least' mailboxes Checking in mailboxes; /home/glen/CVSROOT/conf/mutt/mailboxes,v <-- mailboxes new revision: 1.4; previous revision: 1.3 done /usr/lib/cvsspam/collect_diffs.rb:106:in `collect_antique_style_args': calculated repository path ('onf/mutt') doesn't match start of command line arg ('conf/mutt mailboxes,1.3,1.4') (RuntimeError) from /usr/lib/cvsspam/collect_diffs.rb:165:in `process_log' from /usr/lib/cvsspam/collect_diffs.rb:446 $ cat CVS/Repository conf/mutt $ cat CVS/Root /home/glen/CVSROOT/ it looks to me, that the 'c' was interpreted as commandline argument switch '-c' i'm running 0.2.11 with following patches: Patch0: %{name}-users-quote.patch Patch1: %{name}-charset-arg.patch Patch2: %{name}-filenr.patch Patch3: %{name}-trailing-cvsinfo-slash.patch Patch4: %{name}-optkb_binary_hint.patch Patch5: %{name}-encode_email_personal_name.patch -- glen From glen at delfi.ee Sun Feb 27 17:32:38 2005 From: glen at delfi.ee (Elan =?iso-8859-1?q?Ruusam=E4e?=) Date: Sun, 27 Feb 2005 19:32:38 +0200 Subject: [cvsspam-devel] rather strange error In-Reply-To: <200502271816.13803.glen@delfi.ee> References: <200502271816.13803.glen@delfi.ee> Message-ID: <200502271932.39163.glen@delfi.ee> On Sunday 27 February 2005 18:16, Elan Ruusamäe wrote: > $ cat CVS/Root > /home/glen/CVSROOT/ ok, the problem is caused by the extra slash in $CVSROOT removed it and no more error. but the problem remains :) -- glen From dave at badgers-in-foil.co.uk Sun Feb 27 17:46:11 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Sun, 27 Feb 2005 17:46:11 +0000 Subject: [cvsspam-devel] rather strange error In-Reply-To: <200502271816.13803.glen@delfi.ee> References: <200502271816.13803.glen@delfi.ee> Message-ID: <20050227174611.GB5758@vhost.badgers-in-foil.co.uk> --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Feb 27, 2005 at 06:16:13PM +0200, Elan Ruusam?e wrote: > hi > > $ cvs ci -m '- use imap protocol, works at least' mailboxes > Checking in mailboxes; > /home/glen/CVSROOT/conf/mutt/mailboxes,v <-- mailboxes > new revision: 1.4; previous revision: 1.3 > done > /usr/lib/cvsspam/collect_diffs.rb:106:in `collect_antique_style_args': > calculated repository path ('onf/mutt') doesn't match start of command line > arg ('conf/mutt mailboxes,1.3,1.4') (RuntimeError) > from /usr/lib/cvsspam/collect_diffs.rb:165:in `process_log' > from /usr/lib/cvsspam/collect_diffs.rb:446 > > $ cat CVS/Repository > conf/mutt > $ cat CVS/Root > /home/glen/CVSROOT/ I suspect the problem is at line 160: $repository_path = $path.slice(cvsroot.length+1, $path.length-cvsroot.length-1) a trailing '/' on cvsroot in unexpected. You can see that if, cvsroot = "/home/glen/CVSROOT" and $path = "/home/glen/CVSROOT/conf/mutt" then 'cvsroot.length+1' makes sense as the first argument to slice(), because we want "conf/mutt" rather than "/conf/mutt" as the result. The attached patch removes the assumption that there is no trailing slash, and explicity removes it, if present, with a regex substitution. I've not really tested it, other than checking that my smoke test still runs, so please let me know if this fixes things for you. dave -- http://david.holroyd.me.uk/ --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="cvsroot_trailing_slash-patch1.diff" Index: collect_diffs.rb =================================================================== RCS file: /var/lib/cvs/cvsspam/collect_diffs.rb,v retrieving revision 1.24 diff -u -r1.24 collect_diffs.rb --- collect_diffs.rb 20 Feb 2005 13:35:15 -0000 1.24 +++ collect_diffs.rb 27 Feb 2005 17:35:12 -0000 @@ -157,7 +157,8 @@ fail "CVSROOT ('#{cvsroot}') doesn't match log preamble ('#{$path}')" end - $repository_path = $path.slice(cvsroot.length+1, $path.length-cvsroot.length-1) + $repository_path = $path.slice(cvsroot.length, $path.length-cvsroot.length) + $repository_path.sub!(/^\//, "") # remove leading '/', if present if $use_modern_argument_list changes = collect_modern_style_args(cvs_info) --azLHFNyN32YCQGCU-- From glen at delfi.ee Sun Feb 27 18:21:15 2005 From: glen at delfi.ee (Elan =?iso-8859-15?q?Ruusam=E4e?=) Date: Sun, 27 Feb 2005 20:21:15 +0200 Subject: [cvsspam-devel] rather strange error In-Reply-To: <20050227174611.GB5758@vhost.badgers-in-foil.co.uk> References: <200502271816.13803.glen@delfi.ee> <20050227174611.GB5758@vhost.badgers-in-foil.co.uk> Message-ID: <200502272021.15264.glen@delfi.ee> On Sunday 27 February 2005 19:46, David Holroyd wrote: > I've not really tested it, other than checking that my smoke test still > runs, so please let me know if this fixes things for you. thanks. works :) > dave -- glen From tim at uckun.com Mon Feb 28 16:34:17 2005 From: tim at uckun.com (Tim) Date: Mon, 28 Feb 2005 09:34:17 -0700 Subject: [cvsspam-devel] Selectively exclude certain files from the diffs. Message-ID: <42234809.80502@uckun.com> Is it possible for specify that no diffs should be sent for certain files or files matching a glob or a regexp? For example to exclude all the binary files or the Delphi form files. From glen at delfi.ee Mon Feb 28 17:18:40 2005 From: glen at delfi.ee (Elan =?iso-8859-1?q?Ruusam=E4e?=) Date: Mon, 28 Feb 2005 19:18:40 +0200 Subject: [cvsspam-devel] Selectively exclude certain files from the diffs. In-Reply-To: <42234809.80502@uckun.com> References: <42234809.80502@uckun.com> Message-ID: <200502281918.40374.glen@delfi.ee> try adding to CVSROOT/loginfo: *.bin /bin/true this assumes you have cvsspam configured as DEFAULT, ie not as ALL On Monday 28 February 2005 18:34, Tim wrote: > Is it possible for specify that no diffs should be sent for certain > files or files matching a glob or a regexp? For example to exclude all > the binary files or the Delphi form files. -- glen From glen at delfi.ee Mon Feb 28 17:21:57 2005 From: glen at delfi.ee (Elan =?iso-8859-1?q?Ruusam=E4e?=) Date: Mon, 28 Feb 2005 19:21:57 +0200 Subject: [cvsspam-devel] Selectively exclude certain files from the diffs. In-Reply-To: <200502281918.40374.glen@delfi.ee> References: <42234809.80502@uckun.com> <200502281918.40374.glen@delfi.ee> Message-ID: <200502281921.57810.glen@delfi.ee> On Monday 28 February 2005 19:18, Elan Ruusamäe wrote: > try adding to CVSROOT/loginfo: > > *.bin /bin/true sorry, this should read: .*\.bin$ /bin/true ie, it's regexp not shell glob there > this assumes you have cvsspam configured as DEFAULT, ie not as ALL > > On Monday 28 February 2005 18:34, Tim wrote: > > Is it possible for specify that no diffs should be sent for certain > > files or files matching a glob or a regexp? For example to exclude all > > the binary files or the Delphi form files. -- glen From tim at uckun.com Mon Feb 28 17:26:17 2005 From: tim at uckun.com (Tim) Date: Mon, 28 Feb 2005 10:26:17 -0700 Subject: [cvsspam-devel] Selectively exclude certain files from the diffs. In-Reply-To: <200502281921.57810.glen@delfi.ee> References: <42234809.80502@uckun.com> <200502281918.40374.glen@delfi.ee> <200502281921.57810.glen@delfi.ee> Message-ID: <42235439.3050904@uckun.com> Thanks for the tip. I was afraid I was going to hack the code :). It might be a good=20 feature to add though. Elan Ruusam=E4e wrote: >On Monday 28 February 2005 19:18, Elan Ruusam=E4e wrote: > =20 > >>try adding to CVSROOT/loginfo: >> >>*.bin /bin/true >> =20 >> >sorry, this should read: >.*\.bin$ /bin/true > >ie, it's regexp not shell glob there > > =20 > >>this assumes you have cvsspam configured as DEFAULT, ie not as ALL >> >>On Monday 28 February 2005 18:34, Tim wrote: >> =20 >> >>>Is it possible for specify that no diffs should be sent for certain >>>files or files matching a glob or a regexp? For example to exclude all >>>the binary files or the Delphi form files. >>> =20 >>> > > =20 > From dave at badgers-in-foil.co.uk Mon Feb 28 17:31:00 2005 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Mon, 28 Feb 2005 17:31:00 +0000 Subject: [cvsspam-devel] Selectively exclude certain files from the diffs. In-Reply-To: <200502281921.57810.glen@delfi.ee> References: <42234809.80502@uckun.com> <200502281918.40374.glen@delfi.ee> <200502281921.57810.glen@delfi.ee> Message-ID: <20050228173059.GA26613@vhost.badgers-in-foil.co.uk> On Monday 28 February 2005 18:34, Tim wrote: > Is it possible for specify that no diffs should be sent for certain > files or files matching a glob or a regexp? For example to exclude all > the binary files or the Delphi form files. In addition to glen's suggestion, I recently implemented a feature such that we don't diff files that have the CVS -kb option[1] set. The patch is in the archive[2], and will appear in the next release. dave ---- [1] http://cvsbook.red-bean.com/cvsbook.html#Controlling%20Keyword%20Expansion [2] http://lists.badgers-in-foil.co.uk/pipermail/cvsspam-devel/2005-February/000283.html -- http://david.holroyd.me.uk/ From glen at delfi.ee Mon Feb 28 17:55:24 2005 From: glen at delfi.ee (Elan =?iso-8859-1?q?Ruusam=E4e?=) Date: Mon, 28 Feb 2005 19:55:24 +0200 Subject: [cvsspam-devel] Selectively exclude certain files from the diffs. In-Reply-To: <20050228173059.GA26613@vhost.badgers-in-foil.co.uk> References: <42234809.80502@uckun.com> <200502281921.57810.glen@delfi.ee> <20050228173059.GA26613@vhost.badgers-in-foil.co.uk> Message-ID: <200502281955.24677.glen@delfi.ee> On Monday 28 February 2005 19:31, David Holroyd wrote: > On Monday 28 February 2005 18:34, Tim wrote: > > Is it possible for specify that no diffs should be sent for certain > > files or files matching a glob or a regexp? For example to exclude all > > the binary files or the Delphi form files. > > In addition to glen's suggestion, I recently implemented a feature such > that we don't diff files that have the CVS -kb option[1] set. The patch is > in the archive[2], and will appear in the next release. yeah, that was the next idea i was about to suggest :), that you tag your files binary: 1. eighter by cvs admin -kb FILE 2. or add it to CVSROOT/cvswrappers: *.Z -k 'b' *.tar -k 'b' *.rpm -k 'b' *.patch -k 'o' *.diff -k 'o' ... i'd go for #2, because you need to have binary tag on files anyway, if you want the files being consistent after checkout :) -- glen From drfickle at us.ibm.com Mon Feb 28 23:10:32 2005 From: drfickle at us.ibm.com (Steve Fox) Date: Mon, 28 Feb 2005 17:10:32 -0600 Subject: [cvsspam-devel] record_lastdir.rb Insecure operation Message-ID: <1109632232.22534.34.camel@localhost.localdomain> I'm trying to set up CVSSPam in a SourceForge-like environment with one CVSSpam installation shared between multiple CVS repositories. Sometimes it works fine, but other times I see the below error. -------------------------------------------------------------------- Nothing in CVS/Entries for ., ., ., ., ., ., ., ., ., ., ., ., ., ., ., ., ., ., ., ., ., . /usr/local/cvsspam/record_lastdir.rb:16:in `stat': Insecure operation - stat (SecurityError) from /usr/local/cvsspam/record_lastdir.rb:16:in `find_data_dir' from /usr/local/cvsspam/record_lastdir.rb:15:in `each' from /usr/local/cvsspam/record_lastdir.rb:15:in `find_data_dir' from /usr/local/cvsspam/record_lastdir.rb:22 cvs commit: Pre-commit check failed cvs [commit aborted]: correct above errors first! Error, CVS operation failed -------------------------------------------------------------------- I did some Googling last week and found a suggestion to call an untaint function right before the stat() call, but it sounded kind of hackish. We're using CVS 1.11.18 and Ruby 1.6.7 on the server. The #cvsspam* directories created in /tmp have user ownership of the user performing the commit and group ownership of the project's unix group and permissions set 0700. Perhaps that is the problem? Is out umask too strict? I'd appreciate any help. Thanks. -- Steve Fox IBM Linux Technology Center http://www.ibm.com/linux/ltc http://k-lug.org