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