]> git.donarmstrong.com Git - bugscan.git/blob - cleancomments
Make bugscan understand BTS versioning.
[bugscan.git] / cleancomments
1 #!/usr/bin/perl
2 # vim: ts=4 sw=4 nowrap
3
4 # Read a comments-file and output only the comments that are still relevant
5
6 use Getopt::Std;
7 require scanlib;
8 require bugcfg;
9
10 $Version                = "CommentClean 1.0\nCopyright (C) Wichert Akkerman <wakkerma\@debian.org>\n";
11 $html                   = 0;
12 $statusfile             = "status";
13 $commentfile    = "comments";
14
15 sub ShowVersion() {
16         print "$Version\n";
17         exit 0;
18 }
19
20 sub ShowUsage() {
21         print <<EOF;
22 Usage:
23   $0 [-V] [-h] [-S file] [-C file]
24 Options:
25   -V    show version
26   -h    show some (hopefully) helpfull information
27   -S    use different statusfile
28   -C    use different commentfile
29 EOF
30         exit 0;
31 }
32
33
34 getopts('VhS:C:');
35 ShowUsage if ($opt_h);
36 ShowVersion if ($opt_V);
37 $statusfile=$opt_S if ($opt_S);
38 $commentfile=$opt_C if ($opt_C);
39
40 &readstatus($statusfile);
41 &readcomments($commentfile);
42
43 for $p (keys %packagelist) {
44         for $nr (split(/ /, $packagelist{$p})) {
45                 $found{$nr}=1;
46         }
47 }
48
49 for $n (sort keys %exclude) {
50         print "$n EXCLUDE\n\n"
51                 if (defined($found{$n}) or defined ($packagelist{$n}));
52 }
53
54 for $n (sort keys %comments) {
55         print "$n\n$comments{$n}\n"
56                 if (defined($found{$n}) or defined ($packagelist{$n}));
57 }
58
59 exit 0;
60