/[collab-qa]/udd/web/bugs.cgi
ViewVC logotype

Contents of /udd/web/bugs.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1945 - (hide annotations) (download)
Sun May 15 08:29:17 2011 UTC (2 years ago) by lucas
File size: 18977 byte(s)
ubuntu natty -> oneiric
1 lucas 1786 #!/usr/bin/ruby -w
2    
3     require 'dbi'
4     require 'pp'
5     require 'cgi'
6 lucas 1942 require 'time'
7 lucas 1786
8     puts "Content-type: text/html\n\n"
9    
10     RELEASE_RESTRICT = [
11 lucas 1905 ['wheezy', 'wheezy', 'id in (select id from bugs_rt_affects_testing)'],
12 lucas 1786 ['sid', 'sid', 'id in (select id from bugs_rt_affects_unstable)'],
13 lucas 1905 ['wheezy_and_sid', 'wheezy and sid', 'id in (select id from bugs_rt_affects_testing) and id in (select id from bugs_rt_affects_unstable)'],
14     ['wheezy_or_sid', 'wheezy or sid', 'id in (select id from bugs_rt_affects_testing union select id from bugs_rt_affects_unstable)'],
15     ['wheezy_not_sid', 'wheezy, not sid', 'id in (select id from bugs_rt_affects_testing) and id not in (select id from bugs_rt_affects_unstable)'],
16     ['sid_not_wheezy', 'sid, not wheezy', 'id in (select id from bugs_rt_affects_unstable) and id not in (select id from bugs_rt_affects_testing)'],
17     ['squeeze', 'squeeze', 'id in (select id from bugs_rt_affects_stable)'],
18 lucas 1907 ['lenny', 'lenny', 'id in (select id from bugs_rt_affects_oldstable)'],
19 lucas 1820 ['any', 'any', 'id in (select id from bugs where status!=\'done\')'],
20 lucas 1786 ]
21    
22     FILTERS = [
23 lucas 1787 ['patch', 'tagged patch', 'id in (select id from bugs_tags where tag=\'patch\')'],
24     ['pending', 'tagged pending', 'id in (select id from bugs_tags where tag=\'pending\')'],
25     ['security', 'tagged security', 'id in (select id from bugs_tags where tag=\'security\')'],
26 lucas 1841 ['wontfix', 'tagged wontfix', 'id in (select id from bugs_tags where tag=\'wontfix\')'],
27     ['upstream', 'tagged upstream', 'id in (select id from bugs_tags where tag=\'upstream\')'],
28 lucas 1846 ['unreproducible', 'tagged unreproducible', 'id in (select id from bugs_tags where tag=\'unreproducible\')'],
29 lucas 1841 ['forwarded', 'forwarded upstream', 'forwarded != \'\''],
30 lucas 1832 ['claimed', 'claimed bugs', "id in (select id from bugs_usertags where email='bugsquash@qa.debian.org')"],
31 lucas 1836 ['deferred', 'fixed in deferred/delayed', "id in (select id from deferred_closes)"],
32 lucas 1787 ['notmain', 'packages not in main', 'id not in (select id from bugs_packages, sources where bugs_packages.source = sources.source and component=\'main\')'],
33 lucas 1905 ['notwheezy', 'packages not in wheezy', 'id not in (select id from bugs_packages, sources where bugs_packages.source = sources.source and release=\'wheezy\')'],
34 lucas 1827 ['base', 'packages in base system', 'bugs.source in (select source from sources where priority=\'required\' or priority=\'important\')'],
35     ['standard', 'packages in standard installation', 'bugs.source in (select source from sources where priority=\'standard\')'],
36 lucas 1858 ['orphaned', 'orphaned packages', 'bugs.source in (select source from orphaned_packages where type in (\'ITA\', \'O\'))'],
37 lucas 1787 ['merged', 'merged bugs', 'id in (select id from bugs_merged_with where id > merged_with)'],
38     ['done', 'marked as done', 'status = \'done\''],
39 lucas 1905 ['outdatedwheezy', 'outdated binaries in wheezy', "bugs.source in (select distinct p1.source from packages_summary p1, packages_summary p2 where p1.source = p2.source and p1.release='wheezy' and p2.release='wheezy' and p1.source_version != p2.source_version)"],
40 lucas 1815 ['outdatedsid', 'outdated binaries in sid', "bugs.source in (select distinct p1.source from packages_summary p1, packages_summary p2 where p1.source = p2.source and p1.release='sid' and p2.release='sid' and p1.source_version != p2.source_version)"],
41 lucas 1905 ['needmig', 'different versions in wheezy and sid', "bugs.source in (select s1.source from sources s1, sources s2 where s1.source = s2.source and s1.release = 'wheezy' and s2.release='sid' and s1.version != s2.version)"],
42 lucas 1945 ['newerubuntu', 'newer in Ubuntu than in sid', "bugs.source in (select s1.source from sources_uniq s1, ubuntu_sources s2 where s1.source = s2.source and s1.release = 'sid' and s2.release='oneiric' and s1.version < s2.version)"],
43 lucas 1905 ['rtwheezy-will-remove', 'RT tag for wheezy: will-remove', "id in (select id from bugs_usertags where email='release.debian.org@packages.debian.org' and tag='wheezy-will-remove')"],
44     ['rtwheezy-can-defer', 'RT tag for wheezy: can-defer', "id in (select id from bugs_usertags where email='release.debian.org@packages.debian.org' and tag='wheezy-can-defer')"],
45     ['rtwheezy-is-blocker', 'RT tag for wheezy: is-blocker', "id in (select id from bugs_usertags where email='release.debian.org@packages.debian.org' and tag='wheezy-is-blocker')"],
46 lucas 1786 ]
47    
48 lucas 1787 TYPES = [
49     ['rc', 'release-critical bugs', 'severity >= \'serious\'', true ],
50     ['ipv6', 'release goal: IPv6 support', 'id in (select id from bugs_tags where tag=\'ipv6\')', false ],
51     ['lfs', 'release goal: Large File Support', 'id in (select id from bugs_tags where tag=\'lfs\')', false ],
52     ['boot', 'release goal: boot performance (init.d dependencies)', 'id in (select id from bugs_usertags where email = \'initscripts-ng-devel@lists.alioth.debian.org\')', false],
53     ['oldgnome', 'release goal: remove obsolete GNOME libraries', 'id in (select id from bugs_usertags where email = \'pkg-gnome-maintainers@lists.alioth.debian.org\' and tag=\'oldlibs\')', false],
54 lucas 1820 ['ruby', 'Ruby bugs', "bugs.source in (select source from sources where maintainer ~ 'ruby' or uploaders ~ 'ruby')\nOR bugs.package in (select source from packages where (package ~ 'ruby' or depends ~ 'ruby') and source != 'subversion')\nOR title ~ 'ruby'"],
55 lucas 1909 ['php', 'PHP bugs', "bugs.source in (select source from packages_summary where package in (select package from debtags where tag = 'implemented-in::php'))"],
56 lucas 1827 ['l10n', 'Localisation bugs', 'id in (select id from bugs_tags where tag=\'l10n\')', false],
57 lucas 1841 ['xsf', 'X Strike Force bugs', "bugs.source in (select source from sources where maintainer ~ 'debian-x@lists.debian.org')\n"],
58 lucas 1827 ['allbugs', 'All bugs', 'true', false],
59 lucas 1787 ]
60 lucas 1786
61     SORTS = [
62     ['id', 'bug#'],
63     ['source', 'source package'],
64     ['package', 'binary package'],
65 lucas 1794 ['last_modified', 'last modified'],
66 lucas 1816 ['severity', 'severity'],
67 lucas 1794 ['popcon', 'popularity contest'],
68 lucas 1786 ]
69    
70 lucas 1814 COLUMNS = [
71 lucas 1902 ['cpopcon', 'popularity&nbsp;contest'],
72     ['chints', 'release&nbsp;team&nbsp;hints'],
73 lucas 1816 ['cseverity', 'severity'],
74 lucas 1831 ['ctags', 'tags'],
75 lucas 1902 ['cclaimed', 'claimed&nbsp;by'],
76 lucas 1835 ['cdeferred', 'deferred/delayed'],
77 lucas 1902 ['caffected', 'affected&nbsp;releases'],
78 lucas 1905 ['crttags', 'release&nbsp;team&nbsp;tags&nbsp;for&nbsp;wheezy'],
79 lucas 1814 ]
80    
81 lucas 1786 cgi = CGI::new
82     # releases
83     if RELEASE_RESTRICT.map { |r| r[0] }.include?(cgi.params['release'][0])
84     release = cgi.params['release'][0]
85     else
86 lucas 1905 release = 'wheezy'
87 lucas 1786 end
88 lucas 1814 # columns
89     cols = {}
90     COLUMNS.map { |r| r[0] }.each do |r|
91     if cgi.params[r][0]
92     cols[r] = true
93     else
94     cols[r] = false
95     end
96     end
97 lucas 1786 # sorts
98     if SORTS.map { |r| r[0] }.include?(cgi.params['sortby'][0])
99     sortby = cgi.params['sortby'][0]
100     else
101     sortby = 'id'
102     end
103     if ['asc', 'desc'].include?(cgi.params['sorto'][0])
104     sorto = cgi.params['sorto'][0]
105     else
106     sorto = 'asc'
107     end
108 lucas 1814 # hack to enable popcon column if sortby = popcon
109 lucas 1816 cols['cpopcon'] = true if sortby == 'popcon'
110     cols['cseverity'] = true if sortby == 'severity'
111 lucas 1786 # filters
112     filters = {}
113     FILTERS.map { |r| r[0] }.each do |e|
114 lucas 1789 if ['', 'only', 'ign'].include?(cgi.params[e][0])
115 lucas 1786 filters[e] = cgi.params[e][0]
116     else
117 lucas 1789 filters[e] = (e == 'merged' ? 'ign' : '')
118 lucas 1786 end
119     end
120 lucas 1787 # filter: newer than X days
121 lucas 1789 if ['', 'only', 'ign'].include?(cgi.params['fnewer'][0])
122 lucas 1787 fnewer = cgi.params['fnewer'][0]
123     else
124 lucas 1789 fnewer = ''
125 lucas 1787 end
126     if cgi.params['fnewerval'][0] =~ /^[0-9]+$/
127     fnewerval = cgi.params['fnewerval'][0].to_i
128     else
129     fnewerval = 7
130     end
131     # types
132     types = {}
133     TYPES.each do |t|
134     if cgi.params == {}
135     types[t[0]] = t[3]
136     else
137     if cgi.params[t[0]][0] == '1'
138     types[t[0]] = true
139     else
140     types[t[0]] = false
141     end
142     end
143     end
144 lucas 1786
145     puts <<-EOF
146     <html>
147     <head>
148     <style type="text/css">
149 lucas 1789
150     body {
151     font-family : "DejaVu Sans", "Bitstream Vera Sans", sans-serif;"
152     }
153    
154 lucas 1787 table.buglist td, table.buglist th {
155 lucas 1786 border: 1px solid gray;
156     padding-left: 3px;
157     padding-right: 3px;
158     }
159 lucas 1787 table.buglist tr:hover {
160 lucas 1786 background-color: #ccc;
161 lucas 1851 color: #000;
162 lucas 1786 }
163 lucas 1912 table.buglist tr:hover :link {
164     color: #00f;
165     }
166     table.buglist tr:hover :visited {
167     color: #707;
168     }
169 lucas 1786 table {
170     border-collapse: collapse;
171     }
172 lucas 1787
173 lucas 1789 div#body {
174     border-top: 2px solid #d70751;
175     }
176    
177     div.footer {
178     padding: 0.3em 0;
179     background-color: #fff;
180 lucas 1851 color: #000;
181 lucas 1789 text-align: center;
182     border-top: 2px solid #d70751;
183     margin: 0 0 0 0;
184     border-bottom: 0;
185     font-size: 85%;
186     }
187 lucas 1912 div.footer :link {
188     color: #00f;
189     }
190     div.footer :visited {
191     color: #707;
192     }
193 lucas 1786 </style>
194 lucas 1789 <title>Debian Bugs Search @ UDD</title>
195 lucas 1831 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
196 lucas 1859 <script type="text/javascript">
197     function removeBlankFields(form) {
198     var inputs = form.getElementsByTagName("input");
199     var removeList = new Array();
200     for (var i=0; i<inputs.length; i++) {
201     if (inputs[i].value == "") {
202     removeList.push(inputs[i]);
203     }
204     }
205     for (x in removeList) {
206     removeList[x].parentNode.removeChild(removeList[x]);
207     }
208     }
209     </script>
210 lucas 1786 </head>
211     <body>
212 lucas 1789 <h1 style="margin-bottom : 5px"><img src="http://qa.debian.org/debian.png" alt="Debian logo" width="188" height="52" style="vertical-align : -13px; ">Bugs Search <span style="color :#c70036">@</span> UDD</h1>
213     <div id="body">
214 lucas 1786
215 lucas 1859 <form action="bugs.cgi" method="get" onsubmit="removeBlankFields(this);">
216 lucas 1786 <p><b>Bugs affecting:</b>
217     EOF
218    
219     RELEASE_RESTRICT.each do |r|
220     checked = (release == r[0] ? 'CHECKED=\'1\'':'')
221 lucas 1913 puts "<label><input type='radio' name='release' value='#{r[0]}' #{checked}/>#{r[1]}</label>&nbsp;&nbsp;"
222 lucas 1786 end
223     puts <<-EOF
224 lucas 1905 <br/>(This already uses release tags ('sid', 'wheezy') and xxx-ignore ('wheezy-ignore') to include/exclude bugs)</p>
225 lucas 1787 <table class="invisible"><tr><td>
226     <table class="buglist">
227 lucas 1786 <tr><th colspan='4'>FILTERS</th></tr>
228     <tr><th>not considered</th><th>only</th><th>ignore</th><th>type</th></tr>
229     EOF
230     FILTERS.each do |r|
231     puts <<-EOF
232     <tr>
233 lucas 1789 <td style='text-align: center;'><input type='radio' name='#{r[0]}' value='' #{filters[r[0]]==''?'CHECKED=\'1\'':''}/></td>
234 lucas 1786 <td style='text-align: center;'><input type='radio' name='#{r[0]}' value='only' #{filters[r[0]]=='only'?'CHECKED=\'1\'':''}/></td>
235 lucas 1806 <td style='text-align: center;'><input type='radio' name='#{r[0]}' value='ign' #{filters[r[0]]=='ign'?'CHECKED=\'1\'':''}/></td>
236 lucas 1786 <td>#{r[1]}</td>
237     </tr>
238     EOF
239     end
240 lucas 1787 # newer than
241     puts <<-EOF
242     <tr>
243 lucas 1789 <td style='text-align: center;'><input type='radio' name='fnewer' value='' #{fnewer==''?'CHECKED=\'1\'':''}/></td>
244 lucas 1787 <td style='text-align: center;'><input type='radio' name='fnewer' value='only' #{fnewer=='only'?'CHECKED=\'1\'':''}/></td>
245 lucas 1806 <td style='text-align: center;'><input type='radio' name='fnewer' value='ign' #{fnewer=='ign'?'CHECKED=\'1\'':''}/></td>
246 lucas 1787 <td>newer than <input type='text' size='3' name='fnewerval' value='#{fnewerval}'/> days</td>
247     </tr>
248     EOF
249     puts "</table></td><td style='padding-left: 20px'><table class='buglist'>"
250     puts "<tr><th colspan='2'>Bug types</th></tr>"
251     TYPES.each do |t|
252     checked = types[t[0]]?" checked='1'":""
253 lucas 1913 puts "<tr><td><input type='checkbox' id='#{t[0]}' name='#{t[0]}' value='1'#{checked}/></td><td><label for='#{t[0]}'>#{t[1]}</label></td></tr>"
254 lucas 1787 end
255     puts "</table></td></tr></table>"
256 lucas 1786 puts "<p><b>Sort by:</b> "
257     SORTS.each do |r|
258     checked = (sortby == r[0] ? 'CHECKED=\'1\'':'')
259 lucas 1913 puts "<label><input type='radio' name='sortby' value='#{r[0]}' #{checked}/>#{r[1]}</label>&nbsp;&nbsp;"
260 lucas 1786 end
261     puts "<b> -- </b>"
262     [['asc', 'increasing'],[ 'desc', 'decreasing']].each do |r|
263     checked = (sorto == r[0] ? 'CHECKED=\'1\'':'')
264 lucas 1913 puts "<label><input type='radio' name='sorto' value='#{r[0]}' #{checked}/>#{r[1]}</label>&nbsp;&nbsp;"
265 lucas 1786 end
266 lucas 1831 puts "<br/>\n<b>Additional information:</b> "
267 lucas 1814 COLUMNS.each do |r|
268     checked = cols[r[0]] ? 'checked':''
269 lucas 1913 puts "<label><input type='checkbox' name='#{r[0]}' value='1' #{checked}/>#{r[1]}</label>&nbsp;&nbsp;"
270 lucas 1814 end
271 lucas 1786 puts <<-EOF
272 lucas 1814 <br/>\n<input type='submit' value='Search'/></p>
273 lucas 1786 </form>
274     EOF
275     if cgi.params != {}
276    
277 lucas 1787 # Generate and execute query
278 lucas 1786 tstart = Time::now
279     dbh = DBI::connect('DBI:Pg:dbname=udd;port=5441;host=localhost', 'guest')
280 lucas 1902 dbh.execute("SET statement_timeout TO 90000")
281 lucas 1814 if cols['cpopcon']
282 lucas 1852 q = "select id, bugs.package, bugs.source, severity, title, last_modified, affects_stable, affects_testing, affects_unstable, affects_experimental, coalesce(popcon_src.insts, 0) as popcon\nfrom bugs left join popcon_src on (bugs.source = popcon_src.source) \n"
283 lucas 1814 else
284 lucas 1852 q = "select id, bugs.package, bugs.source, severity, title, last_modified, affects_stable, affects_testing, affects_unstable, affects_experimental from bugs \n"
285 lucas 1794 end
286 lucas 1786 q += "where #{RELEASE_RESTRICT.select { |r| r[0] == release }[0][2]} \n"
287     FILTERS.each do |f|
288     if filters[f[0]] == 'only'
289     q += "and #{f[2]} \n"
290     elsif filters[f[0]] == 'ign'
291     q += "and not (#{f[2]}) \n"
292     end
293     end
294 lucas 1787 if fnewer == 'only'
295     q += "and (current_timestamp - interval '#{fnewerval} days' <= arrival) \n"
296     elsif fnewer == 'ign'
297     q += "and (current_timestamp - interval '#{fnewerval} days' > arrival) \n"
298     end
299 lucas 1789 q2 = TYPES.select { |t| types[t[0]] }.map { |t| t[2] }.join("\n OR ")
300     if q2 != ""
301     q += "AND (#{q2})\n"
302     else
303     puts "<p><b>Must select at least one bug type!</b></p>"
304     q += "AND FALSE\n"
305     end
306 lucas 1786 q += "order by #{sortby} #{sorto}"
307 lucas 1868
308 lucas 1902 load = IO::read('/proc/loadavg').split[1].to_f
309     if load > 20
310 lucas 1868 puts "<p><b>Current system load (#{load}) is too high. Please retry later!</b></p>"
311 lucas 1902 puts "<pre>#{q}</pre>"
312 lucas 1868 exit(0)
313     end
314    
315 lucas 1820 begin
316     sth = dbh.prepare(q)
317     sth.execute
318     rows = sth.fetch_all
319     rescue DBI::ProgrammingError => e
320     puts "<p>The query generated an error, please report it to lucas@debian.org: #{e.message}</p>"
321     puts "<pre>#{q}</pre>"
322     exit(0)
323     end
324 lucas 1786
325 lucas 1814 if cols['chints']
326     sthh = dbh.prepare("select distinct source, type, argument, version, file, comment from relevant_hints order by type")
327     sthh.execute
328     rowsh = sthh.fetch_all
329     hints = {}
330     rowsh.each do |r|
331     hints[r['source']] ||= []
332     hints[r['source']] << r
333     end
334     end
335    
336 lucas 1831 if cols['ctags']
337     ids = rows.map { |r| r['id'] }.join(',')
338     stht = dbh.prepare("select id, tag from bugs_tags where id in (#{ids})")
339     stht.execute
340     rowst = stht.fetch_all
341     tags = {}
342     rowst.each do |r|
343     tags[r['id']] ||= []
344     tags[r['id']] << r['tag']
345     end
346     end
347    
348 lucas 1832 if cols['cclaimed']
349     ids = rows.map { |r| r['id'] }.join(',')
350 lucas 1847 stht = dbh.prepare("select distinct id, tag from bugs_usertags where email='bugsquash@qa.debian.org' and id in (#{ids})")
351 lucas 1832 stht.execute
352     rowst = stht.fetch_all
353     claimedbugs = {}
354     rowst.each do |r|
355     claimedbugs[r['id']] ||= []
356     claimedbugs[r['id']] << r['tag']
357     end
358     end
359    
360 lucas 1902 if cols['crttags']
361     ids = rows.map { |r| r['id'] }.join(',')
362     stht = dbh.prepare("select distinct id, tag from bugs_usertags where email='release.debian.org@packages.debian.org' and id in (#{ids})")
363     stht.execute
364     rowst = stht.fetch_all
365     rttags = {}
366     rowst.each do |r|
367     rttags[r['id']] ||= []
368     rttags[r['id']] << r['tag']
369     end
370     end
371    
372    
373 lucas 1835 if cols['cdeferred']
374     ids = rows.map { |r| r['id'] }.join(',')
375 lucas 1847 sthd = dbh.prepare("select id, deferred.source, deferred.version, extract (day from delay_remaining) as du from deferred, deferred_closes where deferred.source = deferred_closes.source and deferred.version = deferred_closes.version and deferred_closes.id in (#{ids})")
376 lucas 1835 sthd.execute
377     rowsd = sthd.fetch_all
378     deferredbugs = {}
379     rowsd.each do |r|
380     d = r['du'].to_i
381 lucas 1838 deferredbugs[r['id']] = "#{r['version']} (#{d}&nbsp;day#{d==1?'':'s'})"
382 lucas 1835 end
383     end
384    
385 lucas 1786 puts "<p><b>#{rows.length} bugs found.</b></p>"
386 lucas 1794 puts '<table class="buglist">'
387 lucas 1814 puts '<tr><th>bug#</th><th>package</th><th>title</th>'
388 lucas 1816 puts '<th>popcon</th>' if cols['cpopcon']
389     puts '<th>severity</th>' if cols['cseverity']
390 lucas 1832 puts '<th>hints</th>' if cols['chints']
391     puts '<th>claimed by</th>' if cols['cclaimed']
392 lucas 1835 puts '<th>deferred</th>' if cols['cdeferred']
393 lucas 1902 puts '<th>RT tag</th>' if cols['crttags']
394 lucas 1814 puts '<th>last&nbsp;modified</th></tr>'
395 lucas 1794
396 lucas 1814 def genhints(source, hints)
397     return '' if hints.nil?
398     s = ''
399     hints.each do |h|
400     v = h['version'] ? h['version'] + ' ' : ''
401     t = h['type'] == 'age-days' ? "age/#{h['argument']}" : h['type']
402     s += "<a href=\"http://release.debian.org/britney/hints/#{h['file']}\" title=\"#{v}#{h['file']} #{h['comment']}\">#{t}</a> "
403     end
404     s
405     end
406    
407 lucas 1831 # copied from /org/bugs.debian.org/etc/config
408     $TagsSingleLetter = {
409     'patch' => '+',
410     'wontfix' => '☹',
411     'moreinfo' => 'M',
412     'unreproducible' => 'R',
413     'security' => 'S',
414     'pending' => 'P',
415     'fixed' => 'F',
416     'help' => 'H',
417     'fixed-upstream' => 'U',
418     'upstream' => 'u',
419     # Added tags
420     'confirmed' => 'C',
421     'etch-ignore' => 'etc-i',
422     'lenny-ignore' => 'len-i',
423     'sarge-ignore' => 'sar-i',
424     'squeeze-ignore' => 'squ-i',
425 lucas 1905 'wheezy-ignore' => 'whe-i',
426 lucas 1831 'woody' => 'wod',
427     'sarge' => 'sar',
428     'etch' => 'etc',
429     'lenny' => 'len',
430     'squeeze' => 'squ',
431 lucas 1905 'wheezy' => 'whe',
432 lucas 1831 'sid' => 'sid',
433     'experimental' => 'exp',
434     'l10n' => 'l10n',
435     'd-i' => 'd-i',
436     'ipv6' => 'ipv6',
437     'lfs' => 'lfs',
438     'fixed-in-experimental' => 'fie',
439     }
440    
441     def gentags(tags)
442     return '' if tags.nil?
443     tags.sort!
444     texttags = tags.map do |tag|
445     puts "unknowntag: #{tag}" if $TagsSingleLetter[tag].nil?
446     "<abbr title='#{tag}'>#{$TagsSingleLetter[tag]}</abbr>"
447     end
448     return '&nbsp;[' + texttags.join('|') + ']'
449     end
450    
451 lucas 1852 def genaffected(r)
452     s = ""
453     s += "<abbr title='affects stable'>S</abbr>" if r['affects_stable']
454     s += "<abbr title='affects testing'>T</abbr>" if r['affects_testing']
455     s += "<abbr title='affects unstable'>U</abbr>" if r['affects_unstable']
456     s += "<abbr title='affects unstable'>E</abbr>" if r['affects_experimental']
457     return "" if s == ""
458     return "&nbsp;("+s+")"
459     end
460    
461 lucas 1786 rows.each do |r|
462 lucas 1831 print "<tr><td style='text-align: left;'><a href=\"http://bugs.debian.org/#{r['id']}\">##{r['id']}</a>"
463     puts "#{gentags(tags[r['id']])}" if cols['ctags']
464 lucas 1852 puts "#{genaffected(r)}" if cols['caffected']
465 lucas 1831 puts "</td>"
466 lucas 1787 puts "<td style='text-align: center;'>"
467 lucas 1788 srcs = r['source'].split(/,\s*/)
468     bins = r['package'].split(/,\s*/)
469     puts (0...bins.length).map { |i| "<a href=\"http://packages.qa.debian.org/#{srcs[i]}\">#{bins[i]}</a>" }.join(', ')
470 lucas 1787 puts "</td>"
471 lucas 1794 puts "<td>#{CGI::escapeHTML(r['title'])}</td>"
472 lucas 1816 puts "<td>#{r['popcon']}</td>" if cols['cpopcon']
473     puts "<td>#{r['severity']}</td>" if cols['cseverity']
474     puts "<td>#{genhints(r['source'], hints[r['source']])}</td>" if cols['chints']
475 lucas 1832 puts "<td>#{claimedbugs[r['id']]}</td>" if cols['cclaimed']
476 lucas 1835 puts "<td>#{deferredbugs[r['id']]}</td>" if cols['cdeferred']
477 lucas 1902 puts "<td>#{rttags[r['id']]}</td>" if cols['crttags']
478 lucas 1922 d = r['last_modified']
479     d = Date::new(d.year, d.month, d.day)
480     puts "<td style='text-align: center;'>#{d}</td></tr>"
481 lucas 1786 end
482    
483     puts "</table>"
484     sth2 = dbh.prepare("select max(start_time) from timestamps where source = 'bugs' and command = 'run'")
485     sth2.execute ; r2 = sth2.fetch_all
486 lucas 1789 puts "<p><b>Generated in #{Time::now - tstart} seconds. Last data update: #{r2[0][0]}"
487 lucas 1942 puts " (%.1f hours ago)</b></p>" % ((Time::now - Time::parse(r2[0][0].to_s)) / 3600)
488 lucas 1786 puts "<pre>#{q}</pre>"
489     end # if cgi.params != {}
490     puts <<-EOF
491 lucas 1789 </div>
492     <div class="footer">
493 lucas 1820 <small>Suggestions / comments / patches to lucas@debian.org. <a href="http://svn.debian.org/wsvn/collab-qa/udd/web/bugs.cgi">source code</a>.</small>
494 lucas 1789 </div>
495 lucas 1786 </body>
496     </html>
497     EOF

Properties

Name Value
svn:executable *
svn:mergeinfo

  ViewVC Help
Powered by ViewVC 1.1.5