From e06083832a92a1b36fd18599326099baf292b09b Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Wed, 31 Dec 2008 20:04:20 +0100 Subject: [PATCH] * By default indicate the source package * Handle the new src:foo to indicate source package foo properly * Handle multiple src/binary packages properly --- Debbugs/Status.pm | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/Debbugs/Status.pm b/Debbugs/Status.pm index fe90264..3e211b6 100644 --- a/Debbugs/Status.pm +++ b/Debbugs/Status.pm @@ -879,9 +879,8 @@ 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.] +bug could belong to (or does belong to in the case of bugs assigned to +a source package). Defaults to true. =back @@ -920,7 +919,7 @@ sub get_bug_status { optional => 1, }, indicatesource => {type => BOOLEAN, - default => 0, + default => 1, }, }, ); @@ -951,15 +950,30 @@ sub get_bug_status { $status{tags} = $status{keywords}; my %tags = map { $_ => 1 } split ' ', $status{tags}; + $status{package} = '' if not defined $status{package}; $status{"package"} =~ s/\s*$//; - if ($param{indicatesource} and $status{package} ne '') { - $status{source} = join(', ',binarytosource($status{package})); - } - else { - $status{source} = 'unknown'; + # if we aren't supposed to indicate the source, we'll return + # unknown here. + $status{source} = 'unknown'; + if ($param{indicatesource}) { + my @packages = split /\s*,\s*/, $status{package}; + my @source; + for my $package (@packages) { + next if $package eq ''; + if ($package =~ /^src\:$/) { + push @source,$1; + } + else { + push @source, binarytosource($package); + } + } + if (@source) { + $status{source} = join(', ',@source); + } } + $status{"package"} = 'unknown' if ($status{"package"} eq ''); - $status{"severity"} = 'normal' if ($status{"severity"} eq ''); + $status{"severity"} = 'normal' if (not defined $status{severity} or $status{"severity"} eq ''); $status{"pending"} = 'pending'; $status{"pending"} = 'forwarded' if (length($status{"forwarded"})); -- 2.39.2