]> git.donarmstrong.com Git - bugscan.git/blobdiff - dohtml
name parameters to make code easier to understand
[bugscan.git] / dohtml
diff --git a/dohtml b/dohtml
index 73c0567106d8b4284c22182c55a3d88578bef322..cbef6c091443b518a7bee465a0ccab2c9dc6f07f 100755 (executable)
--- a/dohtml
+++ b/dohtml
@@ -2,6 +2,41 @@
 
 htmldir=/org/bugs.debian.org/www/bugscan
 
+html_header() {
+       local   title="$1"      # Title of page
+       local   date="$2"       # Date
+
+       cat <<EOF
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>$title, $date</title>
+  </head>
+<body bgcolor="white">
+<h1 align="center">$title</h1>
+
+<h2 align="center">$date</h2>
+
+EOF
+}
+
+html_page_creation_notice() {
+       cat <<EOF
+<hr>
+This page is automatically generated.<br>
+Please contact
+<a href="mailto:owner@bugs.debian.org">owner@bugs.debian.org</a> for comments.
+EOF
+}
+
+html_closing_tags() {
+       cat <<EOF
+</body>
+</html>
+EOF
+}
+
 realmakepage() {
        local   filter="$1"     # Distributions to list
        local   title="$2"      # Title of page
@@ -18,20 +53,13 @@ realmakepage() {
 
        filter="$filter $worry"
 
-       cat <<EOF
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>$title, $date</title>
-  </head>
-<body bgcolor="white">
-<h1 align="center">$title</h1>
+       html_header "$title" "$date"
 
-<h2 align="center">$date</h2>
+       cat <<EOF
 
 <p align="center">for distribution(s): $descr</p>
 
+<p align="center">You might also want to check out <a href="http://udd.debian.org/bugs/">UDD</a> instead of this page.</p>
 <hr>
 
 <p>
@@ -64,28 +92,18 @@ U for unstable (sid) or E for experimental.
 EOF
        ./bugreport -H -l $filter
 
-       cat <<EOF
-<hr>
-This page is automatically generated.<br>
-Please contact
-<a href="mailto:owner@bugs.debian.org">owner@bugs.debian.org</a> for comments.
-</body>
-</html>
-EOF
+       html_page_creation_notice
+
+       html_closing_tags
 }
 
 makemainpage() {
-       cat <<EOF
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>$title, $time</title>
-  </head>
-<body bgcolor="white">
-<h1 align="center">$title</h1>
+       local   title="$1"      # Title of page
+       local   time="$2"       # Date
+
+       header "$title" "$time"
 
-<h2 align="center">$time</h2>
+       cat <<EOF
 
 <p align="center">
 EOF
@@ -135,15 +153,18 @@ EOF
      + <a href="other/testing.html">Only bugs relevant to testing</a>
 </ul>
 <p clear=both>
-<hr>
-This page is automatically generated.<br>
-Please contact
-<a href="mailto:owner@bugs.debian.org">owner@bugs.debian.org</a> for comments.
+EOF
+
+       html_page_creation_notice
+
+       cat <<EOF
 To receive all mails sent to release-critical bugs, subscribe to the
 <a href="http://lists.debian.org/debian-bugs-rc/">debian-bugs-rc</a>
 mailing list.
 
 EOF
+
+       html_closing_tags
 }
 
 makepage() {
@@ -167,6 +188,6 @@ makepage "" "$title" "$htmldir/other/stable.html" "$time" "-b"
 makepage "" "$title" "$htmldir/other/testing.html" "$time" "-t"
 makepage "" "$title" "$htmldir/other/pseudo.html" "$time" "pseudo"
 
-makemainpage > $htmldir/index.html.new
+makemainpage "$title" "$time" > $htmldir/index.html.new
 mv -f $htmldir/index.html.new $htmldir/index.html