From: ajt <> Date: Fri, 17 Nov 2000 19:46:07 +0000 (-0800) Subject: [project @ 2000-11-17 11:46:07 by ajt] X-Git-Tag: release/2.6.0~1176 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b9d6d1c65ddbb07de192276d03b7f4086c65a3e3;p=debbugs.git [project @ 2000-11-17 11:46:07 by ajt] random bug fixes --- diff --git a/cgi/common.pl b/cgi/common.pl index ae8cc17..d67d7af 100644 --- a/cgi/common.pl +++ b/cgi/common.pl @@ -124,7 +124,7 @@ sub htmlindexentrystatus { } sub submitterurl { - my $ref = shift; + my $ref = shift || ""; my $params = "submitter=" . emailfromrfc822($ref); $params .= "&archive=yes" if ($common_archive); $params .= "&repeatmerged=yes" if ($common_repeatmerged); @@ -132,7 +132,7 @@ sub submitterurl { } sub mainturl { - my $ref = shift; + my $ref = shift || ""; my $params = "maint=" . emailfromrfc822($ref); $params .= "&archive=yes" if ($common_archive); $params .= "&repeatmerged=yes" if ($common_repeatmerged); @@ -150,7 +150,7 @@ sub pkgurl { sub htmlsanit { my %saniarray = ('<','lt', '>','gt', '&','amp', '"','quot'); - my $in = shift; + my $in = shift || ""; my $out; while ($in =~ m/[<>&"]/) { $out .= $`. '&'. $saniarray{$&}. ';'; diff --git a/cgi/pkgindex.cgi b/cgi/pkgindex.cgi index 74ec98a..24fea17 100755 --- a/cgi/pkgindex.cgi +++ b/cgi/pkgindex.cgi @@ -49,21 +49,22 @@ set_option("archive", $archive); my %count; my $tag; my $note; -my $linksub; +my %htmldescrip = (); +my %sortkey = (); if ($indexon eq "pkg") { $tag = "package"; %count = countbugs(sub {my %d=@_; return $d{"pkg"}}); $note = "

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

\n"; - $linksub = sub { - my $pkg = shift; - sprintf('%s ' - . '(maintained by %s', + foreach my $pkg (keys %count) { + $sortkey{$pkg} = lc $pkg; + $htmldescrip{$pkg} = sprintf('%s ' + . '(maintainer: %s)', pkgurl($pkg), htmlsanit($pkg), mainturl($maintainers{$pkg}), - htmlsanit($maintainers{$pkg})); - }; + htmlsanit($maintainers{$pkg} || "(unknown)")); + } } elsif ($indexon eq "maint") { $tag = "maintainer"; %count = countbugs(sub {my %d=@_; @@ -72,17 +73,17 @@ if ($indexon eq "pkg") { $note = "

Note that maintainers may use different Maintainer fields for\n"; $note .= "different packages, so there may be other reports filed under\n"; $note .= "different addresses.

\n"; - $linksub = sub { - my $maint = shift; my $maintfull = $maint; - foreach my $x (values %maintainers) { - if (emailfromrfc822($x) eq $maint) { - $maintfull = $x; last; - } - } - sprintf('%s', + my %email2maint = (); + for my $x (values %maintainers) { + my $y = emailfromrfc822($x); + $email2maint{$y} = $x unless (defined $email2maint{$y}); + } + foreach my $maint (keys %count) { + $sortkey{$maint} = lc $email2maint{$maint} || "(unknown)"; + $htmldescrip{$maint} = sprintf('%s', mainturl($maint), - htmlsanit($maintfull)); - }; + htmlsanit($email2maint{$maint}) || "(unknown)") + } } elsif ($indexon eq "submitter") { $tag = "submitter"; my %fullname = (); @@ -91,20 +92,20 @@ if ($indexon eq "pkg") { $fullname{$em} = $f if (!defined $fullname{$em}); return $em; }); - $linksub = sub { - my $sub = shift; - sprintf('%s', + foreach my $sub (keys %count) { + $sortkey{$sub} = lc $fullname{$sub}; + $htmldescrip{$sub} = sprintf('%s', submitterurl($sub), htmlsanit($fullname{$sub})); - }; + } $note = "

Note that people may use different email accounts for\n"; $note .= "different bugs, so there may be other reports filed under\n"; $note .= "different addresses.

\n"; } my $result = "\n"; @@ -115,7 +116,7 @@ print "\n" . "\n" . '' . "\n"; -print "

" . "$debbugs::gProject $Archived $debbugs::gBug report logs: $tag" . +print "

" . "$debbugs::gProject $Archived $debbugs::gBug report logs by $tag" . "

\n"; print $note;