[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

lintian: r1370 - in trunk: debian reporting reporting/templates



Author: djpig
Date: 2008-06-10 02:09:48 +0200 (Tue, 10 Jun 2008)
New Revision: 1370

Added:
   trunk/reporting/templates/foot.tmpl
   trunk/reporting/templates/head.tmpl
Modified:
   trunk/debian/changelog
   trunk/reporting/html_reports
   trunk/reporting/templates/clean.tmpl
   trunk/reporting/templates/index.tmpl
   trunk/reporting/templates/maintainer.tmpl
   trunk/reporting/templates/maintainers.tmpl
   trunk/reporting/templates/packages.tmpl
   trunk/reporting/templates/tag.tmpl
   trunk/reporting/templates/tags.tmpl
Log:
* reporting/{head,foot}.tmpl:
  + New templates meant for inclusion by other templates
   for common header and footer parts
* reporting/html_reports:
  + Allow inclusion of the new shared templates by
    convenient functions. Remove some duplicated data
    setting while I'm on it.
* reporting/*.tmpl:
  + Replace common headers/footers with calls to the
    new head()/foot() functions.


Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2008-06-09 21:40:23 UTC (rev 1369)
+++ trunk/debian/changelog	2008-06-10 00:09:48 UTC (rev 1370)
@@ -3,6 +3,19 @@
   * unpack/unpack-binpkg-l1:
     + [FL] Don't include version number from Source: field in
       the source symlink.  Noted by RA.  (Closes: #485474)
+  
+  * reporting/checkout-release:
+    + [FL] New helper script for lintian.d.o maintainance.
+  * reporting/{head,foot}.tmpl:
+    + [FL] New templates meant for inclusion by other templates
+      for common header and footer parts
+  * reporting/html_reports:
+    + [FL] Allow inclusion of the new shared templates by
+      convenient functions. Remove some duplicated data
+      setting while I'm on it.
+  * reporting/*.tmpl:
+    + [FL] Replace common headers/footers with calls to the
+      new head()/foot() functions.
 
  --
 

Modified: trunk/reporting/html_reports
===================================================================
--- trunk/reporting/html_reports	2008-06-09 21:40:23 UTC (rev 1369)
+++ trunk/reporting/html_reports	2008-06-10 00:09:48 UTC (rev 1370)
@@ -79,7 +79,7 @@
 # This only has to be done once, so do it at the start and then reuse the same
 # templates throughout.
 our %templates;
-for my $template (qw/clean index maintainer maintainers packages tag tags/) {
+for my $template (qw/head foot clean index maintainer maintainers packages tag tags/) {
     my %options = (TYPE => 'FILE', SOURCE => "$TEMPLATES/$template.tmpl");
     $templates{$template} = Text::Template->new (%options)
         or die "cannot load template $template: $Text::Template::ERROR\n";
@@ -340,8 +340,6 @@
         name       => html_quote ($name),
         packages   => $by_maint{$maintainer},
         uploads    => $by_uploader{$maintainer},
-        timestamp  => $timestamp,
-        version    => $LINTIAN_VERSION
     );
     my $template;
     if ($error_clean) {
@@ -361,8 +359,6 @@
 # Write out the maintainer index.
 my %data = (
     maintainers => \%maintainers,
-    timestamp   => $timestamp,
-    version     => $LINTIAN_VERSION
 );
 output_template ('maintainers.html', $templates{maintainers}, \%data);
 
@@ -383,8 +379,6 @@
         email      => html_quote (uri_escape ($email)),
         maintainer => html_quote ($maintainer),
         name       => html_quote ($name),
-        timestamp  => $timestamp,
-        version    => $LINTIAN_VERSION
     );
     print "Generating clean page for $id\n";
     output_template ("maintainer/$id", $templates{clean}, \%data);
@@ -405,8 +399,6 @@
         tag         => html_quote ($tag),
         code        => $by_tag{$tag}[0]->{code},
         tags        => $by_tag{$tag},
-        timestamp   => $timestamp,
-        version     => $LINTIAN_VERSION
     );
     output_template ("tags/$tag.html", $templates{tag}, \%data);
 }
@@ -414,8 +406,6 @@
 # Create the general tag index.
 %data = (
     tags      => \%by_tag,
-    timestamp => $timestamp,
-    version   => $LINTIAN_VERSION
 );
 output_template ('tags.html', $templates{tags}, \%data);
 
@@ -437,8 +427,6 @@
 }
 %data = (
     packages  => \%packages,
-    timestamp => $timestamp,
-    version   => $LINTIAN_VERSION
 );
 my $i = 1;
 for my $section (sort keys %list) {
@@ -483,8 +471,6 @@
     mirror       => $mirror_timestamp,
     previous     => $old_statistics->{'last-updated'},
     section      => $LINTIAN_SECTION,
-    timestamp    => $timestamp,
-    version      => $LINTIAN_VERSION
 );
 output_template ('index.html', $templates{index}, \%data);
 exit 0;
@@ -546,6 +532,12 @@
 # that data hash and output the results to the file.
 sub output_template {
     my ($file, $template, $data) = @_;
+    $data->{version} ||= $LINTIAN_VERSION;
+    $data->{timestamp} ||= $timestamp;
+    $data->{head} ||= sub { $templates{head}->fill_in (HASH => { page_title => $_[0],
+                                                                 path_prefix => '../' x ($_[1]||0),
+                                                                 %$data }) };
+    $data->{foot} ||= sub { $templates{foot}->fill_in (HASH => $data) };
     open (OUTPUT, '>', "$HTML_TMP_DIR/$file")
         or die "creating $HTML_TMP_DIR/$file falied: $!\n";
     $template->fill_in (OUTPUT => \*OUTPUT, HASH => $data)

Modified: trunk/reporting/templates/clean.tmpl
===================================================================
--- trunk/reporting/templates/clean.tmpl	2008-06-09 21:40:23 UTC (rev 1369)
+++ trunk/reporting/templates/clean.tmpl	2008-06-10 00:09:48 UTC (rev 1370)
@@ -1,29 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html
-    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
-
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-<head>
-  <title>Lintian Report for {$name}</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-  <link rel="stylesheet" href="../lintian.css" type="text/css" />
-  <link rel="icon" href="../ico.png" type="image/png" />
-</head>
-
-<body>
-
-<div id="header">
-  <p><a href="../index.html">Lintian Reports</a></p>
-  <ul id="nav">
-    <li><a href="../maintainers.html">Maintainers</a></li>
-    <li><a href="../tags.html">Tags</a></li>
-    <li><a href="../packages_1.html">Packages</a></li>
-  </ul>
-  <div class="clear"></div>
-</div>
-
-<div id="main">
+{ head("Lintian Report for $name", 1) }
   <h1>{$name}</h1>
 
   <p>
@@ -37,17 +12,4 @@
     <a href="http://qa.debian.org/developer.php?login={$email}";>QA
     overview</a>.
   </p>
-</div> <!-- main -->
-
-<hr/>
-
-<div id="footer">
-  <p>
-    Please send all comments about these web pages to the
-    <a href="mailto:lintian-maint@debian.org";>Lintian maintainers</a>.
-  </p>
-  <p>Page last updated: {$timestamp} using Lintian {$version}.</p>
-</div>
-
-</body>
-</html>
+{ foot() }

Added: trunk/reporting/templates/foot.tmpl
===================================================================
--- trunk/reporting/templates/foot.tmpl	                        (rev 0)
+++ trunk/reporting/templates/foot.tmpl	2008-06-10 00:09:48 UTC (rev 1370)
@@ -0,0 +1,14 @@
+</div> <!-- main -->
+
+<hr/>
+
+<div id="footer">
+  <p>
+    Please send all comments about these web pages to the
+    <a href="mailto:lintian-maint@debian.org";>Lintian maintainers</a>.
+  </p>
+  <p>Page last updated: {$timestamp} using Lintian {$version}.</p>
+</div>
+
+</body>
+</html>

Added: trunk/reporting/templates/head.tmpl
===================================================================
--- trunk/reporting/templates/head.tmpl	                        (rev 0)
+++ trunk/reporting/templates/head.tmpl	2008-06-10 00:09:48 UTC (rev 1370)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html
+    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
+
+<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
+<head>
+  <title>{$page_title}</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <link rel="stylesheet" href="{$path_prefix}lintian.css" type="text/css" />
+  <link rel="icon" href="{$path_prefix}ico.png" type="image/png" />
+</head>
+
+<body>
+
+<div id="header">
+  <p><a href="{$path_prefix}index.html">Lintian Reports</a></p>
+  <ul id="nav">
+    <li><a href="{$path_prefix}maintainers.html">Maintainers</a></li>
+    <li><a href="{$path_prefix}tags.html">Tags</a></li>
+    <li><a href="{$path_prefix}packages_1.html">Packages</a></li>
+  </ul>
+  <div class="clear"></div>
+</div>
+
+<div id="main">

Modified: trunk/reporting/templates/index.tmpl
===================================================================
--- trunk/reporting/templates/index.tmpl	2008-06-09 21:40:23 UTC (rev 1369)
+++ trunk/reporting/templates/index.tmpl	2008-06-10 00:09:48 UTC (rev 1370)
@@ -1,29 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html
-    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
-
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-<head>
-  <title>Lintian</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-  <link rel="stylesheet" href="lintian.css" type="text/css" />
-  <link rel="icon" href="ico.png" type="image/png" />
-</head>
-
-<body>
-
-<div id="header">
-  <p><a href="index.html">Lintian Reports</a></p>
-  <ul id="nav">
-    <li><a href="maintainers.html">Maintainers</a></li>
-    <li><a href="tags.html">Tags</a></li>
-    <li><a href="packages_1.html">Packages</a></li>
-  </ul>
-  <div class="clear"></div>
-</div>
-
-<div id="main">
+{ head("Lintian") }
   <div id="front">
     <div id="info">
       <p>
@@ -104,17 +79,4 @@
       report, published on {$previous}).
     </p>
   </div> <!-- stats -->
-</div> <!-- main -->
-
-<hr/>
-
-<div id="footer">
-  <p>
-    Please send all comments about these web pages to the
-    <a href="mailto:lintian-maint@debian.org";>Lintian maintainers</a>.
-  </p>
-  <p>Page last updated: {$timestamp} using Lintian {$version}.</p>
-</div>
-
-</body>
-</html>
+{ foot() }

Modified: trunk/reporting/templates/maintainer.tmpl
===================================================================
--- trunk/reporting/templates/maintainer.tmpl	2008-06-09 21:40:23 UTC (rev 1369)
+++ trunk/reporting/templates/maintainer.tmpl	2008-06-10 00:09:48 UTC (rev 1370)
@@ -1,29 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html
-    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
-
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-<head>
-  <title>Lintian Report for {$name}</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-  <link rel="stylesheet" href="../lintian.css" type="text/css" />
-  <link rel="icon" href="../ico.png" type="image/png" />
-</head>
-
-<body>
-
-<div id="header">
-  <p><a href="../index.html">Lintian Reports</a></p>
-  <ul id="nav">
-    <li><a href="../maintainers.html">Maintainers</a></li>
-    <li><a href="../tags.html">Tags</a></li>
-    <li><a href="../packages_1.html">Packages</a></li>
-  </ul>
-  <div class="clear"></div>
-</div>
-
-<div id="main">
+{ head("Lintian Report for $name", 1) }
   <h1>{$name}</h1>
 
   <p>
@@ -119,17 +94,5 @@
             $OUT .= "</ul>\n    </li>\n  </ul>\n";
         }
     }
-}</div> <!-- main -->
-
-<hr/>
-
-<div id="footer">
-  <p>
-    Please send all comments about these web pages to the
-    <a href="mailto:lintian-maint@debian.org";>Lintian maintainers</a>.
-  </p>
-  <p>Page last updated: {$timestamp} using Lintian {$version}.</p>
-</div>
-
-</body>
-</html>
+}
+{ foot() }

Modified: trunk/reporting/templates/maintainers.tmpl
===================================================================
--- trunk/reporting/templates/maintainers.tmpl	2008-06-09 21:40:23 UTC (rev 1369)
+++ trunk/reporting/templates/maintainers.tmpl	2008-06-10 00:09:48 UTC (rev 1370)
@@ -1,29 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html
-    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
-
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-<head>
-  <title>Lintian Reports by Maintainer</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-  <link rel="stylesheet" href="lintian.css" type="text/css" />
-  <link rel="icon" href="ico.png" type="image/png" />
-</head>
-
-<body>
-
-<div id="header">
-  <p><a href="index.html">Lintian Reports</a></p>
-  <ul id="nav">
-    <li><a href="maintainers.html">Maintainers</a></li>
-    <li><a href="tags.html">Tags</a></li>
-    <li><a href="packages_1.html">Packages</a></li>
-  </ul>
-  <div class="clear"></div>
-</div>
-
-<div id="main">
+{ head("Lintian Reports by Maintainer") }
   <h1>Maintainers</h1>
 
   <p>
@@ -66,17 +41,4 @@
             . qq{ (<a href="full/$url">full report</a>)<br />\n};
     }
 }  </p>
-</div> <!-- main -->
-
-<hr/>
-
-<div id="footer">
-  <p>
-    Please send all comments about these web pages to the
-    <a href="mailto:lintian-maint@debian.org";>Lintian maintainers</a>.
-  </p>
-  <p>Page last updated: {$timestamp} using Lintian {$version}.</p>
-</div>
-
-</body>
-</html>
+{ foot() }

Modified: trunk/reporting/templates/packages.tmpl
===================================================================
--- trunk/reporting/templates/packages.tmpl	2008-06-09 21:40:23 UTC (rev 1369)
+++ trunk/reporting/templates/packages.tmpl	2008-06-10 00:09:48 UTC (rev 1370)
@@ -1,29 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html
-    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
-
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-<head>
-  <title>Lintian Package Index: {$section}</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-  <link rel="stylesheet" href="lintian.css" type="text/css" />
-  <link rel="icon" href="ico.png" type="image/png" />
-</head>
-
-<body>
-
-<div id="header">
-  <p><a href="index.html">Lintian Reports</a></p>
-  <ul id="nav">
-    <li><a href="maintainers.html">Maintainers</a></li>
-    <li><a href="tags.html">Tags</a></li>
-    <li><a href="packages_1.html">Packages</a></li>
-  </ul>
-  <div class="clear"></div>
-</div>
-
-<div id="main">
+{ head("Lintian Package Index: $section") }
   <h1>Package Index: {$section}</h1>
 
   <p>
@@ -54,17 +29,4 @@
         $OUT .= qq(    <a href="full/$packages{$package}">$package</a>\n);
     }
 }  </p>
-</div> <!-- main -->
-
-<hr/>
-
-<div id="footer">
-  <p>
-    Please send all comments about these web pages to the
-    <a href="mailto:lintian-maint@debian.org";>Lintian maintainers</a>.
-  </p>
-  <p>Page last updated: {$timestamp} using Lintian {$version}.</p>
-</div>
-
-</body>
-</html>
+{ foot() }

Modified: trunk/reporting/templates/tag.tmpl
===================================================================
--- trunk/reporting/templates/tag.tmpl	2008-06-09 21:40:23 UTC (rev 1369)
+++ trunk/reporting/templates/tag.tmpl	2008-06-10 00:09:48 UTC (rev 1370)
@@ -1,29 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html
-    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
-
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-<head>
-  <title>Lintian Tag: {$tag}</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-  <link rel="stylesheet" href="../lintian.css" type="text/css" />
-  <link rel="icon" href="../ico.png" type="image/png" />
-</head>
-
-<body>
-
-<div id="header">
-  <p><a href="../index.html">Lintian Reports</a></p>
-  <ul id="nav">
-    <li><a href="../maintainers.html">Maintainers</a></li>
-    <li><a href="../tags.html">Tags</a></li>
-    <li><a href="../packages_1.html">Packages</a></li>
-  </ul>
-  <div class="clear"></div>
-</div>
-
-<div id="main">
+{ head("Lintian Tag: $tag", 1) }
   <h1><span class="type-{$code}">{$code}</span> {$tag}</h1>
 
   <p>
@@ -58,17 +33,5 @@
         $OUT .= "<li>$info->{extra}</li>\n" if $info->{extra};
     }
     $OUT .= "  </ul>\n";
-}</div> <!-- main -->
-
-<hr/>
-
-<div id="footer">
-  <p>
-    Please send all comments about these web pages to the
-    <a href="mailto:lintian-maint@debian.org";>Lintian maintainers</a>.
-  </p>
-  <p>Page last updated: {$timestamp} using Lintian {$version}.</p>
-</div>
-
-</body>
-</html>
+}
+{ foot() }

Modified: trunk/reporting/templates/tags.tmpl
===================================================================
--- trunk/reporting/templates/tags.tmpl	2008-06-09 21:40:23 UTC (rev 1369)
+++ trunk/reporting/templates/tags.tmpl	2008-06-10 00:09:48 UTC (rev 1370)
@@ -1,29 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html
-    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
-
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-<head>
-  <title>Lintian Tags</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-  <link rel="stylesheet" href="lintian.css" type="text/css" />
-  <link rel="icon" href="ico.png" type="image/png" />
-</head>
-
-<body>
-
-<div id="header">
-  <p><a href="index.html">Lintian Reports</a></p>
-  <ul id="nav">
-    <li><a href="maintainers.html">Maintainers</a></li>
-    <li><a href="tags.html">Tags</a></li>
-    <li><a href="packages_1.html">Packages</a></li>
-  </ul>
-  <div class="clear"></div>
-</div>
-
-<div id="main">
+{ head("Lintian Tags") }
   <h1>Tags</h1>
 
   <p>
@@ -51,17 +26,4 @@
             . "</li>\n";
     }
 }  </ul>
-</div> <!-- main -->
-
-<hr/>
-
-<div id="footer">
-  <p>
-    Please send all comments about these web pages to the
-    <a href="mailto:lintian-maint@debian.org";>Lintian maintainers</a>.
-  </p>
-  <p>Page last updated: {$timestamp} using Lintian {$version}.</p>
-</div>
-
-</body>
-</html>
+{ foot() }


Reply to: