]> git.donarmstrong.com Git - debbugs.git/commitdiff
Fix pkgindex.cgi concerning several issues: load proper Perl modules, replace usage...
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>
Wed, 12 Sep 2012 07:04:49 +0000 (09:04 +0200)
committerDon Armstrong <don@donarmstrong.com>
Fri, 28 Sep 2012 17:21:56 +0000 (10:21 -0700)
Signed-off-by: Don Armstrong <don@donarmstrong.com>
cgi/pkgindex.cgi
debian/changelog

index 8adbfb86c18714eba413c515d1dd387b2acad717..855e3fb8599e1fa89b084ef9934b5da86f0b9015 100755 (executable)
@@ -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('<a href="%s">%s</a> (%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('<a href="%s">%s</a> (%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 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
 print "<HTML><HEAD>\n" . 
-    "<TITLE>$debbugs::gProject$Archived $debbugs::gBug reports by $tag</TITLE>\n" .
+    "<TITLE>$gProject$Archived $gBug reports by $tag</TITLE>\n" .
+    qq(<LINK REL="stylesheet" HREF="$gWebHostBugDir/css/bugs.css" TYPE="text/css">) .
     "</HEAD>\n" .
     '<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#800080">' .
     "\n";
-print "<H1>" . "$debbugs::gProject$Archived $debbugs::gBug report logs by $tag" .
+print "<H1>" . "$gProject$Archived $gBug report logs by $tag" .
       "</H1>\n";
 
 print $note;
@@ -256,6 +256,8 @@ else {
 print $result;
 
 print "<hr>\n";
-print "<p>$tail_html";
-
+print fill_in_template(template=>'html/html_tail',
+                       hole_var => {'&strftime' => \&POSIX::strftime,
+                                   },
+                      );
 print "</body></html>\n";
index 54783218448e3ef178a5fb1b464f5def9dfd1132..d8a3941bcc83b0ccb6df19611622d32591adb998 100644 (file)
@@ -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://<debbugs-webhost>/ 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 <don@debian.org>  Wed, 25 Aug 2010 01:57:38 -0700