]> git.donarmstrong.com Git - bugscan.git/blobdiff - dohtml
consistently use 'date_time' for the same variable
[bugscan.git] / dohtml
diff --git a/dohtml b/dohtml
index d3a8bd17b45bd8ba49058b6035c57f11c4561359..95d786fabc3c9b95b7ee814da5a0319a51e3d2ea 100755 (executable)
--- a/dohtml
+++ b/dohtml
@@ -2,7 +2,7 @@
 
 htmldir=/org/bugs.debian.org/www/bugscan
 
-header() {
+html_header() {
        local   title="$1"      # Title of page
        local   date="$2"       # Date
 
@@ -21,10 +21,26 @@ header() {
 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
-       local   date="$3"       # Date
+       local   date_time="$3"  # Date
        local   worry="$4"      # Worry about testing only?
        local   descr           # Description of filter
 
@@ -37,7 +53,7 @@ realmakepage() {
 
        filter="$filter $worry"
 
-       header "$title" "$date"
+       html_header "$title" "$date_time"
 
        cat <<EOF
 
@@ -76,19 +92,16 @@ 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() {
+       local   title="$1"      # Title of page
+       local   date_time="$2"  # Date
 
-       header "$title" "$date"
+       header "$title" "$date_time"
 
        cat <<EOF
 
@@ -140,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() {
@@ -157,21 +173,21 @@ makepage() {
        mv -f $3.new $3
 }
 
-time=$(date -u -d '@'$(($(stat -c '%Y' status) / 3600 * 3600)))
-oldtime=$(date -u -d '@'$(($(stat -c '%Y' status-old) / 3600 * 3600)))
+date_time=$(date -u -d '@'$(($(stat -c '%Y' status) / 3600 * 3600)))
+olddate_time=$(date -u -d '@'$(($(stat -c '%Y' status-old) / 3600 * 3600)))
 title="Release-critical bugs status"
 
-makepage "debian" "$title" "$htmldir/debian/all.html" "$time"
-makepage "debian/main" "$title" $htmldir/debian/main.html "$time"
-makepage "debian/contrib" "$title" $htmldir/debian/contrib.html "$time"
-makepage "debian/non-free" "$title" $htmldir/debian/non-free.html "$time"
-makepage "debian/source" "$title" $htmldir/debian/source.html "$time"
+makepage "debian" "$title" "$htmldir/debian/all.html" "$date_time"
+makepage "debian/main" "$title" $htmldir/debian/main.html "$date_time"
+makepage "debian/contrib" "$title" $htmldir/debian/contrib.html "$date_time"
+makepage "debian/non-free" "$title" $htmldir/debian/non-free.html "$date_time"
+makepage "debian/source" "$title" $htmldir/debian/source.html "$date_time"
 
-makepage "" "$title" $htmldir/other/all.html "$time"
-makepage "" "$title" "$htmldir/other/stable.html" "$time" "-b"
-makepage "" "$title" "$htmldir/other/testing.html" "$time" "-t"
-makepage "" "$title" "$htmldir/other/pseudo.html" "$time" "pseudo"
+makepage "" "$title" $htmldir/other/all.html "$date_time"
+makepage "" "$title" "$htmldir/other/stable.html" "$date_time" "-b"
+makepage "" "$title" "$htmldir/other/testing.html" "$date_time" "-t"
+makepage "" "$title" "$htmldir/other/pseudo.html" "$date_time" "pseudo"
 
-makemainpage > $htmldir/index.html.new
+makemainpage "$title" "$date_time" > $htmldir/index.html.new
 mv -f $htmldir/index.html.new $htmldir/index.html