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

Contents of /udd/web/bugs.cgi

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:executable *
svn:mergeinfo

  ViewVC Help
Powered by ViewVC 1.1.5