use Debbugs::Common::open_compressed_file instead
[bugscan.git] / dohtml
1 #! /bin/sh
2
3 htmldir=/org/bugs.debian.org/www/bugscan
4
5 html_header() {
6         local   title="$1"      # Title of page
7         local   date="$2"       # Date
8
9         cat <<EOF
10 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
11 <html>
12   <head>
13     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
14     <link href="//www.debian.org/debhome.css" rel="stylesheet" type="text/css">
15
16     <title>$title, $date</title>
17   </head>
18 <body bgcolor="white">
19 <div id="header">
20   <div id="upperheader">
21     <div id="logo">
22       <a href="//www.debian.org/" title="Debian Home"><img src="//www.debian.org/Pics/openlogo-50.png" alt="Debian" width="50" height="61"></a>
23     </div>
24     <div id="searchbox">
25       <form name="p" method="get" action="http://search.debian.org/cgi-bin/omega">
26         <p>
27           <input type="hidden" name="DB" value="en">
28           <input name="P" value="" size="27">
29           <input type="submit" value="Search">
30         </p>
31       </form>
32     </div>
33   </div>
34   <div id="navbar">
35     <p class="hidecss"><a href="#content">Skip Quicknav</a></p>
36     <ul>
37        <li><a href="//www.debian.org/intro/about">About Debian</a></li>
38        <li><a href="//www.debian.org/distrib/">Getting Debian</a></li>
39        <li><a href="//www.debian.org/support">Support</a></li>
40        <li><a href="//www.debian.org/devel/">Developers' Corner</a></li>
41     </ul>
42   </div>
43   <p id="breadcrumbs">
44     <a href="//www.debian.org/Bugs/">Debian bug tracking system</a>
45     &#x2F;
46     Debian BTS &mdash; rc bugs status
47   </p>
48 </div>
49 <div id="content">
50   <h1>$title</h1>
51   
52   <h2>$date</h2>
53
54 EOF
55 }
56
57 html_end_of_content() {
58         cat <<EOF
59 </div><!-- end of 'div id="content"'-->
60 <hr>
61 This page is automatically generated.<br>
62 Please contact
63 <a href="mailto:owner@bugs.debian.org">owner@bugs.debian.org</a> for comments.
64 EOF
65 }
66
67 html_closing_tags() {
68         cat <<EOF
69 </body>
70 </html>
71 EOF
72 }
73
74 realmakepage() {
75         local   filter="$1"     # Distributions to list
76         local   title="$2"      # Title of page
77         local   date_time="$3"  # Date
78         local   worry="$4"      # Worry about testing only?
79         local   descr           # Description of filter
80
81         if [ -z "$filter" ]; then
82                 descr="all"
83         else
84                 descr="$filter"
85                 filter="-d $filter"
86         fi
87
88         filter="$filter $worry"
89
90         html_header "$title" "$date_time"
91
92         cat <<EOF
93
94 <p>for distribution(s): $descr</p>
95
96 <p>You might also want to check out <a href="//udd.debian.org/bugs/">UDD</a> instead of this page.</p>
97 <hr>
98
99 <p>
100 EOF
101         ./bugreport -H -s $filter
102         
103         cat <<EOF
104 </p>
105 Explanation for <a href="//www.debian.org/Bugs/Developer#tags">bug
106 tags</a>:
107
108 <ul>
109    <li><strong>P</strong>: pending</li>
110    <li><strong>+</strong>: patch</li>
111    <li><strong>H</strong>: help</li>
112    <li><strong>M</strong>: moreinfo</li>
113    <li><strong>R</strong>: unreproducible</li>
114    <li><strong>S</strong>: security</li>
115    <li><strong>U</strong>: upstream</li>
116    <li><strong>I</strong>: stretch-ignore or buster-ignore</li>
117 </ul>
118
119 <p>
120   The second set of tags indicate what releases a bug applies to:
121   O for oldstable (jessie), S for stable (stretch), T for testing (buster),
122   U for unstable (sid) or E for experimental.
123 </p>
124
125 EOF
126         ./bugreport -H -l $filter
127
128         html_end_of_content
129
130         html_closing_tags
131 }
132
133 makemainpage() {
134         local   title="$1"      # Title of page
135         local   date_time="$2"  # Date
136
137         html_header "$title" "$date_time"
138
139         cat <<EOF
140
141 <p>
142 EOF
143
144         ./bugreport -Hs
145
146         cat <<EOF
147 </p>
148
149 <div><img src="graph-release.png" alt="Graph of RC bugs"></div>
150
151 <p>Other graphs:
152   <ul>
153     <li><a href="graph-month.png">Graph for the last month</a></li>
154     <li><a href="graph.png">Graph with all the history</a></li>
155   </ul>
156 </p>
157
158 <p>
159   The <font color="#9400D3">dark-violet line</font> graphs all bugs with release-critical severities; 
160   the <font color="#009e73">dark green line</font> graphs the number of bugs that are actually a concern for the next
161   release (excluding ignored bugs, bugs on packages not in testing, and bugs
162   whose tags and/or versioning information indicate that they don't apply to
163   testing), and the <font color="#56b4e9">cyan line</font> graphs the number of bugs that are a concern
164   for the <em>current</em> stable release.
165 </p>
166
167 <h2>Recent changes</h2>
168 EOF
169
170         ./bugdiff -Hncs status-old status
171
172         cat <<EOF
173
174 <h2>Detailed lists of RC bug reports:</h2>
175
176 <ul>
177   <li> <a href="debian/all.html">All</a>
178   <li> <a href="debian/main.html">main</a>
179   <li> <a href="debian/source.html">source</a> 
180   <li> <a href="debian/contrib.html">contrib</a>
181   <li> <a href="debian/non-free.html">non-free</a>
182   <li> <a href="other/pseudo.html">pseudo-packages</a>
183        <a href="//www.debian.org/Bugs/pseudo-packages">(?)</a>
184   <li> <a href="other/all.html">Everything in one page</a>
185     <br>
186      + <a href="other/stable.html">Only bugs relevant to stable</a>
187     <br>
188      + <a href="other/testing.html">Only bugs relevant to testing</a>
189 </ul>
190 <p clear=both></p>
191 EOF
192
193         html_end_of_content
194
195         cat <<EOF
196 To receive all mails sent to release-critical bugs, subscribe to the
197 <a href="//lists.debian.org/debian-bugs-rc/">debian-bugs-rc</a>
198 mailing list.
199
200 EOF
201
202         html_closing_tags
203 }
204
205 makepage() {
206         if [ ! -d "`dirname $3`" ]; then mkdir -p "`dirname $3`"; fi
207         realmakepage "$1" "$2" "$4" "$5" > $3.new
208         mv -f $3.new $3
209 }
210
211 date_time=$(date -u -d '@'$(($(stat -c '%Y' status) / 3600 * 3600)))
212 olddate_time=$(date -u -d '@'$(($(stat -c '%Y' status-old) / 3600 * 3600)))
213 title="Release-critical bugs status"
214
215 makepage "debian"          "$title" "$htmldir/debian/all.html"      "$date_time"
216 makepage "debian/main"     "$title" "$htmldir/debian/main.html"     "$date_time"
217 makepage "debian/contrib"  "$title" "$htmldir/debian/contrib.html"  "$date_time"
218 makepage "debian/non-free" "$title" "$htmldir/debian/non-free.html" "$date_time"
219 makepage "debian/source"   "$title" "$htmldir/debian/source.html"   "$date_time"
220
221 makepage ""                "$title" "$htmldir/other/all.html"       "$date_time"
222 makepage ""                "$title" "$htmldir/other/stable.html"    "$date_time" "-b"
223 makepage ""                "$title" "$htmldir/other/testing.html"   "$date_time" "-t"
224 makepage ""                "$title" "$htmldir/other/pseudo.html"    "$date_time" "pseudo"
225
226 makemainpage  "$title"  "$date_time" > $htmldir/index.html.new
227 mv -f $htmldir/index.html.new $htmldir/index.html
228