]> git.llucax.com Git - software/mutt-debian.git/blob - debian/fix-PATCHES.pl
Merge branch 'upstream' of ssh://antonio-guest@git.debian.org/git/pkg-mutt/mutt
[software/mutt-debian.git] / debian / fix-PATCHES.pl
1 #!/usr/bin/perl -wi
2
3 use strict;
4
5 my ($PATCHES, @patches);
6 while (<>) {
7         if (/^(---|Index:|diff) .*PATCHES/) {
8                 $PATCHES = 1;
9         } elsif (/^(-|Index|diff)/) { # next patch
10                 $PATCHES = 0;
11                 print;
12         } elsif ($PATCHES) {
13                 next if /^(===|\+\+\+|@@)/; # patch header
14                 next if /^ /; # context
15                 push @patches, $_;
16         } else {
17                 print;
18         }
19         if (eof) {
20                 if (@patches) {
21                         print "--- a/PATCHES\n";
22                         print "+++ b/PATCHES\n";
23                         print "@@ -0,0 +" . scalar (@patches) . " @@\n";
24                         print @patches;
25                 }
26                 @patches = ();
27                 $PATCHES = 0;
28         }
29 }
30