X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=cgi%2Fpkgindex.cgi;h=06154d5c6e9f15aa25cd00200b0fba119a537d7f;hb=dda30e899cb32a91165972a5f902fb370e99c16f;hp=8adbfb86c18714eba413c515d1dd387b2acad717;hpb=ed6a5cd2e37711d1b2354879fa83314a1812eaf4;p=debbugs.git diff --git a/cgi/pkgindex.cgi b/cgi/pkgindex.cgi index 8adbfb8..06154d5 100755 --- a/cgi/pkgindex.cgi +++ b/cgi/pkgindex.cgi @@ -4,12 +4,14 @@ use warnings; use strict; use POSIX qw(strftime nice); -use Debbugs::Config; +use Debbugs::Config qw(:globals :text :config); use CGI::Simple; use Debbugs::CGI qw(:util :url :html); -use Debbugs::Common qw(getmaintainers); +use Debbugs::Common qw(getmaintainers getparsedaddrs); use Debbugs::Bugs qw(count_bugs); use Debbugs::Status qw(:status); +use Debbugs::Packages qw(getpkgsrc); +use Debbugs::Text qw(:templates); nice(5); @@ -57,9 +59,6 @@ my %maintainers = %{&getmaintainers()}; my %strings = (); my $dtime = strftime "%a, %e %b %Y %T UTC", gmtime; -my $tail_html = '';#$gHTMLTail; -$tail_html = '';#$gHTMLTail; -$tail_html =~ s/SUBSTITUTE_DTIME/$dtime/; my %count; my $tag; @@ -68,7 +67,9 @@ my %htmldescrip = (); my %sortkey = (); if ($indexon eq "pkg") { $tag = "package"; - %count = count_bugs(function => sub {my %d=@_; return splitpackages($d{"pkg"})}); + %count = count_bugs(function => sub {my %d=@_; return splitpackages($d{"pkg"})}, + archive => $archive, + ); if (defined $param{first}) { %count = map { if (/^\Q$param{first}\E/) { @@ -84,11 +85,9 @@ if ($indexon eq "pkg") { foreach my $pkg (keys %count) { $sortkey{$pkg} = lc $pkg; $htmldescrip{$pkg} = sprintf('%s (%s)', - pkg_url(pkg => $pkg), + package_links(package => $pkg, links_only=>1), html_escape($pkg), - htmlize_maintlinks(sub { $_[0] == 1 ? 'maintainer: ' - : 'maintainers: ' }, - $maintainers{$pkg})); + package_links(maint=>$maintainers{$pkg})); } } elsif ($indexon eq "src") { $tag = "source package"; @@ -103,20 +102,20 @@ if ($indexon eq "pkg") { } } keys %count; } - %count = countbugs(function => sub {my %d=@_; + %count = count_bugs(function => sub {my %d=@_; return map { $pkgsrc->{$_} || $_ } splitpackages($d{"pkg"}); - }); + }, + archive => $archive, + ); $note = ""; foreach my $src (keys %count) { $sortkey{$src} = lc $src; $htmldescrip{$src} = sprintf('%s (%s)', - srcurl($src), + package_links(src => $src, links_only=>1), html_escape($src), - htmlize_maintlinks(sub { $_[0] == 1 ? 'maintainer: ' - : 'maintainers: ' }, - $maintainers{$src})); + package_links(maint => $maintainers{$src})); } } elsif ($indexon eq "maint") { $tag = "maintainer"; @@ -130,7 +129,9 @@ if ($indexon eq "pkg") { } map { $_->address } @me; } splitpackages($d{"pkg"}); - }); + }, + archive => $archive, + ); if (defined $param{first}) { %count = map { if (/^\Q$param{first}\E/) { @@ -158,7 +159,9 @@ if ($indexon eq "pkg") { unless exists $fullname{$addr->address}; } map { $_->address } @se; - }); + }, + archive => $archive, + ); if (defined $param{first}) { %count = map { if (/^\Q$param{first}\E/) { @@ -180,7 +183,9 @@ if ($indexon eq "pkg") { $note .= "different addresses.

\n"; } elsif ($indexon eq "tag") { $tag = "tag"; - %count = count_bugs(function => sub {my %d=@_; return split ' ', $d{tags}; }); + %count = count_bugs(function => sub {my %d=@_; return split ' ', $d{tags}; }, + archive => $archive, + ); if (defined $param{first}) { %count = map { if (/^\Q$param{first}\E/) { @@ -223,11 +228,12 @@ print "Content-Type: text/html\n\n"; print "\n"; print "\n" . - "$debbugs::gProject$Archived $debbugs::gBug reports by $tag\n" . + "$gProject$Archived $gBug reports by $tag\n" . + qq() . "\n" . '' . "\n"; -print "

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

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

\n"; print $note; @@ -256,6 +262,8 @@ else { print $result; print "
\n"; -print "

$tail_html"; - +print fill_in_template(template=>'html/html_tail', + hole_var => {'&strftime' => \&POSIX::strftime, + }, + ); print "\n";