-sub MakeStatistics() {
- local($bugcount); # Total number of bugs so far
- local($count); # Number of bugs for this package
- local($remtotal); # Total number of bugs for packages marked REMOVE
- local($patchtotal); # Total number of bugs marked patch
- local($pendingtotal); # Total number of bugs marked pending
- local($ignoretotal); # Total number of bugs marked ignore
- local($nottestingtotal); # Total number of bugs on packages not in testing
- local($worrytotal); # Total number of bugs we're actually worried about
- local($p); # Index variable
- local(%list); # List of bugnumber associated with package
-
- $bugcount=0;
- for $p (sort keys %packagelist) {
- next if (defined $exclude{$p});
- $count=0;
- for $nr (split(/ /, $packagelist{$p})) {
- $pendingtotal++ if ($bugs{$nr} =~ m/^\[[^]]*P/);
- $patchtotal++ if ($bugs{$nr} =~ m/^\[[^]]*\+/);
- $ignoretotal++ if ($bugs{$nr} =~ m/^\[[^]]*I/);
- $nottestingtotal++ if ($bugs{$nr} =~ m/ \[[^]]*X/);
- $worrytotal++ unless (
- $bugs{$nr} =~ m/^\[[^]]*I/ or
- $bugs{$nr} =~ m/ \[[^]]*X/ or
- ($bugs{$nr} =~ m/ \[[^]]*[OSUE]/ and $bugs{$nr} !~ m/ \[[^]]*T/));
-
- if (not defined($exclude{$nr})) {
- $bugcount++;
- $count++;
- }
+sub MakeStatistics {
+ my $bugcount=0; # Total number of bugs so far
+ my $patchtotal=0; # Total number of bugs marked patch
+ my $pendingtotal=0; # Total number of bugs marked pending
+ my $ignoretotal=0; # Total number of bugs marked ignore
+ my $worrytotal=0; # Total number of bugs we're actually worried about
+ my $stabletotal=0; # Total number of bugs affecting stable
+ my $oldstabletotal=0; # Total number of bugs affecting oldstable
+ my %list; # List of bugnumber associated with package
+ my %seen_bugs; # bugs which have already been counted
+
+ for my $p (sort keys %scanlib::packagelist) {
+ my $count = 0; # Number of bugs for this package
+
+ for my $nr (@{$scanlib::packagelist{$p}}) {
+ # if we've already counted this bug, we don't want to count it again
+ next if $seen_bugs{$nr};
+ $seen_bugs{$nr} = 1;
+ $pendingtotal++ if ($scanlib::bugs{$nr}->{'pending'});
+ $patchtotal++ if ($scanlib::bugs{$nr}->{'patch'});
+ $ignoretotal++ if ($scanlib::bugs{$nr}->{$bugcfg::debian_releases->{stable}.'-ignore'} || $scanlib::bugs{$nr}->{$bugcfg::debian_releases->{testing}.'-ignore'});
+ $worrytotal++ if (scanlib::check_worry($scanlib::bugs{$nr}));
+ $stabletotal++ if (scanlib::check_worry_stable($scanlib::bugs{$nr}));
+ $oldstabletotal++ if (scanlib::check_worry_oldstable($scanlib::bugs{$nr}));
+
+ $bugcount++;
+ $count++;