From: cjwatson <> Date: Sat, 17 May 2003 19:56:51 +0000 (-0800) Subject: [project @ 2003-05-17 12:56:51 by cjwatson] X-Git-Tag: release/2.6.0~913 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=64ffc95ed7a3b149782675d45915258a7302e96e;p=debbugs.git [project @ 2003-05-17 12:56:51 by cjwatson] Display bugs filed against multiple packages on all the relevant package/source/maintainer pages rather than just the first one; patch amended slightly from one by H. S. Teoh, #65773. --- diff --git a/cgi/common.pl b/cgi/common.pl index b46e84a..09bc857 100644 --- a/cgi/common.pl +++ b/cgi/common.pl @@ -436,9 +436,10 @@ sub countbugs { while() { if (m/^(\S+)\s+(\d+)\s+(\d+)\s+(\S+)\s+\[\s*([^]]*)\s*\]\s+(\w+)\s+(.*)$/) { - my $x = $bugfunc->(pkg => $1, bug => $2, status => $4, + my @x = $bugfunc->(pkg => $1, bug => $2, status => $4, submitter => $5, severity => $6, tags => $7); - $count{$x}++; + local $_; + $count{$_}++ foreach @x; } } close I; diff --git a/cgi/pkgindex.cgi b/cgi/pkgindex.cgi index 69cc552..6654ef2 100755 --- a/cgi/pkgindex.cgi +++ b/cgi/pkgindex.cgi @@ -57,7 +57,7 @@ my %htmldescrip = (); my %sortkey = (); if ($indexon eq "pkg") { $tag = "package"; - %count = countbugs(sub {my %d=@_; return $d{"pkg"}}); + %count = countbugs(sub {my %d=@_; return splitpackages($d{"pkg"})}); $note = "

Note that with multi-binary packages there may be other\n"; $note .= "reports filed under the different binary package names.

\n"; foreach my $pkg (keys %count) { @@ -72,7 +72,9 @@ if ($indexon eq "pkg") { } elsif ($indexon eq "maint") { $tag = "maintainer"; %count = countbugs(sub {my %d=@_; - return emailfromrfc822($maintainers{$d{"pkg"}} || ""); + return map { + emailfromrfc822($maintainers{$_}) || () + } splitpackages($d{"pkg"}); }); $note = "

Note that maintainers may use different Maintainer fields for\n"; $note .= "different packages, so there may be other reports filed under\n"; diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi index 15345c9..0adaca2 100755 --- a/cgi/pkgreport.cgi +++ b/cgi/pkgreport.cgi @@ -109,12 +109,19 @@ my $tag; my @bugs; if (defined $pkg) { $tag = "package $pkg"; - @bugs = @{getbugs(sub {my %d=@_; return $pkg eq $d{"pkg"}}, 'package', $pkg)}; + @bugs = @{getbugs(sub {my %d=@_; + return grep($pkg eq $_, splitpackages($d{"pkg"})) + }, 'package', $pkg)}; } elsif (defined $src) { $tag = "source $src"; my @pkgs = getsrcpkgs($src); push @pkgs, $src if ( !grep(/^\Q$src\E$/, @pkgs) ); - @bugs = @{getbugs(sub {my %d=@_; return grep($d{"pkg"} eq $_, @pkgs)}, 'package', @pkgs)}; + @bugs = @{getbugs(sub {my %d=@_; + foreach my $try (splitpackages($d{"pkg"})) { + return 1 if grep($try eq $_, @pkgs); + } + return 0; + }, 'package', @pkgs)}; } elsif (defined $maint) { my %maintainers = %{getmaintainers()}; $tag = "maintainer $maint"; @@ -127,24 +134,36 @@ if (defined $pkg) { } if ($maint eq "") { @bugs = @{getbugs(sub {my %d=@_; my $me; - ($me = $maintainers{$d{"pkg"}}||"") =~ s/\s*\(.*\)\s*//; - $me = $1 if ($me =~ m/<(.*)>/); - return $me eq $maint; - })}; + foreach my $try (splitpackages($d{"pkg"})) { + ($me = $maintainers{$try} || "") + =~ s/\s*\(.*\)\s*//; + $me = $1 if ($me =~ m/<(.*)>/); + return 1 if $me eq $maint; + } + return 0; + })}; } else { @bugs = @{getbugs(sub {my %d=@_; my $me; - ($me = $maintainers{$d{"pkg"}}||"") =~ s/\s*\(.*\)\s*//; - $me = $1 if ($me =~ m/<(.*)>/); - return $me eq $maint; - }, 'package', @pkgs)}; + foreach my $try (splitpackages($d{"pkg"})) { + ($me = $maintainers{$try} || "") + =~ s/\s*\(.*\)\s*//; + $me = $1 if ($me =~ m/<(.*)>/); + return 1 if $me eq $maint; + } + return 0; + }, 'package', @pkgs)}; } } elsif (defined $maintenc) { my %maintainers = %{getmaintainers()}; $tag = "encoded maintainer $maintenc"; @bugs = @{getbugs(sub {my %d=@_; - return maintencoded($maintainers{$d{"pkg"}} || "") - eq $maintenc - })}; + foreach my $try (splitpackages($d{"pkg"})) { + return 1 if + maintencoded($maintainers{$try} || "") eq + $maintenc; + } + return 0; + })}; } elsif (defined $submitter) { $tag = "submitter $submitter"; @bugs = @{getbugs(sub {my %d=@_; my $se;