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

Contents of /udd/web/bugs.cgi

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:executable *
svn:mergeinfo

  ViewVC Help
Powered by ViewVC 1.1.5