X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FStatus.pm;h=73a1dbc108f9d7af6d844a0120ed06e5d35c2de3;hb=90aed5cbeb0a7cf6bfbbe4ed7ba9e2268dd50f6b;hp=b6f1375f4536804cecf7fcb670328f1b39ac114c;hpb=96229281914b6c90ad60c34e02809fc4cd4b5e73;p=debbugs.git diff --git a/Debbugs/Status.pm b/Debbugs/Status.pm index b6f1375..73a1dbc 100644 --- a/Debbugs/Status.pm +++ b/Debbugs/Status.pm @@ -529,24 +529,20 @@ sub removefixedversions { my $version = shift; my $isbinary = shift; return unless defined $version; - undef $package if $package =~ m[(?:\s|/)]; - my $source = $package; - - if (defined $package and $isbinary) { - my @srcinfo = binarytosource($package, $version, undef); - if (@srcinfo) { - # We know the source package(s). Use a fully-qualified version. - removefixedversions($data, $_->[0], $_->[1], '') foreach @srcinfo; - return; - } - # Otherwise, an unqualified version will have to do. - undef $source; - } foreach my $ver (split /[,\s]+/, $version) { - my $sver = defined($source) ? "$source/$ver" : ''; - @{$data->{fixed_versions}} = - grep { $_ ne $ver and $_ ne $sver } @{$data->{fixed_versions}}; + if ($ver =~ m{/}) { + # fully qualified version + @{$data->{fixed_versions}} = + grep {$_ ne $ver} + @{$data->{fixed_versions}}; + } + else { + # non qualified version; delete all matchers + @{$data->{fixed_versions}} = + grep {$_ !~ m[(?:^|/)\Q$ver\E$]} + @{$data->{fixed_versions}}; + } } } @@ -620,11 +616,17 @@ sub bug_archiveable{ my $status = $param{status}; if (not exists $param{status} or not defined $status) { $status = read_bug(bug=>$param{bug}); - return undef if not defined $status; + if (not defined $status) { + print STDERR "Cannot archive $param{bug} because it does not exist\n" if $DEBUG; + return undef; + } } # Bugs can be archived if they are # 1. Closed - return $cannot_archive if not defined $status->{done} or not length $status->{done}; + if (not defined $status->{done} or not length $status->{done}) { + print STDERR "Cannot archive $param{bug} because it is not done\n" if $DEBUG; + return $cannot_archive + } # If we just are checking if the bug can be archived, we'll not even bother # checking the versioning information if the bug has been -done for less than 28 days. my $log_file = getbugcomponent($param{bug},'log'); @@ -732,6 +734,7 @@ sub bug_archiveable{ # 6. at least 28 days have passed since the last action has occured or the bug was closed my $age = ceil($max_log_age); if ($age > 0 or $min_archive_days > 0) { + print STDERR "Cannot archive $param{bug} because not enough days have passed\n" if $DEBUG; return $param{days_until}?max($age,$min_archive_days):0; } else { @@ -770,6 +773,11 @@ currently not correctly implemented. dist, arch, and version. [The entries in this array must be in the "source/version" format.] Eventually this can be used to for caching. +=item indicatesource -- if true, indicate which source packages this +bug could belong to. Defaults to false. [Note that eventually we will +properly allow bugs that only affect a source package, and this will +become always on.] + =back Note: Currently the version information is cached; this needs to be @@ -806,6 +814,9 @@ sub get_bug_status { sourceversions => {type => ARRAYREF, optional => 1, }, + indicatesource => {type => BOOLEAN, + default => 0, + }, }, ); my %status; @@ -836,6 +847,12 @@ sub get_bug_status { my %tags = map { $_ => 1 } split ' ', $status{tags}; $status{"package"} =~ s/\s*$//; + if ($param{indicatesource} and $status{package} ne '') { + $status{source} = join(', ',binarytosource($status{package})); + } + else { + $status{source} = 'unknown'; + } $status{"package"} = 'unknown' if ($status{"package"} eq ''); $status{"severity"} = 'normal' if ($status{"severity"} eq ''); @@ -980,7 +997,8 @@ sub bug_presence { version_cache => $version_cache, ); } - elsif (defined $param{dist}) { + elsif (defined $param{dist} and + not exists $pseudo_desc->{$status{package}}) { return 'absent'; } if (length($status{done}) and