From vimr at hsf.cz Thu Aug 5 15:04:12 2004 From: vimr at hsf.cz (Jindrich Vimr) Date: Thu, 05 Aug 2004 17:04:12 +0200 Subject: [cvsspam-devel] Rubby warnings Message-ID: Hi... I've just installed the cvsspam-0.2.9, successfully configured it, but one thing appeared that I never saw on previous instalations of cvsspam (on other machines). after commiting some sources into cvs (part of real project) cvsspam (or rubby) shouts this: ------------rip--------------------- lx2:/tmp/cvsspam/old # cvs ci -m"new version" cvs commit: Examining . Checking in test; /daten/cvs/old/test,v <-- test new revision: 1.4; previous revision: 1.3 done /usr/local/lib/cvsspam/collect_diffs.rb:50: warning: Insecure world writable dir /jdezent/server, mode 040777 /usr/local/lib/cvsspam/collect_diffs.rb:50: warning: Insecure world writable dir /jdezent/server, mode 040777 /usr/local/lib/cvsspam/collect_diffs.rb:229: warning: Insecure world writable dir /jdezent/server, mode 040777 /usr/local/lib/cvsspam/cvsspam.rb:1347: warning: Insecure world writable dir /jdezent/server, mode 040777 ------------endof rip----------------------------- I've corrected the header line of all three cvsspam rubby scripts in /usr/local/lib/cvsspam/ from #!/usr/bin/ruby -w to #!/usr/bin/ruby (to disable warnings) but it had no effect. How do I disable this warnings? One think more - the directory IS world writable, but it is completly OUT OF CVSROOT - why is it checked? Thanks in advance Jindra Vimr -- Jindrich Vimr, HSF, spol. s r.o. Morseova 3, Plzen +420 724 293 903 From dave at badgers-in-foil.co.uk Thu Aug 5 15:25:35 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Thu, 5 Aug 2004 15:25:35 +0000 Subject: [cvsspam-devel] Rubby warnings In-Reply-To: References: Message-ID: <20040805152535.GA29135@vhost.badgers-in-foil.co.uk> On Thu, Aug 05, 2004 at 05:04:12PM +0200, Jindrich Vimr wrote: > after commiting some sources into cvs (part of real project) cvsspam (or > rubby) shouts this: > ------------rip--------------------- > lx2:/tmp/cvsspam/old # cvs ci -m"new version" > cvs commit: Examining . > Checking in test; > /daten/cvs/old/test,v <-- test > new revision: 1.4; previous revision: 1.3 > done > /usr/local/lib/cvsspam/collect_diffs.rb:50: warning: Insecure world > writable dir /jdezent/server, mode 040777 > /usr/local/lib/cvsspam/collect_diffs.rb:50: warning: Insecure world > writable dir /jdezent/server, mode 040777 > /usr/local/lib/cvsspam/collect_diffs.rb:229: warning: Insecure world > writable dir /jdezent/server, mode 040777 > /usr/local/lib/cvsspam/cvsspam.rb:1347: warning: Insecure world writable > dir /jdezent/server, mode 040777 > ------------endof rip----------------------------- > > I've corrected the header line of all three cvsspam rubby scripts in > /usr/local/lib/cvsspam/ from > #!/usr/bin/ruby -w > > to > #!/usr/bin/ruby Ok, well I didn't know what this was about, so I just did a quick google, which turned up this: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/86279 It appears this is due to a check that Ruby is doing when running external comands Does $PATH, in the environment in which CVS runs, include the current directory (i.e. '.'), or maybe '/jdezent/server' itself (or a subdirectory)? dave From dave at badgers-in-foil.co.uk Thu Aug 5 23:53:44 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Thu, 5 Aug 2004 23:53:44 +0000 Subject: [cvsspam-devel] Feature request: --nodiff option? In-Reply-To: <20040611114934.GB23769@vhost.badgers-in-foil.co.uk> References: <20040611114934.GB23769@vhost.badgers-in-foil.co.uk> Message-ID: <20040805235344.GA4021@vhost.badgers-in-foil.co.uk> --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jun 11, 2004 at 11:49:34AM +0000, David Holroyd wrote: > On Thu, Jun 10, 2004 at 11:02:40AM -0500, Adam Blomberg wrote: > > I would very much like to see the nodiff feature. A blue-sky request would > > also include the ability to remove the diff if the email will exceed a > > certain size. This would help to prevent 30+ megabyte emails caused by > > large commits. > I'll have a think about exither excluding the diff section, or maybe > trying to limit the numbers of diffs included depending on the size of > message generated so far. The attached patch implements a 'soft' limit on the amount of diff output added to the email. After the limit is passed, we stop adding diffs for any more files, and report how much output we skipped at the bottom of the email: "[Reached 6293 bytes of diffs. Since the limit is about 5120 bytes, a further 38058 were skipped.]" I've set the default limit to 2 megs. It would be great if someone could give it a try and see if it works in other setups. ta, dave --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="diff_size_limit-patch.diff" Index: cvsspam.rb =================================================================== RCS file: /var/lib/cvs/cvsspam/cvsspam.rb,v retrieving revision 1.49 diff -u -r1.49 cvsspam.rb --- cvsspam.rb 5 Aug 2004 19:14:15 -0000 1.49 +++ cvsspam.rb 5 Aug 2004 23:39:38 -0000 @@ -9,7 +9,7 @@ # TODO: exemplify syntax for 'cvs admin -m' when log message is missing # TODO: make max-line limit on diff output configurable -# TODO: put max size limit on whole email +# TODO: put more exact max size limit on whole email # TODO: support non-html mail too (text/plain, multipart/alternative) # If you want another 'todo keyword' (TODO & FIXME are highlighted by default) @@ -311,6 +311,7 @@ @repository = Repository.get(path) @repository.merge_common_prefix(basedir()) @isEmpty = @isBinary = false + @has_diff = nil end attr_accessor :path, :type, :lineAdditions, :lineRemovals, :isBinary, :isEmpty, :fromVer, :toVer @@ -353,6 +354,14 @@ def modification? @type == "M" end + + def has_diff=(diff) + @has_diff = diff if @has_diff.nil? + end + + def has_diff? + @has_diff + end end @@ -480,6 +489,9 @@ def consume(line) $file = FileEntry.new(line) + if $diff_output_limiter.choose_to_limit? + $file.has_diff = false + end $fileEntries << $file $file.tag = getTag handleFile($file) @@ -900,16 +912,106 @@ @colour.teardown end println("") # end of "file" div + $file.has_diff = true end end end end +# a filter that counts the number of characters output to the underlying object +class OutputCounter + # TODO: This should probably be a subclass of IO + # TODO: assumes unix end-of-line convention + + def initialize(io) + @io = io + # TODO: use real number of chars representing end of line (for platform) + @eol_size = 1 + @count = 0; + end + + def puts(text) + @count += text.length + @count += @eol_size unless text =~ /\n$/ + @io.puts(text) + end + + def print(text) + @count += text.length + @io.print(text) + end + + attr_reader :count +end + + +# a filter that can be told to stop outputing data to the underlying object +class OutputDropper + def initialize(io) + @io = io + @drop = false + end + + def puts(text) + @io.puts(text) unless @drop + end + + def print(text) + @io.print(text) unless @drop + end + + attr_accessor :drop +end + + +# TODO: the current implementation of the size-limit continues to generate +# HTML-ified diff output, but doesn't add it to the email. This means we +# can report 'what you would have won', but is less efficient than turning +# of the diff highlighting code. Does this matter? +# Counts the amount of data written, and when choose_to_limit? is called, +# checks this count against the configured limit, discarding any further +# output if the limit is exceeded. We aren't strict about the limit becase +# we don't want to chop-off the end of a tag and produce invalid HTML, etc. +class OutputSizeLimiter + def initialize(io, limit) + @dropper = OutputDropper.new(io) + @counter = OutputCounter.new(@dropper) + @limit = limit + @written_count = nil + end + def puts(text) + @counter.puts(text) + end + def print(text) + @counter.print(text) + end + def choose_to_limit? + return true if @dropper.drop + if @counter.count >= @limit + @dropper.drop = true + @written_count = @counter.count + return true + end + return false + end + + def total_count + @counter.count + end + + def written_count + if @written_count.nil? + total_count + else + @written_count + end + end +end cvsroot_dir = "#{ENV['CVSROOT']}/CVSROOT" @@ -932,6 +1034,8 @@ $files_in_subject = false; $smtp_host = nil $repository_name = nil +# 2MiB limit on attached diffs, +$mail_size_limit = 1024 * 1024 * 2 require 'getoptlong' @@ -1046,6 +1150,8 @@ File.open("#{$logfile}.emailtmp", File::RDWR|File::CREAT|File::TRUNC) do |mail| + $diff_output_limiter = OutputSizeLimiter.new(mail, $mail_size_limit) + File.open($logfile) do |log| reader = LogReader.new(log) @@ -1054,9 +1160,10 @@ if handler == nil raise "No handler file lines marked '##{reader.currentLineCode}'" end - handler.handleLines(reader.getLines, mail) + handler.handleLines(reader.getLines, $diff_output_limiter) end end + end if $subjectPrefix == nil @@ -1199,10 +1306,10 @@ elsif file.removal? name = "#{name}" end - if file.isEmpty || file.isBinary || (file.removal? && $no_removed_file_diff) - mail.print("#{prefix}#{name}") - else + if file.has_diff? mail.print("#{prefix}#{name}") + else + mail.print("#{prefix}#{name}") end if file.isEmpty mail.print("[empty]") @@ -1298,6 +1405,11 @@ input.each do |line| mail.puts(line.chomp) end + end + if $diff_output_limiter.choose_to_limit? + mail.puts("

