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