blob: b810b9c710d53d253f489202dfe9da8f903f7bdf (
plain) (
blame)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
#!/usr/bin/perl -w
# Analyse patch-tracker entries
# Problems reported to stderr
# Suggested entrie printed to stdout
# Must be run in directory with patch-tracker entries
#
# (C) 2006 Horms <horms@verge.net.au>
# Released under the terms of the GNU GPL v2
use strict;
my $BOILERPLATE = "00boilerplate";
sub readfile {
my ($file) = (@_);
my $l = [];
my $h = {};
my $key = undef;
open BP, "<$file" or die "Could not open \"$file\" for reading\n";
while (<BP>) {
if (m/(^[a-zA-Z0-9.-]+:)(.*)/ and $1 ne "http:") {
$key = $1;
push @$l , $1;
$h->{"$1"} = $2 . "\n";
}
elsif (defined $key) {
$h->{"$key"} .= $_;
}
else {
print STDERR "Leading crap: $_";
}
}
close BP;
return ($l, $h);
}
{
my $bp_l;
my $bp_h;
my $l;
my $h;
($bp_l, $bp_h) = readfile($BOILERPLATE);
foreach my $f (@ARGV) {
($l, $h) = readfile($f);
my $log_p = (scalar @ARGV > 1) ? "$f: " : "";
for my $i (@$bp_l) {
if (defined $h->{"$i"}) {
print $i . $h->{"$i"};
delete $h->{"$i"};
}
else {
print STDERR $log_p . "Missing Field: \"$i\"\n";
print $i . " XXX\n";
}
}
for my $i (keys %$h) {
print STDERR $log_p . "Extra Feild: \"$i\"\n";
if (defined $h->{"$i"}) {
print $i . $h->{"$i"};
}
else {
print $i . " XXX\n";
}
}
}
}
|