[Reached #{$diff_output_limiter.written_count} bytes of diffs.") + mail.puts("Since the limit is about #{$mail_size_limit} bytes,") + mail.puts("a further #{$diff_output_limiter.total_count-$diff_output_limiter.written_count} were skipped.]

") end if $debug blah("leaving file #{$logfile}.emailtmp") --7AUc2qLy4jB3hD7Z-- From jerome at coffeebreaks.org Sun Aug 8 11:17:48 2004 From: jerome at coffeebreaks.org (Jerome Lacoste) Date: Sun, 08 Aug 2004 13:17:48 +0200 Subject: [cvsspam-devel] [Fwd: CVS spam log handler] In-Reply-To: <20031204124621.GA14785@vhost.badgers-in-foil.co.uk> References: <1070537088.15668.64.camel@expresso> <20031204124621.GA14785@vhost.badgers-in-foil.co.uk> Message-ID: <1091963868.12675.36.camel@dolcevita.localnet> On Thu, 2003-12-04 at 12:46 +0000, David Holroyd wrote: > On Thu, Dec 04, 2003 at 12:24:48PM +0100, Jerome Lacoste wrote: > > Hi > > > > wanted to share that with the users/developers of CVSspam. I partly > > chose to use cvsspam because of its Jira support. Now here's a CVS spam > > support for Jira. > > > > "la boucle est boucl?e" > > Thank you! > > Completing the circle by adding entries into Bugzilla/Jira/etc. is > something I plan to support within the CVSspam scripts themselves, one > day. > > > > Feel free to contact me for ideas. > > Any ideas for improvement are welcome. (The TODO file overfloweth :) > > > [PS Are you able to make that file available somewhere on the web?] Hi CVSSpam and Jira users, I finally got the time to put the code that integrates Jira and CVSSpam on the web. It's current address is under the following page: http://btcorp.dyndns.org:8180/confluence/display/OSS/Patches The domain name will probably change before the end of the year. When the address changes, go on http://www.coffeebreaks.org/~jerome/ to find the new location. Happy integration! Cheers, Jerome From jerome at coffeebreaks.org Thu Aug 12 12:01:35 2004 From: jerome at coffeebreaks.org (Jerome Lacoste) Date: Thu, 12 Aug 2004 14:01:35 +0200 Subject: [cvsspam-devel] Don't manage to setup cvsspam on one machine Message-ID: <1092312095.22139.5.camel@dolcevita.localnet> I am tired of this. I've had problem with cvs-syncmail (some SMTP problems with it), so I am back with cvsspam, which I managed to setup before without problems in other machines, but I can't make it work on that one. First the documentation is wrong In 1.1.1. Installation Using CVS I think one should add cvsspam.conf to the list of files to be in cvscheckout With regards to 1.2. Configure CVS, commitinfo format has changed and now expects arguments. I am now using ^CVSROOT /bin/true %r/%p %{s} DEFAULT $CVSROOT/CVSROOT/record_lastdir.rb %r/%p %{s} But I don't know if that's correct Now my loginfo files: ^CVSROOT $CVSROOT/CVSROOT/collect_diffs.rb --to %{sVv} ^test $CVSROOT/CVSROOT/collect_diffs.rb --to %{sVv} Of course is something like xxx@yyy.zzz. But this doesn't work: I end up with an error: Expected arguments missing * You shouldn't run collect_diffs by hand, but from a CVSROOT/loginfo entry * Usage: collect_diffs.rb [ --to ] [ --config ] %{sVv} (the sequence '%{sVv}' is expanded by CVS, when found in CVSROOT/loginfo) So I've added just before the error happens $stderr.puts " ARGV "+ARGV.join(", ") And I get ARGV --to, , file.txt, 1.33, 1.34 So what is the problem? Is that a cvs format change? I am using CVS 1.12.9 Jerome From jerome at coffeebreaks.org Thu Aug 12 12:02:10 2004 From: jerome at coffeebreaks.org (Jerome Lacoste) Date: Thu, 12 Aug 2004 14:02:10 +0200 Subject: [cvsspam-devel] Don't manage to setup cvsspam on one machine Message-ID: <1092312130.22139.7.camel@dolcevita.localnet> I am tired of this. I've had problem with cvs-syncmail (some SMTP problems with it), so I am back with cvsspam, which I managed to setup before without problems in other machines, but I can't make it work on that one. First the documentation is wrong In 1.1.1. Installation Using CVS I think one should add cvsspam.conf to the list of files to be in cvscheckout With regards to 1.2. Configure CVS, commitinfo format has changed and now expects arguments. I am now using ^CVSROOT /bin/true %r/%p %{s} DEFAULT $CVSROOT/CVSROOT/record_lastdir.rb %r/%p %{s} But I don't know if that's correct Now my loginfo files: ^CVSROOT $CVSROOT/CVSROOT/collect_diffs.rb --to %{sVv} ^test $CVSROOT/CVSROOT/collect_diffs.rb --to %{sVv} Of course is something like xxx@yyy.zzz. But this doesn't work: I end up with an error: Expected arguments missing * You shouldn't run collect_diffs by hand, but from a CVSROOT/loginfo entry * Usage: collect_diffs.rb [ --to ] [ --config ] %{sVv} (the sequence '%{sVv}' is expanded by CVS, when found in CVSROOT/loginfo) So I've added just before the error happens $stderr.puts " ARGV "+ARGV.join(", ") And I get ARGV --to, , file.txt, 1.33, 1.34 So what is the problem? Is that a cvs format change? I am using CVS 1.12.9 PS I am online (chat/IM) for anyone who wants to help me solve that problem quickly. Jerome From jerome at coffeebreaks.org Thu Aug 12 12:29:06 2004 From: jerome at coffeebreaks.org (Jerome Lacoste) Date: Thu, 12 Aug 2004 14:29:06 +0200 Subject: [cvsspam-devel] Re: Don't manage to setup cvsspam on one machine In-Reply-To: <1092312130.22139.7.camel@dolcevita.localnet> References: <1092312130.22139.7.camel@dolcevita.localnet> Message-ID: <1092313746.22139.11.camel@dolcevita.localnet> Hi, sorry if this mail was sent duplicated, it was an evolution bug. Of couse, I've found a workaround 2 min after I sent the mail... I've managed to make it work by making UseNewInfoFmtStrings=no so it appears to be a compatibility problem with new CVS. I am still interested in any info to solve the problem correctly. Jerome On Thu, 2004-08-12 at 14:02 +0200, Jerome Lacoste wrote: > I am tired of this. I've had problem with cvs-syncmail (some SMTP > problems with it), so I am back with cvsspam, which I managed to setup > before without problems in other machines, but I can't make it work on > that one. > > First the documentation is wrong > > In 1.1.1. Installation Using CVS > > I think one should add cvsspam.conf to the list of files to be in > cvscheckout > > With regards to 1.2. Configure CVS, commitinfo format has changed and > now expects arguments. > > I am now using > > ^CVSROOT /bin/true %r/%p %{s} > DEFAULT $CVSROOT/CVSROOT/record_lastdir.rb %r/%p %{s} > > But I don't know if that's correct > > Now my loginfo files: > > ^CVSROOT $CVSROOT/CVSROOT/collect_diffs.rb --to %{sVv} > ^test $CVSROOT/CVSROOT/collect_diffs.rb --to %{sVv} > > Of course is something like xxx@yyy.zzz. > > But this doesn't work: I end up with an error: > > Expected arguments missing > * You shouldn't run collect_diffs by hand, but from a CVSROOT/loginfo > entry * > Usage: collect_diffs.rb [ --to ] [ --config ] %{sVv} > (the sequence '%{sVv}' is expanded by CVS, when found in > CVSROOT/loginfo) > > > So I've added just before the error happens > $stderr.puts " ARGV "+ARGV.join(", ") > > And I get > > ARGV --to, , file.txt, 1.33, 1.34 > > So what is the problem? > > Is that a cvs format change? I am using CVS 1.12.9 > > PS I am online (chat/IM) for anyone who wants to help me solve that problem quickly. > > Jerome From dave at badgers-in-foil.co.uk Thu Aug 12 13:21:30 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Thu, 12 Aug 2004 13:21:30 +0000 Subject: [cvsspam-devel] Re: collect_diffs.rb : Expected arguments missing In-Reply-To: <1092313746.22139.11.camel@dolcevita.localnet> References: <1092312130.22139.7.camel@dolcevita.localnet> <1092313746.22139.11.camel@dolcevita.localnet> Message-ID: <20040812132130.GA3489@vhost.badgers-in-foil.co.uk> On Thu, Aug 12, 2004 at 02:29:06PM +0200, Jerome Lacoste wrote: > On Thu, 2004-08-12 at 14:02 +0200, Jerome Lacoste wrote: > > In 1.1.1. Installation Using CVS > > > > I think one should add cvsspam.conf to the list of files to be in > > cvscheckout The documentation is rather unclear. It mentions that this needs to be done, but in a completely different section :( > > With regards to 1.2. Configure CVS, commitinfo format has changed and > > now expects arguments. > > > > I am now using > > > > ^CVSROOT /bin/true %r/%p %{s} > > DEFAULT $CVSROOT/CVSROOT/record_lastdir.rb %r/%p %{s} > > > > But I don't know if that's correct > > > > Now my loginfo files: > > > > ^CVSROOT $CVSROOT/CVSROOT/collect_diffs.rb --to %{sVv} > > ^test $CVSROOT/CVSROOT/collect_diffs.rb --to %{sVv} > > > > Of course is something like xxx@yyy.zzz. > > > > But this doesn't work: I end up with an error: > > > > Expected arguments missing > > * You shouldn't run collect_diffs by hand, but from a CVSROOT/loginfo > > entry * > > Usage: collect_diffs.rb [ --to ] [ --config ] %{sVv} > > (the sequence '%{sVv}' is expanded by CVS, when found in > > CVSROOT/loginfo) > > > > > > So I've added just before the error happens > > $stderr.puts " ARGV "+ARGV.join(", ") > > > > And I get > > > > ARGV --to, , file.txt, 1.33, 1.34 > > > > So what is the problem? > > > > Is that a cvs format change? I am using CVS 1.12.9 > > Of couse, I've found a workaround 2 min after I sent the mail... > I've managed to make it work by making > UseNewInfoFmtStrings=no > > so it appears to be a compatibility problem with new CVS. This change was introduced in the CVS 1.12.x 'feature' series -- CVSspam currently expects the format used by the 1.11.x 'stable' series. I actually spotted this problem a week ago, when testing out CVSspam on my newly-installed laptop. I've made changes that will eventually allow CVSspam to accept both formats, but I need to add in some code to parse CVSROOT/config in order to decide which mode is required. The change in format is actually a great improvement for scripts like CVSspam. Parsing the single-argument-value CVS used to pass was ambiguous, and could be fooled by strange filenames. CVS now passes each token as a seperate argument, so fiddly parsing isn't necessary. The *old* format is actually CVS's default (for the moment), in the absence of any config setting. However, when CVS 1.12.x creates a new repository, the generated config file has, UseNewInfoFmtStrings=yes (as you've just found out). Until I finish up support for CVS 1.12.x, you'll need to change this setting value to 'no'. (thanks for the bug report!) dave From jerome at coffeebreaks.org Thu Aug 12 15:37:31 2004 From: jerome at coffeebreaks.org (Jerome Lacoste) Date: Thu, 12 Aug 2004 17:37:31 +0200 Subject: [cvsspam-devel] Re: collect_diffs.rb : Expected arguments missing In-Reply-To: <20040812132130.GA3489@vhost.badgers-in-foil.co.uk> References: <1092312130.22139.7.camel@dolcevita.localnet> <1092313746.22139.11.camel@dolcevita.localnet> <20040812132130.GA3489@vhost.badgers-in-foil.co.uk> Message-ID: <1092325051.22139.42.camel@dolcevita.localnet> On Thu, 2004-08-12 at 13:21 +0000, David Holroyd wrote: > On Thu, Aug 12, 2004 at 02:29:06PM +0200, Jerome Lacoste wrote: > > On Thu, 2004-08-12 at 14:02 +0200, Jerome Lacoste wrote: > > > In 1.1.1. Installation Using CVS > > > > > > I think one should add cvsspam.conf to the list of files to be in > > > cvscheckout > > The documentation is rather unclear. It mentions that this needs to be > done, but in a completely different section :( OK. I just read the sections I thought I had to read :) [...] > > > Is that a cvs format change? I am using CVS 1.12.9 > > > > Of couse, I've found a workaround 2 min after I sent the mail... > > I've managed to make it work by making > > UseNewInfoFmtStrings=no > > > > so it appears to be a compatibility problem with new CVS. > > This change was introduced in the CVS 1.12.x 'feature' series -- CVSspam > currently expects the format used by the 1.11.x 'stable' series. > > I actually spotted this problem a week ago, when testing out CVSspam on > my newly-installed laptop. I've made changes that will eventually allow > CVSspam to accept both formats, but I need to add in some code to parse > CVSROOT/config in order to decide which mode is required. > > The change in format is actually a great improvement for scripts like > CVSspam. Parsing the single-argument-value CVS used to pass was > ambiguous, and could be fooled by strange filenames. CVS now passes each > token as a seperate argument, so fiddly parsing isn't necessary. > > > The *old* format is actually CVS's default (for the moment), in the absence > of any config setting. However, when CVS 1.12.x creates a new repository, > the generated config file has, Ah because I just created a new repository on a machine. Hence the problem. > UseNewInfoFmtStrings=yes > > (as you've just found out). Until I finish up support for CVS 1.12.x, > you'll need to change this setting value to 'no'. OK. > (thanks for the bug report!) When your script stabilizes, feel free to point me to a beta or send me a patch so that I can test it. Thanks for your fast feedback. Jerome From dave at badgers-in-foil.co.uk Sat Aug 14 15:49:31 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Sat, 14 Aug 2004 15:49:31 +0000 Subject: [cvsspam-devel] Re: collect_diffs.rb : Expected arguments missing In-Reply-To: <1092325051.22139.42.camel@dolcevita.localnet> References: <1092312130.22139.7.camel@dolcevita.localnet> <1092313746.22139.11.camel@dolcevita.localnet> <20040812132130.GA3489@vhost.badgers-in-foil.co.uk> <1092325051.22139.42.camel@dolcevita.localnet> Message-ID: <20040814154931.GA12796@vhost.badgers-in-foil.co.uk> --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 12, 2004 at 05:37:31PM +0200, Jerome Lacoste wrote: > When your script stabilizes, feel free to point me to a beta or send me a > patch so that I can test it. The attached patch should pick up the new CVS 1.12.x config option without any further intervention. Let me know if it doesn't 'just work'. dave --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="UseNewInfoFmtStrings-patch.diff" Index: collect_diffs.rb =================================================================== RCS file: /var/lib/cvs/cvsspam/collect_diffs.rb,v retrieving revision 1.16 diff -u -r1.16 collect_diffs.rb --- collect_diffs.rb 21 Jan 2004 10:41:29 -0000 1.16 +++ collect_diffs.rb 14 Aug 2004 15:38:42 -0000 @@ -92,6 +92,46 @@ return $commitinfo_tags[filename] end + +# cvs_info comes from the command line, ultimately as the expansion of the +# %{sVv} in $CVSROOT/loginfo. It isn't possible to parse this value +# unambiguously, but we make an effort to get it right in as many cases as +# possible. +def collect_antique_style_args(cvs_info) + unless cvs_info.slice(0, $repository_path.length+1) == "#{$repository_path} " + fail "calculated repository path ('#{$repository_path}') doesn't match start of command line arg ('#{cvs_info}')" + end + + version_info = cvs_info.slice($repository_path.length, + cvs_info.length-$repository_path.length) + + changes = Array.new + # make a list of changed files given on the command line + while version_info.length>0 + if version_info.sub!(/^ (.+?),(NONE|[.0-9]+),(NONE|[.0-9]+)/, '') == nil + fail "'#{version_info}' doesn't match ' ,, ...'" + end + changes << ChangeInfo.new($1, $2, $3) + end + + return changes +end + + +def collect_modern_style_args(cvs_info) +# unless cvs_info[0] == $repository_path +# fail "calculated repository path ('#{$repository_path}') doesn't match first command line arg ('#{cvs_info[0]}')" +# end + changes = Array.new + i = 0 + while i < cvs_info.length + changes << ChangeInfo.new(cvs_info[i], cvs_info[i+=1], cvs_info[i+=1]) + i+=1 + end + return changes +end + + def process_log(cvs_info) cvsroot = ENV['CVSROOT'] @@ -104,31 +144,17 @@ fail "Log preamble looks suspect (doesn't start 'Update of ...')" end - # cvs_info comes from the command line, ultimately as the expansion of the - # %{sVv} in $CVSROOT/loginfo. It isn't possible to parse this value - # unambiguously, but we make an effort to get it right in as many cases as - # possible. - $path = $1 unless $path.slice(0,cvsroot.length) == cvsroot fail "CVSROOT ('#{cvsroot}') doesn't match log preamble ('#{$path}')" end $repository_path = $path.slice(cvsroot.length+1, $path.length-cvsroot.length-1) - unless cvs_info.slice(0, $repository_path.length+1) == "#{$repository_path} " - fail "calculated repository path ('#{$repository_path}') doesn't match start of command line arg ('#{cvs_info}')" - end - version_info = cvs_info.slice($repository_path.length, - cvs_info.length-$repository_path.length) - - changes = Array.new - # make a list of changed files given on the command line - while version_info.length>0 - if version_info.sub!(/^ (.+?),(NONE|[.0-9]+),(NONE|[.0-9]+)/, '') == nil - fail "'#{version_info}' doesn't match ' ,, ...'" - end - changes << ChangeInfo.new($1, $2, $3) + if $use_modern_argument_list + changes = collect_modern_style_args(cvs_info) + else + changes = collect_antique_style_args(cvs_info) end # look for the start of the user's comment @@ -159,7 +185,7 @@ safer_popen($cvs_prog, "-nq", "status", change.file) do |io| status = io.read end - fail "couldn't get cvs status: #{$!}" unless ($?>>8)==0 + fail "couldn't get cvs status: #{$!} (exited with #{$?})" unless ($?>>8)==0 if status =~ /^\s*Sticky Tag:\s*(.+) \(branch: +/m tag = $1 @@ -242,6 +268,34 @@ end end + +class CVSConfig + def initialize(filename) + @data = Hash.new + File.open(filename) do |io| + read(io) + end + end + + def read(io) + io.each do |line| + parse_line(line) + end + end + + def parse_line(line) + # strip any comment (assumes values can't contain '#') + line.sub!(/#.*$/, "") + if line =~ /^\s*(.*?)\s*=\s*(.*?)\s*$/ + @data[$1] = $2 + end + end + + def [](key) + @data[key] + end +end + $config = nil $cvs_prog = "cvs" $debug = false @@ -276,11 +330,13 @@ end blah("CVSROOT is #{ENV['CVSROOT']}") -blah("ARGV is '#{ARGV.join(', ')}'") +blah("ARGV is <#{ARGV.join('>, <')}>") + +cvsroot_dir = "#{ENV['CVSROOT']}/CVSROOT" if $config == nil - if FileTest.exists?("#{ENV['CVSROOT']}/CVSROOT/cvsspam.conf") - $config = "#{ENV['CVSROOT']}/CVSROOT/cvsspam.conf" + if FileTest.exists?("#{cvsroot_dir}/cvsspam.conf") + $config = "#{cvsroot_dir}/cvsspam.conf" elsif FileTest.exists?("/etc/cvsspam/cvsspam.conf") $config = "/etc/cvsspam/cvsspam.conf" end @@ -290,6 +346,10 @@ end end +cvs_config = CVSConfig.new("#{cvsroot_dir}/config") + +$use_modern_argument_list = $cvs_config["UseNewInfoFmtStrings"] == "yes" + if $config != nil if FileTest.exists?($config) def addHeader(name,val) @@ -304,11 +364,18 @@ end end -if ARGV.length != 1 - $stderr.puts "Expected arguments missing" - $stderr.puts "* You shouldn't run collect_diffs by hand, but from a CVSROOT/loginfo entry *" - $stderr.puts "Usage: collect_diffs.rb [ --to ] [ --config ] %{sVv}" - $stderr.puts " (the sequence '%{sVv}' is expanded by CVS, when found in CVSROOT/loginfo)" - exit +if $use_modern_argument_list + if ARGV.length % 3 != 0 + $stderr.puts "Expected 3 arguments for each file" + end + choose_operation(ARGV) +else + if ARGV.length != 1 + $stderr.puts "Expected arguments missing" + $stderr.puts "* You shouldn't run collect_diffs by hand, but from a CVSROOT/loginfo entry *" + $stderr.puts "Usage: collect_diffs.rb [ --to ] [ --config ] %{sVv}" + $stderr.puts " (the sequence '%{sVv}' is expanded by CVS, when found in CVSROOT/loginfo)" + exit + end + choose_operation(ARGV[0]) end -choose_operation(ARGV[0]) --LZvS9be/3tNcYl/X-- From jerome at coffeebreaks.org Sat Aug 14 16:36:08 2004 From: jerome at coffeebreaks.org (Jerome Lacoste) Date: Sat, 14 Aug 2004 18:36:08 +0200 Subject: [cvsspam-devel] Re: collect_diffs.rb : Expected arguments missing In-Reply-To: <20040814154931.GA12796@vhost.badgers-in-foil.co.uk> References: <1092312130.22139.7.camel@dolcevita.localnet> <1092313746.22139.11.camel@dolcevita.localnet> <20040812132130.GA3489@vhost.badgers-in-foil.co.uk> <1092325051.22139.42.camel@dolcevita.localnet> <20040814154931.GA12796@vhost.badgers-in-foil.co.uk> Message-ID: <1092501368.14213.7.camel@dolcevita.localnet> --=-ielv/V9jxRFiVHEdEffY Content-Type: text/plain Content-Transfer-Encoding: 7bit On Sat, 2004-08-14 at 15:49 +0000, David Holroyd wrote: > On Thu, Aug 12, 2004 at 05:37:31PM +0200, Jerome Lacoste wrote: > > When your script stabilizes, feel free to point me to a beta or send me a > > patch so that I can test it. > > The attached patch should pick up the new CVS 1.12.x config option > without any further intervention. > > Let me know if it doesn't 'just work'. It didn't just work. But almost :) I had to add a $ line 351 in patched file to a avoid the following problem: /var/lib/cvs/CVSROOT/collect_diffs.rb:351: warning: global variable ` $cvs_config' not initialized /var/lib/cvs/CVSROOT/collect_diffs.rb:351: undefined method `[]' for nil:NilClass (NoMethodError) Attached is the tested fixed patch. I've tested and received 2 mails out of 3 test checkins (first one missing). But I believe the first 'miss' being an MTA issue. Thanks for your work. I guess that 0.2.10 is not far off now ;) Jerome --=-ielv/V9jxRFiVHEdEffY Content-Disposition: attachment; filename=UseNewInfoFmtStrings-patch.diff2 Content-Type: text/plain; name=UseNewInfoFmtStrings-patch.diff2; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 7bit --- collect_diffs.rb.old 2004-08-12 14:16:19.000000000 +0200 +++ collect_diffs.rb 2004-08-14 18:13:57.000000000 +0200 @@ -92,6 +92,46 @@ return $commitinfo_tags[filename] end + +# cvs_info comes from the command line, ultimately as the expansion of the +# %{sVv} in $CVSROOT/loginfo. It isn't possible to parse this value +# unambiguously, but we make an effort to get it right in as many cases as +# possible. +def collect_antique_style_args(cvs_info) + unless cvs_info.slice(0, $repository_path.length+1) == "#{$repository_path} " + fail "calculated repository path ('#{$repository_path}') doesn't match start of command line arg ('#{cvs_info}')" + end + + version_info = cvs_info.slice($repository_path.length, + cvs_info.length-$repository_path.length) + + changes = Array.new + # make a list of changed files given on the command line + while version_info.length>0 + if version_info.sub!(/^ (.+?),(NONE|[.0-9]+),(NONE|[.0-9]+)/, '') == nil + fail "'#{version_info}' doesn't match ' ,, ...'" + end + changes << ChangeInfo.new($1, $2, $3) + end + + return changes +end + + +def collect_modern_style_args(cvs_info) +# unless cvs_info[0] == $repository_path +# fail "calculated repository path ('#{$repository_path}') doesn't match first command line arg ('#{cvs_info[0]}')" +# end + changes = Array.new + i = 0 + while i < cvs_info.length + changes << ChangeInfo.new(cvs_info[i], cvs_info[i+=1], cvs_info[i+=1]) + i+=1 + end + return changes +end + + def process_log(cvs_info) cvsroot = ENV['CVSROOT'] @@ -104,31 +144,17 @@ fail "Log preamble looks suspect (doesn't start 'Update of ...')" end - # cvs_info comes from the command line, ultimately as the expansion of the - # %{sVv} in $CVSROOT/loginfo. It isn't possible to parse this value - # unambiguously, but we make an effort to get it right in as many cases as - # possible. - $path = $1 unless $path.slice(0,cvsroot.length) == cvsroot fail "CVSROOT ('#{cvsroot}') doesn't match log preamble ('#{$path}')" end $repository_path = $path.slice(cvsroot.length+1, $path.length-cvsroot.length-1) - unless cvs_info.slice(0, $repository_path.length+1) == "#{$repository_path} " - fail "calculated repository path ('#{$repository_path}') doesn't match start of command line arg ('#{cvs_info}')" - end - version_info = cvs_info.slice($repository_path.length, - cvs_info.length-$repository_path.length) - - changes = Array.new - # make a list of changed files given on the command line - while version_info.length>0 - if version_info.sub!(/^ (.+?),(NONE|[.0-9]+),(NONE|[.0-9]+)/, '') == nil - fail "'#{version_info}' doesn't match ' ,, ...'" - end - changes << ChangeInfo.new($1, $2, $3) + if $use_modern_argument_list + changes = collect_modern_style_args(cvs_info) + else + changes = collect_antique_style_args(cvs_info) end # look for the start of the user's comment @@ -159,7 +185,7 @@ safer_popen($cvs_prog, "-nq", "status", change.file) do |io| status = io.read end - fail "couldn't get cvs status: #{$!}" unless ($?>>8)==0 + fail "couldn't get cvs status: #{$!} (exited with #{$?})" unless ($?>>8)==0 if status =~ /^\s*Sticky Tag:\s*(.+) \(branch: +/m tag = $1 @@ -242,6 +268,34 @@ end end + +class CVSConfig + def initialize(filename) + @data = Hash.new + File.open(filename) do |io| + read(io) + end + end + + def read(io) + io.each do |line| + parse_line(line) + end + end + + def parse_line(line) + # strip any comment (assumes values can't contain '#') + line.sub!(/#.*$/, "") + if line =~ /^\s*(.*?)\s*=\s*(.*?)\s*$/ + @data[$1] = $2 + end + end + + def [](key) + @data[key] + end +end + $config = nil $cvs_prog = "cvs" $debug = false @@ -276,11 +330,13 @@ end blah("CVSROOT is #{ENV['CVSROOT']}") -blah("ARGV is '#{ARGV.join(', ')}'") +blah("ARGV is <#{ARGV.join('>, <')}>") + +cvsroot_dir = "#{ENV['CVSROOT']}/CVSROOT" if $config == nil - if FileTest.exists?("#{ENV['CVSROOT']}/CVSROOT/cvsspam.conf") - $config = "#{ENV['CVSROOT']}/CVSROOT/cvsspam.conf" + if FileTest.exists?("#{cvsroot_dir}/cvsspam.conf") + $config = "#{cvsroot_dir}/cvsspam.conf" elsif FileTest.exists?("/etc/cvsspam/cvsspam.conf") $config = "/etc/cvsspam/cvsspam.conf" end @@ -290,6 +346,10 @@ end end +$cvs_config = CVSConfig.new("#{cvsroot_dir}/config") + +$use_modern_argument_list = $cvs_config["UseNewInfoFmtStrings"] == "yes" + if $config != nil if FileTest.exists?($config) def addHeader(name,val) @@ -304,11 +364,18 @@ end end -if ARGV.length != 1 - $stderr.puts "Expected arguments missing" - $stderr.puts "* You shouldn't run collect_diffs by hand, but from a CVSROOT/loginfo entry *" - $stderr.puts "Usage: collect_diffs.rb [ --to ] [ --config ] %{sVv}" - $stderr.puts " (the sequence '%{sVv}' is expanded by CVS, when found in CVSROOT/loginfo)" - exit +if $use_modern_argument_list + if ARGV.length % 3 != 0 + $stderr.puts "Expected 3 arguments for each file" + end + choose_operation(ARGV) +else + if ARGV.length != 1 + $stderr.puts "Expected arguments missing" + $stderr.puts "* You shouldn't run collect_diffs by hand, but from a CVSROOT/loginfo entry *" + $stderr.puts "Usage: collect_diffs.rb [ --to ] [ --config ] %{sVv}" + $stderr.puts " (the sequence '%{sVv}' is expanded by CVS, when found in CVSROOT/loginfo)" + exit + end + choose_operation(ARGV[0]) end -choose_operation(ARGV[0]) --=-ielv/V9jxRFiVHEdEffY-- From dave at badgers-in-foil.co.uk Tue Aug 17 00:29:31 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 17 Aug 2004 00:29:31 +0000 Subject: [cvsspam-devel] collect_diffs.rb : Expected arguments missing In-Reply-To: <1092501368.14213.7.camel@dolcevita.localnet> References: <1092312130.22139.7.camel@dolcevita.localnet> <1092313746.22139.11.camel@dolcevita.localnet> <20040812132130.GA3489@vhost.badgers-in-foil.co.uk> <1092325051.22139.42.camel@dolcevita.localnet> <20040814154931.GA12796@vhost.badgers-in-foil.co.uk> <1092501368.14213.7.camel@dolcevita.localnet> Message-ID: <20040817002931.GA26281@vhost.badgers-in-foil.co.uk> --7JfCtLOvnd9MIVvH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Aug 14, 2004 at 06:36:08PM +0200, Jerome Lacoste wrote: > On Sat, 2004-08-14 at 15:49 +0000, David Holroyd wrote: > > On Thu, Aug 12, 2004 at 05:37:31PM +0200, Jerome Lacoste wrote: > > > When your script stabilizes, feel free to point me to a beta or send me a > > > patch so that I can test it. > > > > The attached patch should pick up the new CVS 1.12.x config option > > without any further intervention. > > > > Let me know if it doesn't 'just work'. > > It didn't just work. But almost :) > > I had to add a $ line 351 in patched file to a avoid the following > problem: > > /var/lib/cvs/CVSROOT/collect_diffs.rb:351: warning: global variable ` $cvs_config' not initialized > /var/lib/cvs/CVSROOT/collect_diffs.rb:351: undefined method `[]' for nil:NilClass (NoMethodError) Oops. Shouldn't change things at the last minute. Anyway, the attached patch fixes the problem you noticed, and also copes with another data-format change in the CVS 1.12.x series: Newer versions of CVS don't just tell us... 'somedir - New directory' ...when we run 'cvs add somedir'. The syntax is now extended to... 'somedir - New directory,NONE,NONE' ...which is sort-of consistent with the messages passed for normal files (where 'NONE' will usually be a file revision number). CVSspam now accepts either form. dave --7JfCtLOvnd9MIVvH Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="UseNewInfoFmtStrings-patch3.diff" Index: collect_diffs.rb =================================================================== RCS file: /var/lib/cvs/cvsspam/collect_diffs.rb,v retrieving revision 1.16 diff -u -r1.16 collect_diffs.rb --- collect_diffs.rb 21 Jan 2004 10:41:29 -0000 1.16 +++ collect_diffs.rb 17 Aug 2004 00:06:24 -0000 @@ -92,6 +92,46 @@ return $commitinfo_tags[filename] end + +# cvs_info comes from the command line, ultimately as the expansion of the +# %{sVv} in $CVSROOT/loginfo. It isn't possible to parse this value +# unambiguously, but we make an effort to get it right in as many cases as +# possible. +def collect_antique_style_args(cvs_info) + unless cvs_info.slice(0, $repository_path.length+1) == "#{$repository_path} " + fail "calculated repository path ('#{$repository_path}') doesn't match start of command line arg ('#{cvs_info}')" + end + + version_info = cvs_info.slice($repository_path.length, + cvs_info.length-$repository_path.length) + + changes = Array.new + # make a list of changed files given on the command line + while version_info.length>0 + if version_info.sub!(/^ (.+?),(NONE|[.0-9]+),(NONE|[.0-9]+)/, '') == nil + fail "'#{version_info}' doesn't match ' ,, ...'" + end + changes << ChangeInfo.new($1, $2, $3) + end + + return changes +end + + +def collect_modern_style_args(cvs_info) +# unless cvs_info[0] == $repository_path +# fail "calculated repository path ('#{$repository_path}') doesn't match first command line arg ('#{cvs_info[0]}')" +# end + changes = Array.new + i = 0 + while i < cvs_info.length + changes << ChangeInfo.new(cvs_info[i], cvs_info[i+=1], cvs_info[i+=1]) + i+=1 + end + return changes +end + + def process_log(cvs_info) cvsroot = ENV['CVSROOT'] @@ -104,31 +144,17 @@ fail "Log preamble looks suspect (doesn't start 'Update of ...')" end - # cvs_info comes from the command line, ultimately as the expansion of the - # %{sVv} in $CVSROOT/loginfo. It isn't possible to parse this value - # unambiguously, but we make an effort to get it right in as many cases as - # possible. - $path = $1 unless $path.slice(0,cvsroot.length) == cvsroot fail "CVSROOT ('#{cvsroot}') doesn't match log preamble ('#{$path}')" end $repository_path = $path.slice(cvsroot.length+1, $path.length-cvsroot.length-1) - unless cvs_info.slice(0, $repository_path.length+1) == "#{$repository_path} " - fail "calculated repository path ('#{$repository_path}') doesn't match start of command line arg ('#{cvs_info}')" - end - version_info = cvs_info.slice($repository_path.length, - cvs_info.length-$repository_path.length) - - changes = Array.new - # make a list of changed files given on the command line - while version_info.length>0 - if version_info.sub!(/^ (.+?),(NONE|[.0-9]+),(NONE|[.0-9]+)/, '') == nil - fail "'#{version_info}' doesn't match ' ,, ...'" - end - changes << ChangeInfo.new($1, $2, $3) + if $use_modern_argument_list + changes = collect_modern_style_args(cvs_info) + else + changes = collect_antique_style_args(cvs_info) end # look for the start of the user's comment @@ -159,7 +185,7 @@ safer_popen($cvs_prog, "-nq", "status", change.file) do |io| status = io.read end - fail "couldn't get cvs status: #{$!}" unless ($?>>8)==0 + fail "couldn't get cvs status: #{$!} (exited with #{$?})" unless ($?>>8)==0 if status =~ /^\s*Sticky Tag:\s*(.+) \(branch: +/m tag = $1 @@ -207,7 +233,10 @@ def choose_operation(op) - if op =~ / - New directory$/ + # in the CVS 1.12.x series, new directory notifications include versions + # 'NONE' and 'NONE', whereas older versions of CVS didn't include any version + # info here. The string ',NONE,NONE' is therefore optional in the regexp, + if op =~ / - New directory(?:,NONE,NONE)?$/ blah("No action taken on directory creation") elsif op =~ / - Imported sources$/ blah("Imported not handled") @@ -242,6 +271,34 @@ end end + +class CVSConfig + def initialize(filename) + @data = Hash.new + File.open(filename) do |io| + read(io) + end + end + + def read(io) + io.each do |line| + parse_line(line) + end + end + + def parse_line(line) + # strip any comment (assumes values can't contain '#') + line.sub!(/#.*$/, "") + if line =~ /^\s*(.*?)\s*=\s*(.*?)\s*$/ + @data[$1] = $2 + end + end + + def [](key) + @data[key] + end +end + $config = nil $cvs_prog = "cvs" $debug = false @@ -276,11 +333,13 @@ end blah("CVSROOT is #{ENV['CVSROOT']}") -blah("ARGV is '#{ARGV.join(', ')}'") +blah("ARGV is <#{ARGV.join('>, <')}>") + +cvsroot_dir = "#{ENV['CVSROOT']}/CVSROOT" if $config == nil - if FileTest.exists?("#{ENV['CVSROOT']}/CVSROOT/cvsspam.conf") - $config = "#{ENV['CVSROOT']}/CVSROOT/cvsspam.conf" + if FileTest.exists?("#{cvsroot_dir}/cvsspam.conf") + $config = "#{cvsroot_dir}/cvsspam.conf" elsif FileTest.exists?("/etc/cvsspam/cvsspam.conf") $config = "/etc/cvsspam/cvsspam.conf" end @@ -290,6 +349,17 @@ end end + +$use_modern_argument_list = false + +cvs_config_filename = "#{cvsroot_dir}/config" + +if FileTest.exists?(cvs_config_filename) + cvs_config = CVSConfig.new(cvs_config_filename) + + $use_modern_argument_list = cvs_config["UseNewInfoFmtStrings"] == "yes" +end + if $config != nil if FileTest.exists?($config) def addHeader(name,val) @@ -304,11 +374,18 @@ end end -if ARGV.length != 1 - $stderr.puts "Expected arguments missing" - $stderr.puts "* You shouldn't run collect_diffs by hand, but from a CVSROOT/loginfo entry *" - $stderr.puts "Usage: collect_diffs.rb [ --to ] [ --config ] %{sVv}" - $stderr.puts " (the sequence '%{sVv}' is expanded by CVS, when found in CVSROOT/loginfo)" - exit +if $use_modern_argument_list + if ARGV.length % 3 != 0 + $stderr.puts "Expected 3 arguments for each file" + end + choose_operation(ARGV) +else + if ARGV.length != 1 + $stderr.puts "Expected arguments missing" + $stderr.puts "* You shouldn't run collect_diffs by hand, but from a CVSROOT/loginfo entry *" + $stderr.puts "Usage: collect_diffs.rb [ --to ] [ --config ] %{sVv}" + $stderr.puts " (the sequence '%{sVv}' is expanded by CVS, when found in CVSROOT/loginfo)" + exit + end + choose_operation(ARGV[0]) end -choose_operation(ARGV[0]) --7JfCtLOvnd9MIVvH-- From tonyg at lshift.net Tue Aug 17 13:32:23 2004 From: tonyg at lshift.net (Tony Garnock-Jones) Date: Tue, 17 Aug 2004 14:32:23 +0100 Subject: [cvsspam-devel] [PATCH] Fix "broken pipe" problem in collect_diffs.rb on directory creation Message-ID: <412208E7.8030707@lshift.net> This is a multi-part message in MIME format. --------------090303010805010801080209 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi. We've been having trouble with cvsspam recently adding directories. Occasionally the server would complain: cvs [server aborted]: received broken pipe signal It wasn't just cvsspam, it was with any loginfo script that exited too quickly without consuming its stdin - using /bin/true or /bin/echo as the loginfo script caused occasional EPIPE errors. Using "/bin/sleep 1", however, made the problem vanish - I guess the CVS server had time to send all the data it was going to send to the script before the script exited, closing the file descriptor. The attached patch modifies collect_diffs.rb to always consume its entire standard input in the cases of "new directory" and "imported sources". Regards, Tony --------------090303010805010801080209 Content-Type: text/plain; name="patch-for-cvsspam" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-for-cvsspam" Index: collect_diffs.rb =================================================================== RCS file: /usr/local/cvsroot/project/CVSROOT/collect_diffs.rb,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- collect_diffs.rb 12 Jul 2004 15:48:21 -0000 1.11 +++ collect_diffs.rb 17 Aug 2004 13:15:42 -0000 1.12 @@ -206,11 +206,18 @@ end +def consume_stdin() + $stdin.read() +end + + def choose_operation(op) if op =~ / - New directory$/ blah("No action taken on directory creation") + consume_stdin() elsif op =~ / - Imported sources$/ blah("Imported not handled") + consume_stdin() else process_log(op) mailtest --------------090303010805010801080209-- From dave at badgers-in-foil.co.uk Tue Aug 17 14:35:00 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 17 Aug 2004 14:35:00 +0000 Subject: [cvsspam-devel] [PATCH] Fix "broken pipe" problem in collect_diffs.rb on directory creation In-Reply-To: <412208E7.8030707@lshift.net> References: <412208E7.8030707@lshift.net> Message-ID: <20040817143453.GA5310@vhost.badgers-in-foil.co.uk> On Tue, Aug 17, 2004 at 02:32:23PM +0100, Tony Garnock-Jones wrote: > Hi. > > We've been having trouble with cvsspam recently adding directories. > Occasionally the server would complain: > > cvs [server aborted]: received broken pipe signal > > It wasn't just cvsspam, it was with any loginfo script that exited too > quickly without consuming its stdin - using /bin/true or /bin/echo as > the loginfo script caused occasional EPIPE errors. > > Using "/bin/sleep 1", however, made the problem vanish - I guess the CVS > server had time to send all the data it was going to send to the script > before the script exited, closing the file descriptor. > > The attached patch modifies collect_diffs.rb to always consume its > entire standard input in the cases of "new directory" and "imported > sources". Fabulous! Patch applied. Possibly related; the CVS 'NEWS' file mentions, in the changes between 1.12.5 and 1.12.6: "A fix has been included that should avoid a very rare race condition that could cause a CVS server to exit with a "broken pipe" message." Whether this refers to the error message you were seeing, I don't know. dave From dave at badgers-in-foil.co.uk Tue Aug 24 11:31:22 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 24 Aug 2004 11:31:22 +0000 Subject: [cvsspam-devel] [ANN] CVSspam 0.2.10 released Message-ID: <20040824113121.GA9632@vhost.badgers-in-foil.co.uk> The latest version is now available at the usual place, http://www.badgers-in-foil.co.uk/projects/cvsspam/ Changes and fixes include, * The expansion of a CVS username in CVSROOT/users may now contain whitespace, although we may still not be properly handling quotes in this file [1] * A 2 megabyte limit is placed on the amount of diff output included in emails. The limit is 'soft'; we are allowed to pass the limit to prevent truncating a file's diff midway (but note that a seperate limit on the number of lines in an individual file's diff already exists) [2] * When using SMTP directly to send mail, a date header is now included, as its lack broke most mail-reader's sort-by-date functionality [3] * Fixes problems in commitinfo argument parsing that would prevent CVSspam working with the CVS 1.12.x series [4] * Work around occasional 'received broken pipe signal' errors from CVS, in at least some cases [5] ---- [1] http://lists.badgers-in-foil.co.uk/pipermail/cvsspam-devel/2004-May/000126.html [2] http://lists.badgers-in-foil.co.uk/pipermail/cvsspam-devel/2004-August/000152.html [3] http://lists.badgers-in-foil.co.uk/pipermail/cvsspam-devel/2004-May/000132.html [4] http://lists.badgers-in-foil.co.uk/pipermail/cvsspam-devel/2004-August/000157.html [5] http://lists.badgers-in-foil.co.uk/pipermail/cvsspam-devel/2004-August/000162.html dave From anubhav_kale at persistent.co.in Tue Aug 31 06:40:56 2004 From: anubhav_kale at persistent.co.in (Anubhav Kale) Date: Tue, 31 Aug 2004 12:10:56 +0530 Subject: [cvsspam-devel] Configuration problem Message-ID: <000c01c48f25$7a0709a0$86056a0a@persistent.co.in> This is a multi-part message in MIME format. ------=_NextPart_000_0009_01C48F53.91AB80D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello... I have installed ruby on my machine and then configured cvsspam.But = after any commit I see the following message: (-h will show valid options)- cvs server: Pre-commit check failed cvs [server aborted]: correct above errors first! It seems that record_lastdir.rb does not get executed properly. Can you please let me know what could be the problem? Thanks Anubhav ------=_NextPart_000_0009_01C48F53.91AB80D0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello...
 
I have installed ruby on my machine and = then=20 configured cvsspam.But after any commit I see the following=20 message:
 
 (-h will show valid = options)-
cvs server:=20 Pre-commit check failed
cvs [server aborted]: correct above errors=20 first!
It seems that record_lastdir.rb = does not get=20 executed properly.
 
Can you please let me know what could = be the=20 problem?
 
Thanks
 
Anubhav
------=_NextPart_000_0009_01C48F53.91AB80D0-- From anubhav_kale at persistent.co.in Tue Aug 31 07:23:51 2004 From: anubhav_kale at persistent.co.in (Anubhav Kale) Date: Tue, 31 Aug 2004 12:53:51 +0530 Subject: [cvsspam-devel] Re: Configuration problem Message-ID: <001101c48f2b$78e53730$86056a0a@persistent.co.in> This is a multi-part message in MIME format. ------=_NextPart_000_000E_01C48F59.90AD8A10 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Piet, That did not work.So I replaced the entries everywhere with ruby = (In source code, loginfo and commitinfo).But now I see the = following message.Also,I am not using configuration file.Is it a must? I have just followed the steps from = http://www.badgers-in-foil.co.uk/projects/cvsspam/cvsspam-doc.html ----- Original Message ----- /export/CVS/CVSROOT/collect_diffs.rb:230:in = `mailtest': problem running 'ruby /export/CVS/CVSROOT/cvsspam.rb' = (RuntimeError) from /export/CVS/CVSROOT/collect_diffs.rb:216:in = `choose_operation' from /export/CVS/CVSROOT/collect_diffs.rb:314 [anubhav@matrix CVSROOT]$ vi /export/CVS/CVSROOT/collect_diffs.rb Thanks Anubhav ----- Original Message -----=20 From: Anubhav Kale=20 To: cvsspam-devel@lists.badgers-in-foil.co.uk=20 Sent: Tuesday, August 31, 2004 12:10 PM Subject: Configuration problem Hello... I have installed ruby on my machine and then configured cvsspam.But = after any commit I see the following message: =20 (-h will show valid options)- cvs server: Pre-commit check failed cvs [server aborted]: correct above errors first! It seems that record_lastdir.rb does not get executed properly. =20 Can you please let me know what could be the problem? =20 Thanks =20 Anubhav ------=_NextPart_000_000E_01C48F59.90AD8A10 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi Piet,
 
That did not work.So I replaced the = entries=20 everywhere with ruby <filename> (In source = code, loginfo and=20 commitinfo).But now I see the following message.Also,I am not using=20 configuration file.Is it a must?
 
I have just followed the steps from http://www.badgers-in-foil.co.uk/projects/cvsspam/cvsspam-doc.html=
 
----- Original Message -----=20 /export/CVS/CVSROOT/collect_diffs.rb:230:in `mailtest': problem running = 'ruby=20 /export/CVS/CVSROOT/cvsspam.rb'=20 (RuntimeError)
        from=20 /export/CVS/CVSROOT/collect_diffs.rb:216:in=20 `choose_operation'
        from=20 /export/CVS/CVSROOT/collect_diffs.rb:314
[anubhav@matrix CVSROOT]$ vi = /export/CVS/CVSROOT/collect_diffs.rb
 
Thanks
 
Anubhav
----- Original Message -----
From:=20 Anubhav Kale
To: cvsspam-devel@lists.bad= gers-in-foil.co.uk=20
Sent: Tuesday, August 31, 2004 = 12:10=20 PM
Subject: Configuration = problem

Hello...
 
I have installed ruby on my machine = and then=20 configured cvsspam.But after any commit I see the following=20 message:
 
 (-h will show valid = options)-
cvs=20 server: Pre-commit check failed
cvs [server aborted]: correct above = errors=20 first!
It seems that record_lastdir.rb = does not get=20 executed properly.
 
Can you please let me know what could = be the=20 problem?
 
Thanks
 
Anubhav
------=_NextPart_000_000E_01C48F59.90AD8A10-- From dave at badgers-in-foil.co.uk Tue Aug 31 08:57:37 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 31 Aug 2004 08:57:37 +0000 Subject: [cvsspam-devel] Re: Configuration problem In-Reply-To: <001101c48f2b$78e53730$86056a0a@persistent.co.in> References: <001101c48f2b$78e53730$86056a0a@persistent.co.in> Message-ID: <20040831085736.GA15151@vhost.badgers-in-foil.co.uk> On Tue, Aug 31, 2004 at 12:53:51PM +0530, Anubhav Kale wrote: > Hi Piet, Since Piet's reply didn't get to the list, I'll reply to your initial question here, >> I have installed ruby on my machine and then configured cvsspam.But after >> any commit I see the following message: >> >> (-h will show valid options)- >> cvs server: Pre-commit check failed >> cvs [server aborted]: correct above errors first! The first line of that error message appears to be part of the text that ruby outputs when given an invalid command line option. For instance, dave@castle:~$ ruby --hola! ruby: invalid option --hola! (-h will show valid options) The text in your message doesn't say which option it is that ruby doesn't like however. I see two possibilities: 1) The cut'n'paste into your email missed some of the text. If so, please try sending again with the full message 2) You've accidentally saved the CVSspam files in DOS format, rather than in UNIX format. I suspect that number 2 is the problem you ned to fix. If the file has the sequence "\r\n" at th end of each line, rather than the standard "\n", the shbang in the script will end up looking something like: "#!/usr/bin/ruby -w\r" Then, when ruby comes to print a message to say it doesn't understand the "-w\r" option, the carrige-return will cause the message to be formatted strangely, as the cursor will get moved back to the start of the line half way though the text. > That did not work.So I replaced the entries everywhere with ruby > (In source code, loginfo and commitinfo).But now I see the following message. > Also,I am not using configuration file.Is it a must? No, a config file is not required (or at least, it's not supposed to be). > I have just followed the steps from http://www.badgers-in-foil.co.uk/projects/cvsspam/cvsspam-doc.html > > ----- Original Message ----- /export/CVS/CVSROOT/collect_diffs.rb:230:in `mailtest': problem running 'ruby /export/CVS/CVSROOT/cvsspam.rb' (RuntimeError) > from /export/CVS/CVSROOT/collect_diffs.rb:216:in `choose_operation' > from /export/CVS/CVSROOT/collect_diffs.rb:314 > [anubhav@matrix CVSROOT]$ vi /export/CVS/CVSROOT/collect_diffs.rb I don't know what changes you've made to the scripts, but you'll have to tell me, if dos-to-unix'ing them doesn't help you. Let us know if that helps! ta, dave From anubhav_kale at persistent.co.in Tue Aug 31 09:12:25 2004 From: anubhav_kale at persistent.co.in (Anubhav Kale) Date: Tue, 31 Aug 2004 14:42:25 +0530 Subject: [cvsspam-devel] Re: Configuration problem References: <001101c48f2b$78e53730$86056a0a@persistent.co.in> <20040831085736.GA15151@vhost.badgers-in-foil.co.uk> Message-ID: <000801c48f3a$a3672ea0$86056a0a@persistent.co.in> This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C48F68.BB2F8180 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi David, 1) (-h will show valid options)- I see only this (no cut and paste problem) 2)Also there is no dos2unix problem.I can see the file contents = correctly (without any ctrl+M) when I open them in vi. 3)Regd my changes: In logininfo -> veraz_sm ruby $CVSROOT/CVSROOT/collect_diffs.rb --to = anubhav_kale@persistent.co.in %{sVv} In commitinfo -> veraz_sm ruby $CVSROOT/CVSROOT/record_lastdir.rb In collect_diffs.rb -> cmd =3D "/usr/bin/ruby " + File.dirname($0) + "/cvsspam.rb" Thanks Anubhav ----- Original Message -----=20 From: "David Holroyd" To: = Sent: Tuesday, August 31, 2004 2:27 PM Subject: Re: [cvsspam-devel] Re: Configuration problem > On Tue, Aug 31, 2004 at 12:53:51PM +0530, Anubhav Kale wrote: > > Hi Piet, >=20 > Since Piet's reply didn't get to the list, I'll reply to your initial > question here, >=20 > >> I have installed ruby on my machine and then configured cvsspam.But = after > >> any commit I see the following message: > >> =20 > >> (-h will show valid options)- > >> cvs server: Pre-commit check failed > >> cvs [server aborted]: correct above errors first! >=20 > The first line of that error message appears to be part of the text = that > ruby outputs when given an invalid command line option. For instance, >=20 > dave@castle:~$ ruby --hola! > ruby: invalid option --hola! (-h will show valid options) >=20 > The text in your message doesn't say which option it is that ruby > doesn't like however. I see two possibilities: >=20 > 1) The cut'n'paste into your email missed some of the text. If so, > please try sending again with the full message >=20 > 2) You've accidentally saved the CVSspam files in DOS format, rather = than > in UNIX format. >=20 > I suspect that number 2 is the problem you ned to fix. If the file = has > the sequence "\r\n" at th end of each line, rather than the standard > "\n", the shbang in the script will end up looking something like: >=20 > "#!/usr/bin/ruby -w\r" >=20 > Then, when ruby comes to print a message to say it doesn't understand > the "-w\r" option, the carrige-return will cause the message to be > formatted strangely, as the cursor will get moved back to the start of > the line half way though the text. >=20 >=20 >=20 > > That did not work.So I replaced the entries everywhere with ruby = > > (In source code, loginfo and commitinfo).But now I see the following = message. > > Also,I am not using configuration file.Is it a must? >=20 > No, a config file is not required (or at least, it's not supposed to > be). >=20 >=20 > > I have just followed the steps from = http://www.badgers-in-foil.co.uk/projects/cvsspam/cvsspam-doc.html > >=20 > > ----- Original Message ----- = /export/CVS/CVSROOT/collect_diffs.rb:230:in `mailtest': problem running = 'ruby /export/CVS/CVSROOT/cvsspam.rb' (RuntimeError) > > from /export/CVS/CVSROOT/collect_diffs.rb:216:in = `choose_operation' > > from /export/CVS/CVSROOT/collect_diffs.rb:314 > > [anubhav@matrix CVSROOT]$ vi /export/CVS/CVSROOT/collect_diffs.rb >=20 > I don't know what changes you've made to the scripts, but you'll have = to > tell me, if dos-to-unix'ing them doesn't help you. >=20 >=20 > Let us know if that helps! > ta, > dave >=20 > _______________________________________________ > cvsspam-devel mailing list > cvsspam-devel@lists.badgers-in-foil.co.uk > http://lists.badgers-in-foil.co.uk/mailman/listinfo/cvsspam-devel ------=_NextPart_000_0005_01C48F68.BB2F8180 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi David,
 
