]> git.pld-linux.org Git - packages/cvsspam.git/blob - cvsspam-optkb_binary_hint.patch
- wordwrap for css .comment class
[packages/cvsspam.git] / cvsspam-optkb_binary_hint.patch
1 Index: collect_diffs.rb
2 ===================================================================
3 RCS file: /var/lib/cvs/cvsspam/collect_diffs.rb,v
4 retrieving revision 1.22
5 diff -u -r1.22 collect_diffs.rb
6 --- collect_diffs.rb    22 Dec 2004 13:41:25 -0000      1.22
7 +++ collect_diffs.rb    20 Feb 2005 01:01:08 -0000
8 @@ -196,6 +196,8 @@
9        # record version information
10        file.puts "#V #{change.fromVer},#{change.toVer}"
11  
12 +      # remember that the 'binary' option was set for this file
13 +      binary_file = false
14        # note if the file is on a branch
15        tag = nil
16        if change.isRemoval
17 @@ -210,6 +212,10 @@
18         if status =~ /^\s*Sticky Tag:\s*(.+) \(branch: +/m
19           tag = $1
20         end
21 +
22 +       if status =~ /^\s*Sticky Options:\s*-kb/m
23 +         binary_file = true
24 +       end
25        end
26        file.puts "#T #{tag}" unless tag.nil?
27  
28 @@ -232,17 +238,25 @@
29        end
30        file.puts "#{$repository_path}/#{change.file}"
31        diff_cmd << change.file
32 -      # do a cvs diff and place the output into our temp file
33 -      blah("about to run #{diff_cmd.join(' ')}")
34 -      safer_popen(*diff_cmd) do |pipe|
35 -        # skip over cvs-diff's preamble
36 -        pipe.each do |line|
37 -          break if line =~ /^diff /
38 -        end
39 -        file.puts "#U #{line}"
40 -        pipe.each do |line|
41 -          file.puts "#U #{line}"
42 -        end
43 +      if binary_file
44 +       blah("not diffing #{change.file}; has -kb set")
45 +       # fake diff lines that will cause cvsspam.rb to consider this a binary
46 +       # file,
47 +       file.puts "#U diff x x"
48 +       file.puts "#U Binary files x and y differ"
49 +      else
50 +       # do a cvs diff and place the output into our temp file
51 +       blah("about to run #{diff_cmd.join(' ')}")
52 +       safer_popen(*diff_cmd) do |pipe|
53 +         # skip over cvs-diff's preamble
54 +         pipe.each do |line|
55 +           break if line =~ /^diff /
56 +         end
57 +         file.puts "#U #{line}"
58 +         pipe.each do |line|
59 +           file.puts "#U #{line}"
60 +         end
61 +       end
62        end
63        # TODO: don't how to do this reliably on different systems...
64        #fail "cvsdiff did not give exit status 1 for invocation: #{diff_cmd.join(' ')}" unless ($?>>8)==1
This page took 0.053437 seconds and 3 git commands to generate.