makemainpage should call html_header() not header()
[bugscan.git] / dohtml
1 #! /bin/sh
2
3 htmldir=/org/bugs.debian.org/www/bugscan
4
5 html_header() {
6         local   title="$1"      # Title of page
7         local   date="$2"       # Date
8
9         cat <<EOF
10 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
11 <html>
12   <head>
13     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
14     <title>$title, $date</title>
15   </head>
16 <body bgcolor="white">
17 <div id="header">
18   <div id="upperheader">
19     <div id="logo">
20       <a href="http://www.debian.org/" title="Debian Home"><img src="http://www.debian.org/Pics/openlogo-50.png" alt="Debian" width="50" height="61"></a>
21     </div>
22     <div id="searchbox">
23       <form name="p" method="get" action="http://search.debian.org/cgi-bin/omega">
24         <p>
25           <input type="hidden" name="DB" value="en">
26           <input name="P" value="" size="27">
27           <input type="submit" value="Search">
28         </p>
29       </form>
30     </div>
31   </div>
32   <div id="navbar">
33     <p class="hidecss"><a href="#content">Skip Quicknav</a></p>
34     <ul>
35        <li><a href="http://www.debian.org/intro/about">About Debian</a></li>
36        <li><a href="http://www.debian.org/distrib/">Getting Debian</a></li>
37        <li><a href="http://www.debian.org/support">Support</a></li>
38        <li><a href="http://www.debian.org/devel/">Developers' Corner</a></li>
39     </ul>
40   </div>
41   <p id="breadcrumbs">
42     <a href="http://www.debian.org/Bugs/">Debian bug tracking system</a>
43     &#x2F;
44     Debian BTS &mdash; rc bugs status
45   </p>
46 </div>
47 <div id="content">
48   <h1>$title</h1>
49   
50   <h2>$date</h2>
51
52 EOF
53 }
54
55 html_end_of_content() {
56         cat <<EOF
57 </div><!-- end of 'div id="content"'-->
58 <hr>
59 This page is automatically generated.<br>
60 Please contact
61 <a href="mailto:owner@bugs.debian.org">owner@bugs.debian.org</a> for comments.
62 EOF
63 }
64
65 html_closing_tags() {
66         cat <<EOF
67 </body>
68 </html>
69 EOF
70 }
71
72 realmakepage() {
73         local   filter="$1"     # Distributions to list
74         local   title="$2"      # Title of page
75         local   date_time="$3"  # Date
76         local   worry="$4"      # Worry about testing only?
77         local   descr           # Description of filter
78
79         if [ -z "$filter" ]; then
80                 descr="all"
81         else
82                 descr="$filter"
83                 filter="-d $filter"
84         fi
85
86         filter="$filter $worry"
87
88         html_header "$title" "$date_time"
89
90         cat <<EOF
91
92 <p>for distribution(s): $descr</p>
93
94 <p>You might also want to check out <a href="http://udd.debian.org/bugs/">UDD</a> instead of this page.</p>
95 <hr>
96
97 <p>
98 EOF
99         ./bugreport -H -s $filter
100         
101         cat <<EOF
102 </p>
103 Explanation for <a href="http://www.debian.org/Bugs/Developer#tags">bug
104 tags</a>:
105
106 <ul>
107    <li><strong>P</strong>: pending</li>
108    <li><strong>+</strong>: patch</li>
109    <li><strong>H</strong>: help</li>
110    <li><strong>M</strong>: moreinfo</li>
111    <li><strong>R</strong>: unreproducible</li>
112    <li><strong>S</strong>: security</li>
113    <li><strong>U</strong>: upstream</li>
114    <li><strong>I</strong>: wheezy-ignore or jessie-ignore</li>
115 </ul>
116
117 <p>
118   The second set of tags indicate what releases a bug applies to:
119   O for oldstable (squeeze), S for stable (wheezy), T for testing (jessie),
120   U for unstable (sid) or E for experimental.
121 </p>
122
123 EOF
124         ./bugreport -H -l $filter
125
126         html_end_of_content
127
128         html_closing_tags
129 }
130
131 makemainpage() {
132         local   title="$1"      # Title of page
133         local   date_time="$2"  # Date
134
135         html_header "$title" "$date_time"
136
137         cat <<EOF
138
139 <p>
140 EOF
141
142         ./bugreport -Hs
143
144         cat <<EOF
145 </p>
146
147 <div><img src="graph-release.png" alt="Graph of RC bugs"></div>
148
149 <p>Other graphs:
150   <ul>
151     <li><a href="graph-month.png">Graph for the last month</a></li>
152     <li><a href="graph.png">Graph with all the history</a></li>
153   </ul>
154 </p>
155
156 <p>
157   The red line graphs all bugs with release-critical severities; the green
158   line graphs the number of bugs that are actually a concern for the next
159   release (excluding ignored bugs, bugs on packages not in testing, and bugs
160   whose tags and/or versioning information indicate that they don't apply to
161   testing), and the blue line graphs the number of bugs that are a concern
162   for the <em>current</em> stable release.
163 </p>
164
165 <h2>Recent changes</h2>
166 EOF
167
168         ./bugdiff -Hncs status-old status
169
170         cat <<EOF
171
172 <h2>Detailed lists of RC bug reports:</h2>
173
174 <ul>
175   <li> <a href="debian/all.html">All</a>
176   <li> <a href="debian/main.html">main</a>
177   <li> <a href="debian/source.html">source</a> 
178   <li> <a href="debian/contrib.html">contrib</a>
179   <li> <a href="debian/non-free.html">non-free</a>
180   <li> <a href="other/pseudo.html">pseudo-packages</a>
181        <a href="http://www.debian.org/Bugs/pseudo-packages">(?)</a>
182   <li> <a href="other/all.html">Everything in one page</a>
183     <br>
184      + <a href="other/stable.html">Only bugs relevant to stable</a>
185     <br>
186      + <a href="other/testing.html">Only bugs relevant to testing</a>
187 </ul>
188 <p clear=both></p>
189 EOF
190
191         html_end_of_content
192
193         cat <<EOF
194 To receive all mails sent to release-critical bugs, subscribe to the
195 <a href="http://lists.debian.org/debian-bugs-rc/">debian-bugs-rc</a>
196 mailing list.
197
198 EOF
199
200         html_closing_tags
201 }
202
203 makepage() {
204         if [ ! -d "`dirname $3`" ]; then mkdir -p "`dirname $3`"; fi
205         realmakepage "$1" "$2" "$4" "$5" > $3.new
206         mv -f $3.new $3
207 }
208
209 date_time=$(date -u -d '@'$(($(stat -c '%Y' status) / 3600 * 3600)))
210 olddate_time=$(date -u -d '@'$(($(stat -c '%Y' status-old) / 3600 * 3600)))
211 title="Release-critical bugs status"
212
213 makepage "debian"          "$title" "$htmldir/debian/all.html"      "$date_time"
214 makepage "debian/main"     "$title" "$htmldir/debian/main.html"     "$date_time"
215 makepage "debian/contrib"  "$title" "$htmldir/debian/contrib.html"  "$date_time"
216 makepage "debian/non-free" "$title" "$htmldir/debian/non-free.html" "$date_time"
217 makepage "debian/source"   "$title" "$htmldir/debian/source.html"   "$date_time"
218
219 makepage ""                "$title" "$htmldir/other/all.html"       "$date_time"
220 makepage ""                "$title" "$htmldir/other/stable.html"    "$date_time" "-b"
221 makepage ""                "$title" "$htmldir/other/testing.html"   "$date_time" "-t"
222 makepage ""                "$title" "$htmldir/other/pseudo.html"    "$date_time" "pseudo"
223
224 makemainpage  "$title"  "$date_time" > $htmldir/index.html.new
225 mv -f $htmldir/index.html.new $htmldir/index.html
226