check the status of the wheezy-ignore tag, not squeeze-ignore for unstable
[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>
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>: wheezy-ignore or squeeze-ignore</li>
55 </ul>
56
57 <p>
58 The second set of tags indicate what releases a bug applies to:
59 O for oldstable (lenny), S for stable (squeeze), T for testing (wheezy),
60 U for unstable (sid) or E for experimental.
61
62 <p>
63
64 EOF
65         ./bugreport -H -l $filter
66
67         cat <<EOF
68 <hr>
69 This page is automatically generated.<br>
70 Please contact
71 <a href="mailto:owner@bugs.debian.org">owner@bugs.debian.org</a> for comments.
72 </body>
73 </html>
74 EOF
75 }
76
77 makemainpage() {
78         cat <<EOF
79 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
80 <html>
81   <head>
82     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
83     <title>$title, $time</title>
84   </head>
85 <body bgcolor="white">
86 <h1 align="center">$title</h1>
87
88 <h2 align="center">$time</h2>
89
90 <p align="center">
91 EOF
92
93         ./bugreport -Hs
94
95         cat <<EOF
96 </p>
97
98 <div align="center"><img src="graph.png" alt="Graph of RC bugs"></div>
99
100 <p>The red line graphs all bugs with release-critical severities; the green
101 line graphs the number of bugs that are actually a concern for the next
102 release (excluding ignored bugs, bugs on packages not in testing, and bugs
103 whose tags and/or versioning information indicate that they don't apply to
104 testing), and the blue line graphs the number of bugs that are a concern
105 for the <em>current</em> stable release.</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/stable.html">Only bugs relevant to stable</a>
127     <br>
128      + <a href="other/testing.html">Only bugs relevant to testing</a>
129 </ul>
130 <p clear=both>
131 <hr>
132 This page is automatically generated.<br>
133 Please contact
134 <a href="mailto:owner@bugs.debian.org">owner@bugs.debian.org</a> for comments.
135 To receive all mails sent to release-critical bugs, subscribe to the
136 <a href="http://lists.debian.org/debian-bugs-rc/">debian-bugs-rc</a>
137 mailing list.
138
139 EOF
140 }
141
142 makepage() {
143         if [ ! -d "`dirname $3`" ]; then mkdir -p "`dirname $3`"; fi
144         realmakepage "$1" "$2" "$4" "$5" > $3.new
145         mv -f $3.new $3
146 }
147
148 time=$(date -u -d '@'$(($(stat -c '%Y' status) / 3600 * 3600)))
149 oldtime=$(date -u -d '@'$(($(stat -c '%Y' status-old) / 3600 * 3600)))
150 title="Release-critical bugs status"
151
152 makepage "debian" "$title" "$htmldir/debian/all.html" "$time"
153 makepage "debian/main" "$title" $htmldir/debian/main.html "$time"
154 makepage "debian/contrib" "$title" $htmldir/debian/contrib.html "$time"
155 makepage "debian/non-free" "$title" $htmldir/debian/non-free.html "$time"
156 makepage "debian/source" "$title" $htmldir/debian/source.html "$time"
157
158 makepage "" "$title" $htmldir/other/all.html "$time"
159 makepage "" "$title" "$htmldir/other/stable.html" "$time" "-b"
160 makepage "" "$title" "$htmldir/other/testing.html" "$time" "-t"
161
162 makemainpage > $htmldir/index.html.new
163 mv -f $htmldir/index.html.new $htmldir/index.html
164