r8932 - /scripts/qa/qareport.cgi
tincho-guest at users.alioth.debian.org
tincho-guest at users.alioth.debian.org
Wed Nov 7 03:19:53 UTC 2007
Author: tincho-guest
Date: Wed Nov 7 03:19:52 2007
New Revision: 8932
URL: http://svn.debian.org/wsvn/?sc=1&rev=8932
Log:
- Changed footer to enable correct xhtml validation
- Added code to show last-modified field (for caches)
- Display correct content-type to browsers that support it
Modified:
scripts/qa/qareport.cgi
Modified: scripts/qa/qareport.cgi
URL: http://svn.debian.org/wsvn/scripts/qa/qareport.cgi?rev=8932&op=diff
==============================================================================
--- scripts/qa/qareport.cgi (original)
+++ scripts/qa/qareport.cgi Wed Nov 7 03:19:52 2007
@@ -18,6 +18,7 @@
use DebianQA::DebVersions;
use DebianQA::Svn;
use CGI ();
+use POSIX qw(locale_h);
use Template ();
DebianQA::Config::read_config(
@@ -28,6 +29,8 @@
my $cgi = new CGI;
my $data = read_cache(consolidated => "");
+my @modified = sort(map({ find_stamp($data, $_) }
+ (qw(svn watch archive bts pkglist))));
my @pkglist = get_pkglist();
my( @for_upload, @for_upgrade, @waiting, @wip, @with_bugs );
@@ -84,9 +87,19 @@
# print " + Bugs: ", join(", ", @bugs), "\n" if(@bugs);
}
-print $cgi->header(
- -content_type => 'text/html; charset=utf-8',
-) if $ENV{GATEWAY_INTERFACE};
+if($ENV{GATEWAY_INTERFACE}) {
+ my $htmlp = $cgi->Accept("text/html");
+ my $xhtmlp = $cgi->Accept("application/xhtml+xml");
+ my $old_locale = setlocale(LC_TIME);
+ setlocale(LC_TIME, "C");
+ print $cgi->header(
+ -content_type => ($xhtmlp and $xhtmlp > $htmlp) ?
+ 'application/xhtml+xml; charset=utf-8' :
+ 'text/html; charset=utf-8',
+ -last_modified => POSIX::strftime("%a, %d %b %Y %T %Z",
+ gmtime($modified[-1])));
+ setlocale(LC_TIME, $old_locale);
+}
my $tt = new Template({INTERPOLATE=>1});
$tt->process(
@@ -189,7 +202,7 @@
</p>
[% META id='$Id$' %]
<p style="border-top: 1px solid black">
- <pre>$template.id</pre>
+ <code>$template.id</code>
</p>
</body>
</html>
More information about the Pkg-perl-cvs-commits
mailing list