- $relinfo = "";
- $relinfo .= ($s_tags =~ /\bwoody\b/ ? "O" : "");
- $relinfo .= ($s_tags =~ /\bsarge(|\s.*)%/ ? "S" : "");
- $relinfo .= ($s_tags =~ /\betch(|\s.*)$/ ? "T" : "");
- # etch-ignore matches \betch\b :(
- $relinfo .= ($s_tags =~ /\bsid\b/ ? "U" : "");
- $relinfo .= ($s_tags =~ /\bexperimental\b/ ? "E" : "");
+ # only bother to check the versioning status for the distributions indicated by the tags
+ my $status_oldstable = get_status($f, $bug, 'oldstable') if ($oldstable_tag);
+ my $status_stable = get_status($f, $bug, 'stable') if ($stable_tag);
+ my $status_testing = get_status($f, $bug, 'testing') if ($testing_tag);
+ my $status_unstable = get_status($f, $bug, 'unstable') if ($unstable_tag);
+ my $status_experimental = get_status($f, $bug, 'experimental') if ($experimental_tag);
+
+ my $relinfo = "";
+ $relinfo .= (($oldstable_tag && $status_oldstable eq 'pending') ? "O" : "");
+ $relinfo .= (($stable_tag && $status_stable eq 'pending') ? "S" : "");
+ $relinfo .= (($testing_tag && $status_testing eq 'pending') ? "T" : "");
+ $relinfo .= (($unstable_tag && $status_unstable eq 'pending') ? "U" : "");
+ $relinfo .= (($experimental_tag && $status_experimental eq 'pending') ? "E" : "");
+
+ next if $relinfo eq '' and not $premature{$f};
+ $premature{$f}++ if $relinfo eq '';