]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2003-05-17 12:56:51 by cjwatson]
authorcjwatson <>
Sat, 17 May 2003 19:56:51 +0000 (11:56 -0800)
committercjwatson <>
Sat, 17 May 2003 19:56:51 +0000 (11:56 -0800)
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.

cgi/common.pl
cgi/pkgindex.cgi
cgi/pkgreport.cgi

index b46e84aeae64960f8e25dbfde9232c3b33b4e349..09bc85798aad1ac8219331f709ed6815233dfb76 100644 (file)
@@ -436,9 +436,10 @@ sub countbugs {
     while(<I>) 
     {
         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;
index 69cc552240312646181c640102df314d031e5af7..6654ef2743d5ced4d3498c089a34d22845856bbe 100755 (executable)
@@ -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 = "<p>Note that with multi-binary packages there may be other\n";
   $note .= "reports filed under the different binary package names.</p>\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 = "<p>Note that maintainers may use different Maintainer fields for\n";
   $note .= "different packages, so there may be other reports filed under\n";
index 15345c919f30d9f8ccb50da7dfa7f326ab5873bb..0adaca201b598f2022425bbc27bc3a7b06d90f66 100755 (executable)
@@ -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;