- $version = getversion($status{package}, $common_dist, $common_arch);
- }
-
- if (defined $version) {
- my $buggy = buggyversion($bugnum, $version, \%status);
- if ($buggy eq 'absent') {
+ @versions = getversions($status{package}, $common_dist, $common_arch);
+ }
+
+ # TODO: This should probably be handled further out for efficiency and
+ # for more ease of distinguishing between pkg= and src= queries.
+ my @sourceversions = makesourceversions($status{package}, $common_arch,
+ @versions);
+
+ if (@sourceversions) {
+ # Resolve bugginess states (we might be looking at multiple
+ # architectures, say). Found wins, then fixed, then absent.
+ my $maxbuggy = 'absent';
+ for my $version (@sourceversions) {
+ my $buggy = buggyversion($bugnum, $version, \%status);
+ if ($buggy eq 'found') {
+ $maxbuggy = 'found';
+ last;
+ } elsif ($buggy eq 'fixed' and $maxbuggy ne 'found') {
+ $maxbuggy = 'fixed';
+ }
+ }
+ if ($maxbuggy eq 'absent') {