From: Mike Gabriel Date: Wed, 12 Sep 2012 07:04:49 +0000 (+0200) Subject: Fix pkgindex.cgi concerning several issues: load proper Perl modules, replace usage... X-Git-Tag: release/2.6.0~346 X-Git-Url: https://git.donarmstrong.com/?p=debbugs.git;a=commitdiff_plain;h=e8fcf4dfe70c1bc8a85b7cf928421ecb6afde5c6 Fix pkgindex.cgi concerning several issues: load proper Perl modules, replace usage of src_url and pkg_url by package_links, use html_tail from templates, use count_bugs everywhere, load bugs.css, fix global variable usage in html header. Signed-off-by: Don Armstrong --- diff --git a/cgi/pkgindex.cgi b/cgi/pkgindex.cgi index 8adbfb8..855e3fb 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; @@ -84,7 +83,7 @@ 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: ' }, @@ -103,7 +102,7 @@ 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"}); @@ -112,7 +111,7 @@ if ($indexon eq "pkg") { 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: ' }, @@ -223,11 +222,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 +256,8 @@ else { print $result; print "
\n"; -print "

$tail_html"; - +print fill_in_template(template=>'html/html_tail', + hole_var => {'&strftime' => \&POSIX::strftime, + }, + ); print "\n"; diff --git a/debian/changelog b/debian/changelog index 5478321..d8a3941 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,10 @@ debbugs (2.4.2~exp2) UNRELEASED; urgency=low (prepend ampersand, append semicolon). * Be more generic, comment out rewrite rule that directly redirects http:/// to http://www.debian.org/Bugs. + * Fix pkgindex.cgi concerning several issues: load proper Perl modules, + replace usage of src_url and pkg_url by package_links, use + html_tail from templates, use count_bugs everywhere, load bugs.css, + fix global variable usage in html header. -- Don Armstrong Wed, 25 Aug 2010 01:57:38 -0700