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