- $status_oldstable = get_status($f, $bug, 'oldstable') if ($oldstable_tag);
- $status_stable = get_status($f, $bug, 'stable') if ($stable_tag);
- $status_testing = get_status($f, $bug, 'testing') if ($testing_tag);
- $status_unstable = get_status($f, $bug, 'unstable') if ($unstable_tag);
- $status_experimental = get_status($f, $bug, '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));
+ }
+ }