File: check_gcc_patches

package info (click to toggle)
gcc-6-doc 6.3.0-1
  • links: PTS, VCS
  • area: non-free
  • in suites: stretch
  • size: 26,640 kB
  • ctags: 102
  • sloc: perl: 473; python: 291; makefile: 269; cpp: 17
file content (45 lines) | stat: -rw-r--r-- 1,005 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/perl
# This is a helper to inspect gcc-x.y package's patches,
# looking for those applicable to gcc-x.y-doc.
# 
# Usage:
# $ cd gcc-x.y/debian/patches
# $ perl $PATH_TO_ME/check_gcc_patches *.diff
use strict;
use warnings;

my $interest =
    qr{ 
        \.7$
        | \.texi$
        | texi2pod\.pl$
        | (xgnatugn.adb|ug_words)$
    }x;

my %inspect = ();
for my $patch (@ARGV) {
    print "Parsing $patch\n";
    open my $fh, "-|", qw(diffstat -l), $patch;
    while (<$fh>) {
        chomp;
        if (m/$interest/) {
            print "Match: $_\n";
            $inspect{$patch} = 1;
        }
    }
}

print "\n";
print "# Interesting patches:\n";
for my $patch (sort keys %inspect) {
    print "# grepping for $patch in rules.patch\n";
    my $base = $patch;
    $base =~ s/\.diff//;
    system "grep", "-n", "-B", "5", "$base", "../rules.patch";
    print "\n";
}

print "# you can add notes with this template\n";
for my $patch (sort keys %inspect) {
    print "# $patch\n";
}