- $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});
+ my $presence = Debbugs::Status::bug_presence(bug => $f, status => $bug, dist => $dist);
+
+ # 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));
+ }
+ }