]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2001-02-24 01:13:38 by doogie]
authordoogie <>
Sat, 24 Feb 2001 09:13:38 +0000 (01:13 -0800)
committerdoogie <>
Sat, 24 Feb 2001 09:13:38 +0000 (01:13 -0800)
Applied patch from bugs.debian.org/87176, which makes the code pass
references around, instead of copies, of hashes and arrays.

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

index 58de856d32eec31fd055c633cdea26bb3e2421bf..0405fd50db3e4b514097041812768a0f84bb817c 100755 (executable)
@@ -17,14 +17,14 @@ my %param = readparse();
 
 my $tail_html;
 
-my %maintainer = getmaintainers();
+my %maintainer = %{getmaintainers()};
 
 my $ref = $param{'bug'} || quit("No bug number");
 my $msg = $param{'msg'} || "";
 my $boring = ($param{'boring'} || 'no') eq 'yes'; 
 my $reverse = ($param{'reverse'} || 'no') eq 'yes';
 
-my %status = getbugstatus($ref) or &quit("Couldn't get bug status: $!");
+my %status = %{getbugstatus($ref)} or &quit("Couldn't get bug status: $!");
 
 my $indexentry;
 my $descriptivehead;
index ccf15aaa76c3405b0370485820f2ea8e4ca6f512..f1edd109087617e93e22abf43fdd86ccb701c2bc 100644 (file)
@@ -61,7 +61,7 @@ sub quit {
 
 sub htmlindexentry {
     my $ref = shift;
-    my %status = getbugstatus($ref);
+    my %status = %{getbugstatus($ref)};
     return htmlindexentrystatus(%status) if (%status);
     return "";
 }
@@ -204,11 +204,13 @@ sub allbugs {
 }
 
 sub htmlizebugs {
-    my @bugs = @_;
+    $b = $_[0];
+    my @bugs = @$b;
 
     my %section = ();
 
     my %displayshowpending = ("pending", "outstanding",
+                             "fixed", "fixed in NMU",
                               "done", "resolved",
                               "forwarded", "forwarded to upstream software authors");
 
@@ -217,7 +219,7 @@ sub htmlizebugs {
     }
 
     foreach my $bug (sort {$a<=>$b} @bugs) {
-       my %status = getbugstatus($bug);
+       my %status = %{getbugstatus($bug)};
         next unless %status;
        my @merged = sort {$a<=>$b} ($bug, split(/ /, $status{mergedwith}));
        next unless ($common_repeatmerged || $bug == $merged[0]);
@@ -255,7 +257,7 @@ sub htmlizebugs {
 
     my $result = "";
     my $anydone = 0;
-    foreach my $pending (qw(pending forwarded done)) {
+    foreach my $pending (qw(pending forwarded fixed done)) {
         foreach my $severity(@debbugs::gSeverityList) {
             $severity = $debbugs::gDefaultSeverity if ($severity eq '');
             next unless defined $section{${pending} . "_" . ${severity}};
@@ -324,16 +326,17 @@ print STDERR "done optimized\n" if ($debug);
         }
         while(<I>) {
             if (m/^(\S+)\s+(\d+)\s+(\d+)\s+(\S+)\s+\[\s*([^]]*)\s*\]\s+(\w+)\s+(.*)$/) {
-                if ($bugfunc->(pkg => $1, bug => $2, status => $4, 
-                               submitter => $5, severity => $6, tags => $7))
-               {
+               my %hash = (pkg => $1, bug => $2, status => $4,
+                           submitter => $5, severity => $6, tags => $7);
+                if ($bugfunc->(\%hash)) {
                    push (@result, $2);
                }
            }
         }
         close I;
     }
-    return sort {$a <=> $b} @result;
+    @result = sort {$a <=> $b} @result;
+    return \@result;
 }
 
 sub emailfromrfc822 {
@@ -373,7 +376,7 @@ sub getmaintainers {
     }
     close(MM);
 
-    return %maintainer;
+    return \%maintainer;
 }
 
 sub getbugstatus {
@@ -400,9 +403,10 @@ sub getbugstatus {
 
     $status{"pending"} = 'pending';
     $status{"pending"} = 'forwarded' if (length($status{"forwarded"}));
+    $status{"pending"} = 'fixed'     if ($status{"tags"} =~ /\bfixed\b/);
     $status{"pending"} = 'done'      if (length($status{"done"}));
 
-    return %status;
+    return \%status;
 }
 
 sub buglog {
index a1f3ad70318ab80677bf58c5d337ede4b6ce43d6..dd7d83f7ea8b88fd7c101ffec2e4dc3641a87553 100755 (executable)
@@ -32,7 +32,7 @@ if ($sortby !~ m/^(alpha|count)$/) {
 
 my $Archived = $archive ? "Archived" : "";
 
-my %maintainers = &getmaintainers();
+my %maintainers = %{&getmaintainers()};
 my %strings = ();
 
 $ENV{"TZ"} = 'UTC';
index cb7529aa1c9ae9e497d6e25e38224df72daba022..50d6e46aa5204d2d21596cfccc2fc9851cf9e51c 100755 (executable)
@@ -58,9 +58,9 @@ 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=@{$_[0]}; return $pkg eq $d{"pkg"}}, 'package', $pkg)};
 } elsif (defined $maint) {
-  my %maintainers = getmaintainers();
+  my %maintainers = %{getmaintainers()};
   $tag = "maintainer $maint";
   my @pkgs = ();
   foreach my $p (keys %maintainers) {
@@ -69,34 +69,34 @@ if (defined $pkg) {
     $me = $1 if ($me =~ m/<(.*)>/);
     push @pkgs, $p if ($me eq $maint);
   }
-  @bugs = getbugs(sub {my %d=@_; my $me; 
+  @bugs = @{getbugs(sub {my %d=@{$_[0]}; my $me; 
                       ($me = $maintainers{$d{"pkg"}}||"") =~ s/\s*\(.*\)\s*//;
                       $me = $1 if ($me =~ m/<(.*)>/);
                       return $me eq $maint;
-                    }, 'package', @pkgs);
+                    }, 'package', @pkgs)};
 } elsif (defined $maintenc) {
-  my %maintainers = getmaintainers();
+  my %maintainers = %{getmaintainers()};
   $tag = "encoded maintainer $maintenc";
-  @bugs = getbugs(sub {my %d=@_; 
+  @bugs = @{getbugs(sub {my %d=@_; 
                       return maintencoded($maintainers{$d{"pkg"}} || "") 
                         eq $maintenc
-                      });
+                      })};
 } elsif (defined $submitter) {
   $tag = "submitter $submitter";
-  @bugs = getbugs(sub {my %d=@_; my $se; 
+  @bugs = @{getbugs(sub {my %d=@_; my $se; 
                       ($se = $d{"submitter"} || "") =~ s/\s*\(.*\)\s*//;
                       $se = $1 if ($se =~ m/<(.*)>/);
                       return $se eq $submitter;
-                    }, 'submitter-email', $submitter);
+                    }, 'submitter-email', $submitter)};
 } elsif (defined $severity) {
   $tag = "$status $severity bugs";
-  @bugs = getbugs(sub {my %d=@_;
+  @bugs = @{getbugs(sub {my %d=@_;
                       return ($d{"severity"} eq $severity) 
                         && ($d{"status"} eq $status);
-                    });
+                    })};
 }
 
-my $result = htmlizebugs(@bugs);
+my $result = htmlizebugs(\@bugs);
 
 print "Content-Type: text/html\n\n";
 
@@ -110,7 +110,7 @@ print "<H1>" . "$debbugs::gProject $Archived $debbugs::gBug report logs: $tag" .
       "</H1>\n";
 
 if (defined $pkg) {
-    my %maintainers = getmaintainers();
+    my %maintainers = %{getmaintainers()};
     if (defined $maintainers{$pkg}) {
         print "<p>Maintainer for $pkg is <a href=\"" 
               . mainturl($maintainers{$pkg}) . "\">"