Make dohtml output a separate page for only testing-related bugs.
[bugscan.git] / dohtml
1 #! /bin/sh
2
3 htmldir=/org/bugs.debian.org/www/bugscan
4
5 realmakepage() {
6         local   filter="$1"     # Distributions to list
7         local   title="$2"      # Title of page
8         local   date="$3"       # Date
9         local   worry="$4"      # Worry about testing only?
10         local   descr           # Description of filter
11
12         if [ -z "$filter" ]; then
13                 descr="all"
14         else
15                 descr="$filter"
16                 filter="-d $filter"
17         fi
18
19         filter="$filter $worry"
20
21         cat <<EOF
22 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
23 <html>
24   <head>
25     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
26     <title>$title, $date</title>
27   </head>
28 <body bgcolor="white">
29 <h1 align="center">$title</h1>
30
31 <h2 align="center">$date</h2>
32
33 <p align="center">for distribution(s): $descr</p>
34
35 <hr>
36
37 <p>Check out Steinar H. Gunderson's beta <a href="http://people.debian.org/~sesse/bugscan/">version-tracking aware release critical bug page</a>.
38
39 <hr>
40
41 <p>
42 EOF
43         ./bugreport -H -s $filter
44         
45         cat <<EOF
46 <p>
47 Explanation for comment tags:
48 <ul>
49    <li><strong>[FIX]</strong>: describes a simple method to deal with
50        the bug.
51    <li><strong>[STRATEGY]</strong>: describes a possible approach for
52        fixing the bug.
53    <li><strong>[HELP]</strong>: help is needed to fix this bug.
54    <li><strong>[REMOVE]</strong>: package will be removed if bug is not fixed
55 </ul>
56
57 <p>
58 Explanation for <a href="http://www.debian.org/Bugs/Developer#tags">bug
59 tags</a>:
60
61 <ul>
62    <li><strong>P</strong>: pending</li>
63    <li><strong>+</strong>: patch</li>
64    <li><strong>H</strong>: help</li>
65    <li><strong>M</strong>: moreinfo</li>
66    <li><strong>R</strong>: unreproducible</li>
67    <li><strong>S</strong>: security</li>
68    <li><strong>U</strong>: upstream</li>
69    <li><strong>I</strong>: etch-ignore</li>
70 </ul>
71
72 <p>
73 Some bugs have an additional set of tags indicating they only apply
74 to a particular release: O for oldstable (woody), S for stable (sarge),
75 T for testing (etch), U for unstable (sid) or E for experimental. X
76 indicates that the package is not in testing.
77
78 <p>
79
80 EOF
81         ./bugreport -H -l $filter
82
83         cat <<EOF
84 <hr>
85 This page is automatically generated.<br>
86 Please contact
87 <a href="mailto:owner@bugs.debian.org">owner@bugs.debian.org</a> for comments.
88 </body>
89 </html>
90 EOF
91 }
92
93 makemainpage() {
94         cat <<EOF
95 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
96 <html>
97   <head>
98     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
99     <title>$title, $time</title>
100   </head>
101 <body bgcolor="white">
102 <h1 align="center">$title</h1>
103
104 <h2 align="center">$time</h2>
105
106 <p align="center">
107 EOF
108
109         ./bugreport -Hs
110
111         cat <<EOF
112 </p>
113
114 <div align="center"><img src="graph.png" alt="Graph of RC bugs"></div>
115
116 <p>The red line graphs all bugs with release-critical severities; the green
117 line graphs the number of bugs that are actually a concern for the next
118 release (excluding ignored bugs, bugs on packages not in testing, and bugs
119 whose tags indicate that they don't apply to testing).</p>
120
121 <h2>Recent changes</h2>
122 EOF
123
124         ./bugdiff -Hncs status-old status
125
126         cat <<EOF
127
128 <h2>Detailed lists of RC bug reports:</h2>
129
130 <ul>
131   <li> <a href="debian/all.html">All</a>
132     <br>
133      + <a href="debian/testing.html">Only bugs relevant to testing</a>
134     <br>
135      + <a href="debian-non-US/all.html">All non-US</a>
136   <li> <a href="debian/main.html">main</a>
137     <br>
138      + <a href="debian-non-US/main.html">main non-US</a>
139   <li> <a href="debian/source.html">source</a> 
140     <br>
141      + <a href="debian-non-US/source.html">source non-US</a> 
142   <li> <a href="debian/contrib.html">contrib</a>
143     <br>
144      + <a href="debian-non-US/contrib.html">contrib non-US</a>
145   <li> <a href="debian/non-free.html">non-free</a>
146     <br>
147      + <a href="debian-non-US/non-free.html">non-free non-US</a>
148   <li><a href="other/pseudo.html">pseudo-packages</a>
149        <a href="http://www.debian.org/Bugs/pseudo-packages">(?)</a>
150   <li><a href="other/all.html">Everything in one page</a>
151 </ul>
152 <p clear=both>
153 <hr>
154 This page is automatically generated.<br>
155 Please contact
156 <a href="mailto:owner@bugs.debian.org">owner@bugs.debian.org</a> for comments.
157 To receive all mails sent to release-critical bugs, subscribe to the
158 <a href="http://lists.debian.org/debian-bugs-rc/">debian-bugs-rc</a>
159 mailing list.
160
161 EOF
162 }
163
164 makepage() {
165         if [ ! -d "`dirname $3`" ]; then mkdir -p "`dirname $3`"; fi
166         realmakepage "$1" "$2" "$4" "$5" > $3.new
167         mv -f $3.new $3
168 }
169
170 time=$(date -u --date="$(ls -Ll status | awk '{print $6, $7}'):00 $(date +%z)")
171 oldtime=$(date -u --date="$(ls -Ll status-old | awk '{print $6, $7}'):00 $(date +%z)")
172 title="Release-critical bugs status"
173
174 makepage "debian" "$title" "$htmldir/debian/all.html" "$time"
175 makepage "debian/main" "$title" $htmldir/debian/main.html "$time"
176 makepage "debian/contrib" "$title" $htmldir/debian/contrib.html "$time"
177 makepage "debian/non-free" "$title" $htmldir/debian/non-free.html "$time"
178 makepage "debian/source" "$title" $htmldir/debian/source.html "$time"
179
180 makepage "debian" "$title" "$htmldir/debian/testing.html" "$time" "-t"
181
182 makepage "non-US" "$title" "$htmldir/debian-non-US/all.html" "$time"
183 makepage "non-US/main" "$title" $htmldir/debian-non-US/main.html "$time"
184 makepage "non-US/contrib" "$title" $htmldir/debian-non-US/contrib.html "$time"
185 makepage "non-US/non-free" "$title" $htmldir/debian-non-US/non-free.html "$time"
186 makepage "non-US/source" "$title" $htmldir/debian-non-US/source.html "$time"
187
188 makepage "other/pseudo" "$title" $htmldir/other/pseudo.html "$time"
189
190 makepage "" "$title" $htmldir/other/all.html "$time"
191
192 makemainpage > $htmldir/index.html.new
193 mv -f $htmldir/index.html.new $htmldir/index.html
194