]> git.pld-linux.org Git - packages/cvsspam.git/blob - ruby19-shadow-outer-var.patch
- shadow outer var fix
[packages/cvsspam.git] / ruby19-shadow-outer-var.patch
1 fix warnings for "warning: shadowing outer local variable - line"
2 side effect is that code starts to work again.
3
4 --- cvsspam-0.2.12/collect_diffs.rb     2010-06-18 12:15:54.514725990 +0300
5 +++ cvsspam-0.2.12/collect_diffs.rb     2010-06-18 12:16:09.410605410 +0300
6 @@ -169,8 +169,7 @@
7  
8    raise "missing data dir (#{$tmpdir}/#{$dirtemplate}-XXXXXX)" if $datadir==nil
9  
10 -  line = $stdin.gets
11 -  unless line =~ /^Update of (.+)/
12 +  unless $stdin.gets =~ /^Update of (.+)/
13      fail "Log preamble looks suspect (doesn't start 'Update of ...')"
14    end
15  
16 @@ -189,11 +188,15 @@
17    end
18  
19    # look for the start of the user's comment
20 +  got_log_message = false
21    $stdin.each do |line|
22 -    break if line =~ /^Log Message/
23 +    if line =~ /^Log Message/
24 +        got_log_message = true
25 +        break
26 +    end
27    end
28  
29 -  unless line =~ /^Log Message/
30 +  unless got_log_message
31      fail "Input did not contain a 'Log Message:' entry"
32    end
33  
34 @@ -273,12 +276,14 @@
35         blah("about to run #{diff_cmd.join(' ')}")
36         safer_popen(*diff_cmd) do |pipe|
37           # skip over cvs-diff's preamble
38 -         pipe.each do |line|
39 -           break if line =~ /^diff /
40 +      line = nil
41 +      pipe.each do |l|
42 +          line = l
43 +          break if l =~ /^diff /
44           end
45           file.puts "#U #{line}"
46 -         pipe.each do |line|
47 -           file.puts "#U #{line}"
48 +     pipe.each do |l|
49 +       file.puts "#U #{l}"
50           end
51         end
52        end
This page took 0.058005 seconds and 3 git commands to generate.