- next if $relinfo eq '' and not $premature{$f};
- $premature{$f}++ if $relinfo eq '';
-
- $taginfo = "[";
- $taginfo .= ($bug->{'keywords'} =~ /\bpending\b/ ? "P" : " ");
- $taginfo .= ($bug->{'keywords'} =~ /\bpatch\b/ ? "+" : " ");
- $taginfo .= ($bug->{'keywords'} =~ /\bhelp\b/ ? "H" : " ");
- $taginfo .= ($bug->{'keywords'} =~ /\bmoreinfo\b/ ? "M" : " ");
- $taginfo .= ($bug->{'keywords'} =~ /\bunreproducible\b/ ? "R" : " ");
- $taginfo .= ($bug->{'keywords'} =~ /\bsecurity\b/ ? "S" : " ");
- $taginfo .= ($bug->{'keywords'} =~ /\bupstream\b/ ? "U" : " ");
- $taginfo .= ($bug->{'keywords'} =~ /\betch-ignore\b/ ? "I" : " ");
- $taginfo .= "]";
+ if (defined($section{$bug->{'package'}}) && $section{$bug->{'package'}} eq 'pseudo') {
+ # versioning information makes no sense for pseudo packages,
+ # just use the tags
+ for my $dist qw(oldstable stable testing unstable experimental) {
+ $bi->{$dist} = $disttags{$dist};
+ }
+ next if (length($bug->{'done'}));
+ } else {
+ my $affects_any = 0;
+
+ # only bother to check the versioning status for the distributions indicated by the tags
+ for my $dist qw(oldstable stable testing unstable experimental) {
+ local $SIG{__WARN__} = sub {};
+
+ $bi->{$dist} = 0;
+ next if (!$disttags{$dist});
+
+ my $presence = Debbugs::Status::bug_presence(
+ bug => $f,
+ status => $bug,
+ dist => $dist,
+ arch => \@bugcfg::architectures
+ );
+
+ # ignore bugs that are absent/fixed in this distribution, include everything
+ # else (that is, "found" which says that the bug is present, and undef, which
+ # indicates that no versioning information is present and it's not closed
+ # unversioned)
+ if (!defined($presence) || ($presence ne 'absent' && $presence ne 'fixed')) {
+ $bi->{$dist} = 1;
+ $affects_any = 1;
+ }
+ }
+
+ next if !$affects_any;
+ }
+
+ for my $keyword qw(pending patch help moreinfo unreproducible security upstream sarge-ignore etch-ignore) {
+ $bi->{$keyword} = grep(/^$keyword$/, @tags);
+ }