]> git.donarmstrong.com Git - bugscan.git/blob - dohtml
afc81fe7687752c61b8bd4e76bee0252ed06fc18
[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     <title>$title, $date</title>
15   </head>
16 <body bgcolor="white">
17 <h1 align="center">$title</h1>
18
19 <h2 align="center">$date</h2>
20
21 EOF
22 }
23
24 html_page_creation_notice() {
25         cat <<EOF
26 <hr>
27 This page is automatically generated.<br>
28 Please contact
29 <a href="mailto:owner@bugs.debian.org">owner@bugs.debian.org</a> for comments.
30 EOF
31 }
32
33 html_closing_tags() {
34         cat <<EOF
35 </body>
36 </html>
37 EOF
38 }
39
40 realmakepage() {
41         local   filter="$1"     # Distributions to list
42         local   title="$2"      # Title of page
43         local   date_time="$3"  # Date
44         local   worry="$4"      # Worry about testing only?
45         local   descr           # Description of filter
46
47         if [ -z "$filter" ]; then
48                 descr="all"
49         else
50                 descr="$filter"
51                 filter="-d $filter"
52         fi
53
54         filter="$filter $worry"
55
56         html_header "$title" "$date_time"
57
58         cat <<EOF
59
60 <p align="center">for distribution(s): $descr</p>
61
62 <p align="center">You might also want to check out <a href="http://udd.debian.org/bugs/">UDD</a> instead of this page.</p>
63 <hr>
64
65 <p>
66 EOF
67         ./bugreport -H -s $filter
68         
69         cat <<EOF
70 <p>
71 Explanation for <a href="http://www.debian.org/Bugs/Developer#tags">bug
72 tags</a>:
73
74 <ul>
75    <li><strong>P</strong>: pending</li>
76    <li><strong>+</strong>: patch</li>
77    <li><strong>H</strong>: help</li>
78    <li><strong>M</strong>: moreinfo</li>
79    <li><strong>R</strong>: unreproducible</li>
80    <li><strong>S</strong>: security</li>
81    <li><strong>U</strong>: upstream</li>
82    <li><strong>I</strong>: wheezy-ignore or jessie-ignore</li>
83 </ul>
84
85 <p>
86 The second set of tags indicate what releases a bug applies to:
87 O for oldstable (squeeze), S for stable (wheezy), T for testing (jessie),
88 U for unstable (sid) or E for experimental.
89
90 <p>
91
92 EOF
93         ./bugreport -H -l $filter
94
95         html_page_creation_notice
96
97         html_closing_tags
98 }
99
100 makemainpage() {
101         local   title="$1"      # Title of page
102         local   date_time="$2"  # Date
103
104         header "$title" "$date_time"
105
106         cat <<EOF
107
108 <p align="center">
109 EOF
110
111         ./bugreport -Hs
112
113         cat <<EOF
114 </p>
115
116 <div align="center"><img src="graph-release.png" alt="Graph of RC bugs"></div>
117
118 <p>Other graphs:
119   <ul>
120     <li><a href="graph-month.png">Graph for the last month</a></li>
121     <li><a href="graph.png">Graph with all the history</a></li>
122   </ul>
123 </p>
124
125 <p>The red line graphs all bugs with release-critical severities; the green
126 line graphs the number of bugs that are actually a concern for the next
127 release (excluding ignored bugs, bugs on packages not in testing, and bugs
128 whose tags and/or versioning information indicate that they don't apply to
129 testing), and the blue line graphs the number of bugs that are a concern
130 for the <em>current</em> stable release.</p>
131
132 <h2>Recent changes</h2>
133 EOF
134
135         ./bugdiff -Hncs status-old status
136
137         cat <<EOF
138
139 <h2>Detailed lists of RC bug reports:</h2>
140
141 <ul>
142   <li> <a href="debian/all.html">All</a>
143   <li> <a href="debian/main.html">main</a>
144   <li> <a href="debian/source.html">source</a> 
145   <li> <a href="debian/contrib.html">contrib</a>
146   <li> <a href="debian/non-free.html">non-free</a>
147   <li><a href="other/pseudo.html">pseudo-packages</a>
148        <a href="http://www.debian.org/Bugs/pseudo-packages">(?)</a>
149   <li><a href="other/all.html">Everything in one page</a>
150     <br>
151      + <a href="other/stable.html">Only bugs relevant to stable</a>
152     <br>
153      + <a href="other/testing.html">Only bugs relevant to testing</a>
154 </ul>
155 <p clear=both>
156 EOF
157
158         html_page_creation_notice
159
160         cat <<EOF
161 To receive all mails sent to release-critical bugs, subscribe to the
162 <a href="http://lists.debian.org/debian-bugs-rc/">debian-bugs-rc</a>
163 mailing list.
164
165 EOF
166
167         html_closing_tags
168 }
169
170 makepage() {
171         if [ ! -d "`dirname $3`" ]; then mkdir -p "`dirname $3`"; fi
172         realmakepage "$1" "$2" "$4" "$5" > $3.new
173         mv -f $3.new $3
174 }
175
176 date_time=$(date -u -d '@'$(($(stat -c '%Y' status) / 3600 * 3600)))
177 olddate_time=$(date -u -d '@'$(($(stat -c '%Y' status-old) / 3600 * 3600)))
178 title="Release-critical bugs status"
179
180 makepage "debian"          "$title" "$htmldir/debian/all.html"      "$date_time"
181 makepage "debian/main"     "$title" "$htmldir/debian/main.html"     "$date_time"
182 makepage "debian/contrib"  "$title" "$htmldir/debian/contrib.html"  "$date_time"
183 makepage "debian/non-free" "$title" "$htmldir/debian/non-free.html" "$date_time"
184 makepage "debian/source"   "$title" "$htmldir/debian/source.html"   "$date_time"
185
186 makepage ""                "$title" "$htmldir/other/all.html"       "$date_time"
187 makepage ""                "$title" "$htmldir/other/stable.html"    "$date_time" "-b"
188 makepage ""                "$title" "$htmldir/other/testing.html"   "$date_time" "-t"
189 makepage ""                "$title" "$htmldir/other/pseudo.html"    "$date_time" "pseudo"
190
191 makemainpage  "$title"  "$date_time" > $htmldir/index.html.new
192 mv -f $htmldir/index.html.new $htmldir/index.html
193