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