- $status_oldstable = getbugstatus($bug, undef, 'oldstable') if ($oldstable_tag);
- $status_stable = getbugstatus($bug, undef, 'stable') if ($stable_tag);
- $status_testing = getbugstatus($bug, undef, 'testing') if ($testing_tag);
- $status_unstable = getbugstatus($bug, undef, 'unstable') if ($unstable_tag);
- $status_experimental = getbugstatus($bug, undef, 'experimental') if ($experimental_tag);
-
- $relinfo = "";
- $relinfo .= (($oldstable_tag && $status_oldstable->{'pending'} eq 'pending') ? "O" : "");
- $relinfo .= (($stable_tag && $status_stable->{'pending'} eq 'pending') ? "S" : "");
- $relinfo .= (($testing_tag && $status_testing->{'pending'} eq 'pending') ? "T" : "");
- $relinfo .= (($unstable_tag && $status_unstable->{'pending'} eq 'pending') ? "U" : "");
- $relinfo .= (($experimental_tag && $status_experimental->{'pending'} eq 'pending') ? "E" : "");
+ my $relinfo = "";
+ for my $dist qw(oldstable stable testing unstable experimental) {
+ local $SIG{__WARN__} = sub {};
+
+ next if (!$disttags{$dist});
+
+ # only check for the archs we care about
+ my %svhash = ();
+ for my $arch qw(alpha amd64 arm hppa i386 ia64 mips mipsel powerpc s390 sparc) {
+ my @versions = Debbugs::Packages::getversions($bug->{'package'}, $dist, $arch);
+ my @sourceversions = Debbugs::Packages::makesourceversions($bug->{'package'}, $arch, @versions);
+
+ for my $sv (@sourceversions) {
+ $svhash{$sv} = 1;
+ }
+ }
+
+ my @sourceversions = keys %svhash;
+ my $presence = Debbugs::Status::bug_presence(bug => $f, status => $bug, sourceversions => \@sourceversions);
+
+ # 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')) {
+ $relinfo .= uc(substr($dist, 0, 1));
+ }
+ }