2 # vim: ts=8 sw=8 nowrap
4 # Compare two buglist status-files
12 my $Version = "BugDiff 1.0\nCopyright (C) Wichert Akkerman <wakkerma\@debian.org>\n";
25 $0 [-V] [-h] [-H] <status1> <status2>
28 -h show some (hopefully) helpfull information
29 -H produce HTML output
30 -n list newly opened bugs
40 print "<h2>Closed/downgraded release-critical bugs</h2>\n";
42 for my $p (sort keys %removed) {
43 print " <li><em>" . &scanlib::wwwname($p) . ":</em>\n";
44 for $b (sort @{$removed{$p}}) {
45 print &scanlib::wwwnumber($b) . " ";
52 print "Closed/downgraded release-critical bugs:\n" if (scalar keys %removed>0);
53 for my $p (sort keys %removed) {
55 print join(", ", sort @{$removed{$p}});
65 print "<h2>Opened/upgraded release-critical bugs</h2>\n";
67 for my $p (sort keys %new) {
68 print " <li><em>" . &scanlib::wwwname($p) . ":</em>\n";
69 for $b (sort @{$new{$p}}) {
70 print &scanlib::wwwnumber($b) . " ";
77 print "Opened/upgraded release-critical bugs:\n" if (%new);
78 for my $p (sort keys %new) {
80 print join(", ", sort @{$new{$p}});
87 my ($opened, $closed) = @_;
90 print "<STRONG>" . ($closed ? $closed : "NO") . "</STRONG> release-critical bugs were closed and ";
91 print "<STRONG>" . ($opened ? $opened : "NONE") . "</STRONG> were opened.<P>\n";
93 print "" . ($closed ? $closed : "NO") . " release-critical bugs were closed ";
94 print "and " . ($opened ? $opened : "NONE") . " were opened.\n\n";
98 our ($opt_V, $opt_h, $opt_H, $opt_n, $opt_c, $opt_s);
100 ShowUsage if ($opt_h or ($#ARGV != 1));
101 ShowVersion if ($opt_V);
104 scanlib::readstatus($ARGV[0]);
105 my %oldbugs=%scanlib::packagelist;
106 %scanlib::packagelist=();
108 scanlib::readstatus($ARGV[1]);
111 for my $p (keys %oldbugs) {
112 for $b (@{$oldbugs{$p}}) {
113 if (!defined($scanlib::packagelist{$p}) || scalar grep { $_ == $b } @{$scanlib::packagelist{$p}} == 0) {
114 push @{$removed{$p}}, $b;
121 for my $p (keys %scanlib::packagelist) {
122 for $b (@{$scanlib::packagelist{$p}}) {
123 if (!defined($oldbugs{$p}) || scalar grep { $_ == $b } @{$oldbugs{$p}} == 0) {
124 push @{$new{$p}}, $b;
130 statistics($opened, $closed) if ($opt_s);
131 closedbugs if ($opt_c);
132 openedbugs if ($opt_n);