X-Git-Url: https://git.donarmstrong.com/?p=bugscan.git;a=blobdiff_plain;f=scanlib.pm;h=3fc237e675fbc5cac73b27fec02e55cc24b254b2;hp=3680b10f2a65a7804693a6d5ca3bdd8d689392cf;hb=75cfa9bd35db9e6cd57577d9b3000a073a186164;hpb=086ede49f3aef03abe22686dd67dd4d2012b3440 diff --git a/scanlib.pm b/scanlib.pm index 3680b10..3fc237e 100644 --- a/scanlib.pm +++ b/scanlib.pm @@ -225,11 +225,11 @@ sub scanspooldir() { $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" : ""); + $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 ''; @@ -371,15 +371,30 @@ my $_version_cache = {}; sub get_status() { my ($bugnr, $bug, $dist) = @_; + my $status = 'pending'; + my @versions = Debbugs::Status::getversions($bug->{'package'}, $dist, undef); - my @sourceversions = Debbugs::Status::makesourceversions($bug->{'package'}, $dist, @versions); + my @sourceversions = Debbugs::Status::makesourceversions($bug->{'package'}, undef, @versions); - return Debbugs::Status::max_buggy(bug => $bugnr, + if (@sourceversions) { + my $max_buggy = Debbugs::Status::max_buggy(bug => $bugnr, sourceversions => \@sourceversions, found => $bug->{'found_versions'}, fixed => $bug->{'fixed_versions'}, version_cache => $_version_cache, package => $bug->{'package'}); + if ($max_buggy eq 'absent') { + $status = 'absent'; + } elsif ($max_buggy eq 'fixed') { + $status = 'done'; + } + } + if (length($bug{'done'}) and + (not @sourceversions or not @{$status{'fixed_versions'}})) { + $status = 'done'; + } + + return $status; } sub check_worry {