1)
(-h will show valid = options)-
I see only this (no cut and paste=20 problem)
 
2)Also there is no dos2unix problem.I = can see the=20 file contents correctly (without any ctrl+M) when I open them in=20 vi.
 
3)Regd my changes:
 
In logininfo -> veraz_sm = ruby=20 $CVSROOT/CVSROOT/collect_diffs.rb --to anubhav_kale@persistent.co.in=20 %{sVv}
 
In commitinfo -> veraz_sm = ruby=20 $CVSROOT/CVSROOT/record_lastdir.rb
 
In collect_diffs.rb ->
 
cmd =3D "/usr/bin/ruby " +=20 File.dirname($0) + "/cvsspam.rb"
 
Thanks
 
Anubhav
 
 
 
 
----- Original Message -----
From: "David Holroyd" <dave@badgers-in-foil.co.uk>To:=20 <cvsspam-devel@lists.badgers-in-foil.co.uk>
Sent: Tuesday, August 31, 2004 2:27 = PM
Subject: Re: [cvsspam-devel] Re: = Configuration=20 problem

> On Tue, Aug 31, 2004 at = 12:53:51PM=20 +0530, Anubhav Kale wrote:
> > Hi Piet,
>
> Since = Piet's=20 reply didn't get to the list, I'll reply to your initial
> = question=20 here,
>
> >> I have installed ruby on my machine and = then=20 configured cvsspam.But after
> >> any commit I see the = following=20 message:
> >>   
> >>  (-h = will=20 show valid options)-
> >> cvs server: Pre-commit check=20 failed
> >> cvs [server aborted]: correct above errors=20 first!
>
> The first line of that error message appears to = be part=20 of the text that
> ruby outputs when given an invalid command line = option.  For instance,
>
>   dave@castle:~$ ruby=20 --hola!
>   ruby: invalid option --hola!  (-h will show = valid=20 options)
>
> The text in your message doesn't say which = option it=20 is that ruby
> doesn't like however.  I see two=20 possibilities:
>
> 1) The cut'n'paste into your email = missed some=20 of the text.  If so,
>    please try sending again = with the=20 full message
>
> 2) You've accidentally saved the CVSspam = files in=20 DOS format, rather than
>    in UNIX format.
> =
> I=20 suspect that number 2 is the problem you ned to fix.  If the file=20 has
> the sequence "\r\n" at th end of each line, rather than the=20 standard
> "\n", the shbang in the script will end up looking = something=20 like:
>
>   "#!/usr/bin/ruby -w\r"
>
> = Then, when=20 ruby comes to print a message to say it doesn't understand
> the = "-w\r"=20 option, the carrige-return will cause the message to be
> = formatted=20 strangely, as the cursor will get moved back to the start of
> the = line=20 half way though the text.
>
>
>
> > That = did not=20 work.So I replaced the entries everywhere with ruby = <filename>
>=20 > (In source code, loginfo and commitinfo).But now I see the = following=20 message.
> > Also,I am not using configuration file.Is it a=20 must?
>
> No, a config file is not required (or at least, = it's not=20 supposed to
> be).
>
>
> > I have just = followed the=20 steps from
http://www.badgers-in-foil.co.uk/projects/cvsspam/cvsspam-doc.ht= ml
> >
> > ----- Original Message = -----=20 /export/CVS/CVSROOT/collect_diffs.rb:230:in `mailtest': problem running = 'ruby=20 /export/CVS/CVSROOT/cvsspam.rb' (RuntimeError)
>=20 >         from=20 /export/CVS/CVSROOT/collect_diffs.rb:216:in `choose_operation'
>=20 >         from=20 /export/CVS/CVSROOT/collect_diffs.rb:314
> > [anubhav@matrix = CVSROOT]$=20 vi /export/CVS/CVSROOT/collect_diffs.rb
>
> I don't know = what=20 changes you've made to the scripts, but you'll have to
> tell me, = if=20 dos-to-unix'ing them doesn't help you.
>
>
> Let us = know if=20 that helps!
> ta,
> dave
>
>=20 _______________________________________________
> cvsspam-devel = mailing=20 list
> cvsspam-devel@lists.badgers-in-foil.co.uk
> http://lists.badgers-in-foil.co.uk/mailman/listinfo/cvsspam-deve= l ------=_NextPart_000_0005_01C48F68.BB2F8180-- From dave at badgers-in-foil.co.uk Tue Aug 31 12:28:10 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 31 Aug 2004 12:28:10 +0000 Subject: [cvsspam-devel] Re: Configuration problem In-Reply-To: <000801c48f3a$a3672ea0$86056a0a@persistent.co.in> References: <001101c48f2b$78e53730$86056a0a@persistent.co.in> <20040831085736.GA15151@vhost.badgers-in-foil.co.uk> <000801c48f3a$a3672ea0$86056a0a@persistent.co.in> Message-ID: <20040831122809.GA18184@vhost.badgers-in-foil.co.uk> On Tue, Aug 31, 2004 at 02:42:25PM +0530, Anubhav Kale wrote: > Hi David, > > 1) > (-h will show valid options)- > > I see only this (no cut and paste problem) > > 2)Also there is no dos2unix problem.I can see the file contents correctly (without any ctrl+M) when I open them in vi. Did you open the file with 'vi -b'? Vim is fairly smart about handling DOS files these days. (Sorry if this is stuff you already know about; I just need to be sure.) > 3)Regd my changes: > > In logininfo -> veraz_sm ruby $CVSROOT/CVSROOT/collect_diffs.rb --to anubhav_kale@persistent.co.in %{sVv} > > In commitinfo -> veraz_sm ruby $CVSROOT/CVSROOT/record_lastdir.rb > > In collect_diffs.rb -> > > cmd = "/usr/bin/ruby " + File.dirname($0) + "/cvsspam.rb" Hmm, originaly, the message you gave listed "problem running 'ruby .." rather then "problem running '/usr/sbin/ruby .." Is that something you changed inbetween sending the two emails? > > > ----- Original Message ----- > > > /export/CVS/CVSROOT/collect_diffs.rb:230:in `mailtest': problem running 'ruby /export/CVS/CVSROOT/cvsspam.rb' (RuntimeError) > > > from /export/CVS/CVSROOT/collect_diffs.rb:216:in `choose_operation' > > > from /export/CVS/CVSROOT/collect_diffs.rb:314 > > > [anubhav@matrix CVSROOT]$ vi /export/CVS/CVSROOT/collect_diffs.rb If the file's not in DOS format, I'm out of ideas about what the problem could be. If you try running a much simpler script from commitinfo/loginfo, what happens? How about something like these, for starters): ci.rb: ---- #!/usr/bin/ruby -w puts "Hello commitinfo!" ---- li.rb: ---- #!/usr/bin/ruby -w puts "Hello loginfo!" ---- Try invoking these directly from {commit,log}info, without putting 'ruby' in the config files explicitly. dave From dave at badgers-in-foil.co.uk Tue Aug 31 12:38:02 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 31 Aug 2004 12:38:02 +0000 Subject: [cvsspam-devel] Re: Configuration problem In-Reply-To: <20040831122809.GA18184@vhost.badgers-in-foil.co.uk> References: <001101c48f2b$78e53730$86056a0a@persistent.co.in> <20040831085736.GA15151@vhost.badgers-in-foil.co.uk> <000801c48f3a$a3672ea0$86056a0a@persistent.co.in> <20040831122809.GA18184@vhost.badgers-in-foil.co.uk> Message-ID: <20040831123801.GB18184@vhost.badgers-in-foil.co.uk> On Tue, Aug 31, 2004 at 12:28:10PM +0000, David Holroyd wrote: > On Tue, Aug 31, 2004 at 02:42:25PM +0530, Anubhav Kale wrote: > > cmd = "/usr/bin/ruby " + File.dirname($0) + "/cvsspam.rb" > > Hmm, originaly, the message you gave listed "problem running 'ruby .." > rather then "problem running '/usr/sbin/ruby .." Is that something Excuse the typo -- that path should have been "bin" not "sbin" :-S dave From anubhav_kale at persistent.co.in Tue Aug 31 13:25:00 2004 From: anubhav_kale at persistent.co.in (Anubhav Kale) Date: Tue, 31 Aug 2004 18:55:00 +0530 Subject: [cvsspam-devel] Re: Configuration problem References: <001101c48f2b$78e53730$86056a0a@persistent.co.in> <20040831085736.GA15151@vhost.badgers-in-foil.co.uk> <000801c48f3a$a3672ea0$86056a0a@persistent.co.in> <20040831122809.GA18184@vhost.badgers-in-foil.co.uk> Message-ID: <001e01c48f5d$eccfd330$86056a0a@persistent.co.in> Thanks a lot,David. I double-checked with vi -b and realised that cvsspam.conf was indeed corrupt.Everything is working great now. Where do you stay? I owe you a treat :) Anubhav ----- Original Message ----- From: "David Holroyd" To: Sent: Tuesday, August 31, 2004 5:58 PM Subject: Re: [cvsspam-devel] Re: Configuration problem > On Tue, Aug 31, 2004 at 02:42:25PM +0530, Anubhav Kale wrote: > > Hi David, > > > > 1) > > (-h will show valid options)- > > > > I see only this (no cut and paste problem) > > > > 2)Also there is no dos2unix problem.I can see the file contents correctly (without any ctrl+M) when I open them in vi. > > Did you open the file with 'vi -b'? Vim is fairly smart about handling > DOS files these days. (Sorry if this is stuff you already know about; I > just need to be sure.) > > > > 3)Regd my changes: > > > > In logininfo -> veraz_sm ruby $CVSROOT/CVSROOT/collect_diffs.rb --to anubhav_kale@persistent.co.in %{sVv} > > > > In commitinfo -> veraz_sm ruby $CVSROOT/CVSROOT/record_lastdir.rb > > > > In collect_diffs.rb -> > > > > cmd = "/usr/bin/ruby " + File.dirname($0) + "/cvsspam.rb" > > Hmm, originaly, the message you gave listed "problem running 'ruby .." > rather then "problem running '/usr/sbin/ruby .." Is that something > you changed inbetween sending the two emails? > > > > > > ----- Original Message ----- > > > > /export/CVS/CVSROOT/collect_diffs.rb:230:in `mailtest': problem running 'ruby /export/CVS/CVSROOT/cvsspam.rb' (RuntimeError) > > > > from /export/CVS/CVSROOT/collect_diffs.rb:216:in `choose_operation' > > > > from /export/CVS/CVSROOT/collect_diffs.rb:314 > > > > [anubhav@matrix CVSROOT]$ vi /export/CVS/CVSROOT/collect_diffs.rb > > > If the file's not in DOS format, I'm out of ideas about what the problem > could be. If you try running a much simpler script from > commitinfo/loginfo, what happens? How about something like these, for > starters): > > > ci.rb: > ---- > #!/usr/bin/ruby -w > puts "Hello commitinfo!" > ---- > > > li.rb: > ---- > #!/usr/bin/ruby -w > puts "Hello loginfo!" > ---- > > Try invoking these directly from {commit,log}info, without putting > 'ruby' in the config files explicitly. > > > dave > > _______________________________________________ > cvsspam-devel mailing list > cvsspam-devel@lists.badgers-in-foil.co.uk > http://lists.badgers-in-foil.co.uk/mailman/listinfo/cvsspam-devel From dave at badgers-in-foil.co.uk Tue Aug 31 13:33:38 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 31 Aug 2004 13:33:38 +0000 Subject: [cvsspam-devel] Re: Configuration problem In-Reply-To: <001e01c48f5d$eccfd330$86056a0a@persistent.co.in> References: <001101c48f2b$78e53730$86056a0a@persistent.co.in> <20040831085736.GA15151@vhost.badgers-in-foil.co.uk> <000801c48f3a$a3672ea0$86056a0a@persistent.co.in> <20040831122809.GA18184@vhost.badgers-in-foil.co.uk> <001e01c48f5d$eccfd330$86056a0a@persistent.co.in> Message-ID: <20040831133338.GC18184@vhost.badgers-in-foil.co.uk> On Tue, Aug 31, 2004 at 06:55:00PM +0530, Anubhav Kale wrote: > Thanks a lot,David. I double-checked with vi -b and realised that > cvsspam.conf was indeed corrupt.Everything is working great now. > > Where do you stay? I owe you a treat :) I'm working from Barcelona for a few days. Your thanks are treat enough ;) dave