| 12 |
['squeeze_and_sid', 'squeeze and sid', 'id in (select id from bugs_rt_affects_testing) and id in (select id from bugs_rt_affects_unstable)'], |
['squeeze_and_sid', 'squeeze and sid', 'id in (select id from bugs_rt_affects_testing) and id in (select id from bugs_rt_affects_unstable)'], |
| 13 |
['squeeze_or_sid', 'squeeze or sid', 'id in (select id from bugs_rt_affects_testing union select id from bugs_rt_affects_unstable)'], |
['squeeze_or_sid', 'squeeze or sid', 'id in (select id from bugs_rt_affects_testing union select id from bugs_rt_affects_unstable)'], |
| 14 |
['squeeze_not_sid', 'squeeze, not sid', 'id in (select id from bugs_rt_affects_testing) and id not in (select id from bugs_rt_affects_unstable)'], |
['squeeze_not_sid', 'squeeze, 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_squeeze', 'sid, not squeeze', 'id in (select id from bugs_rt_affects_unstable) and id not in (select id from bugs_rt_affects_testing)'] |
['sid_not_squeeze', 'sid, not squeeze', 'id in (select id from bugs_rt_affects_unstable) and id not in (select id from bugs_rt_affects_testing)'], |
| 16 |
|
['lenny', 'lenny', 'id in (select id from bugs_rt_affects_stable)'], |
| 17 |
] |
] |
| 18 |
|
|
| 19 |
FILTERS = [ |
FILTERS = [ |
| 24 |
['notsqueeze', 'packages not in squeeze', 'id not in (select id from bugs_packages, sources where bugs_packages.source = sources.source and release=\'squeeze\')'], |
['notsqueeze', 'packages not in squeeze', 'id not in (select id from bugs_packages, sources where bugs_packages.source = sources.source and release=\'squeeze\')'], |
| 25 |
['merged', 'merged bugs', 'id in (select id from bugs_merged_with where id > merged_with)'], |
['merged', 'merged bugs', 'id in (select id from bugs_merged_with where id > merged_with)'], |
| 26 |
['done', 'marked as done', 'status = \'done\''], |
['done', 'marked as done', 'status = \'done\''], |
| 27 |
|
['outdatedsqueeze', 'outdated binaries in squeeze', "source in (select distinct p1.source from packages_summary p1, packages_summary p2 where p1.source = p2.source and p1.release='squeeze' and p2.release='squeeze' and p1.source_version != p2.source_version)"], |
| 28 |
|
['outdatedsid', 'outdated binaries in sid', "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)"], |
| 29 |
] |
] |
| 30 |
|
|
| 31 |
TYPES = [ |
TYPES = [ |
| 64 |
# filters |
# filters |
| 65 |
filters = {} |
filters = {} |
| 66 |
FILTERS.map { |r| r[0] }.each do |e| |
FILTERS.map { |r| r[0] }.each do |e| |
| 67 |
if ['notconsidered', 'only', 'ign'].include?(cgi.params[e][0]) |
if ['', 'only', 'ign'].include?(cgi.params[e][0]) |
| 68 |
filters[e] = cgi.params[e][0] |
filters[e] = cgi.params[e][0] |
| 69 |
else |
else |
| 70 |
filters[e] = (e == 'merged' ? 'ign' : 'notconsidered') |
filters[e] = (e == 'merged' ? 'ign' : '') |
| 71 |
end |
end |
| 72 |
end |
end |
| 73 |
# filter: newer than X days |
# filter: newer than X days |
| 74 |
if ['notconsidered', 'only', 'ign'].include?(cgi.params['fnewer'][0]) |
if ['', 'only', 'ign'].include?(cgi.params['fnewer'][0]) |
| 75 |
fnewer = cgi.params['fnewer'][0] |
fnewer = cgi.params['fnewer'][0] |
| 76 |
else |
else |
| 77 |
fnewer = 'notconsidered' |
fnewer = '' |
| 78 |
end |
end |
| 79 |
if cgi.params['fnewerval'][0] =~ /^[0-9]+$/ |
if cgi.params['fnewerval'][0] =~ /^[0-9]+$/ |
| 80 |
fnewerval = cgi.params['fnewerval'][0].to_i |
fnewerval = cgi.params['fnewerval'][0].to_i |
| 99 |
<html> |
<html> |
| 100 |
<head> |
<head> |
| 101 |
<style type="text/css"> |
<style type="text/css"> |
| 102 |
|
|
| 103 |
|
body { |
| 104 |
|
font-family : "DejaVu Sans", "Bitstream Vera Sans", sans-serif;" |
| 105 |
|
} |
| 106 |
|
|
| 107 |
table.buglist td, table.buglist th { |
table.buglist td, table.buglist th { |
| 108 |
border: 1px solid gray; |
border: 1px solid gray; |
| 109 |
padding-left: 3px; |
padding-left: 3px; |
| 116 |
border-collapse: collapse; |
border-collapse: collapse; |
| 117 |
} |
} |
| 118 |
|
|
| 119 |
|
div#body { |
| 120 |
|
border-top: 2px solid #d70751; |
| 121 |
|
} |
| 122 |
|
|
| 123 |
|
div.footer { |
| 124 |
|
padding: 0.3em 0; |
| 125 |
|
background-color: #fff; |
| 126 |
|
text-align: center; |
| 127 |
|
border-top: 2px solid #d70751; |
| 128 |
|
margin: 0 0 0 0; |
| 129 |
|
border-bottom: 0; |
| 130 |
|
font-size: 85%; |
| 131 |
|
} |
| 132 |
</style> |
</style> |
| 133 |
<title>RC Bugs List @ UDD</title> |
<title>Debian Bugs Search @ UDD</title> |
| 134 |
</head> |
</head> |
| 135 |
<body> |
<body> |
| 136 |
<h1>Release Critical Bugs List</h1> |
<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> |
| 137 |
|
<div id="body"> |
| 138 |
|
|
| 139 |
<form action="bugs.cgi" method="get"> |
<form action="bugs.cgi" method="get"> |
| 140 |
<p><b>Bugs affecting:</b> |
<p><b>Bugs affecting:</b> |
| 145 |
puts "<input type='radio' name='release' value='#{r[0]}' #{checked}/>#{r[1]} " |
puts "<input type='radio' name='release' value='#{r[0]}' #{checked}/>#{r[1]} " |
| 146 |
end |
end |
| 147 |
puts <<-EOF |
puts <<-EOF |
| 148 |
(also uses release tags and xxx-ignore information)</p> |
<br/>(also uses release tags and xxx-ignore information)</p> |
| 149 |
<table class="invisible"><tr><td> |
<table class="invisible"><tr><td> |
| 150 |
<table class="buglist"> |
<table class="buglist"> |
| 151 |
<tr><th colspan='4'>FILTERS</th></tr> |
<tr><th colspan='4'>FILTERS</th></tr> |
| 154 |
FILTERS.each do |r| |
FILTERS.each do |r| |
| 155 |
puts <<-EOF |
puts <<-EOF |
| 156 |
<tr> |
<tr> |
| 157 |
<td style='text-align: center;'><input type='radio' name='#{r[0]}' value='' #{filters[r[0]]=='notconsidered'?'CHECKED=\'1\'':''}/></td> |
<td style='text-align: center;'><input type='radio' name='#{r[0]}' value='' #{filters[r[0]]==''?'CHECKED=\'1\'':''}/></td> |
| 158 |
<td style='text-align: center;'><input type='radio' name='#{r[0]}' value='only' #{filters[r[0]]=='only'?'CHECKED=\'1\'':''}/></td> |
<td style='text-align: center;'><input type='radio' name='#{r[0]}' value='only' #{filters[r[0]]=='only'?'CHECKED=\'1\'':''}/></td> |
| 159 |
<td style='text-align: center;'><input type='radio' name='#{r[0]}' value='ign' #{filters[r[0]]=='ign'?'CHECKED=\'1\'':''}'/></td> |
<td style='text-align: center;'><input type='radio' name='#{r[0]}' value='ign' #{filters[r[0]]=='ign'?'CHECKED=\'1\'':''}'/></td> |
| 160 |
<td>#{r[1]}</td> |
<td>#{r[1]}</td> |
| 164 |
# newer than |
# newer than |
| 165 |
puts <<-EOF |
puts <<-EOF |
| 166 |
<tr> |
<tr> |
| 167 |
<td style='text-align: center;'><input type='radio' name='fnewer' value='' #{fnewer=='notconsidered'?'CHECKED=\'1\'':''}/></td> |
<td style='text-align: center;'><input type='radio' name='fnewer' value='' #{fnewer==''?'CHECKED=\'1\'':''}/></td> |
| 168 |
<td style='text-align: center;'><input type='radio' name='fnewer' value='only' #{fnewer=='only'?'CHECKED=\'1\'':''}/></td> |
<td style='text-align: center;'><input type='radio' name='fnewer' value='only' #{fnewer=='only'?'CHECKED=\'1\'':''}/></td> |
| 169 |
<td style='text-align: center;'><input type='radio' name='fnewer' value='ign' #{fnewer=='ign'?'CHECKED=\'1\'':''}'/></td> |
<td style='text-align: center;'><input type='radio' name='fnewer' value='ign' #{fnewer=='ign'?'CHECKED=\'1\'':''}'/></td> |
| 170 |
<td>newer than <input type='text' size='3' name='fnewerval' value='#{fnewerval}'/> days</td> |
<td>newer than <input type='text' size='3' name='fnewerval' value='#{fnewerval}'/> days</td> |
| 188 |
puts "<input type='radio' name='sorto' value='#{r[0]}' #{checked}/>#{r[1]} " |
puts "<input type='radio' name='sorto' value='#{r[0]}' #{checked}/>#{r[1]} " |
| 189 |
end |
end |
| 190 |
puts <<-EOF |
puts <<-EOF |
| 191 |
</p><input type='submit' value='Update'/> |
</p><input type='submit' value='Search'/> |
| 192 |
</form> |
</form> |
| 193 |
EOF |
EOF |
| 194 |
if cgi.params != {} |
if cgi.params != {} |
| 210 |
elsif fnewer == 'ign' |
elsif fnewer == 'ign' |
| 211 |
q += "and (current_timestamp - interval '#{fnewerval} days' > arrival) \n" |
q += "and (current_timestamp - interval '#{fnewerval} days' > arrival) \n" |
| 212 |
end |
end |
| 213 |
q += "AND (" |
q2 = TYPES.select { |t| types[t[0]] }.map { |t| t[2] }.join("\n OR ") |
| 214 |
q += TYPES.select { |t| types[t[0]] }.map { |t| t[2] }.join("\n OR ") |
if q2 != "" |
| 215 |
q += ")\n " |
q += "AND (#{q2})\n" |
| 216 |
|
else |
| 217 |
|
puts "<p><b>Must select at least one bug type!</b></p>" |
| 218 |
|
q += "AND FALSE\n" |
| 219 |
|
end |
| 220 |
q += "order by #{sortby} #{sorto}" |
q += "order by #{sortby} #{sorto}" |
| 221 |
sth = dbh.prepare(q) |
sth = dbh.prepare(q) |
| 222 |
sth.execute |
sth.execute |
| 235 |
puts (0...bins.length).map { |i| "<a href=\"http://packages.qa.debian.org/#{srcs[i]}\">#{bins[i]}</a>" }.join(', ') |
puts (0...bins.length).map { |i| "<a href=\"http://packages.qa.debian.org/#{srcs[i]}\">#{bins[i]}</a>" }.join(', ') |
| 236 |
puts "</td>" |
puts "</td>" |
| 237 |
puts <<-EOF |
puts <<-EOF |
| 238 |
<td>#{r['title']}</td> |
<td>#{CGI::escapeHTML(r['title'])}</td> |
| 239 |
<td style='text-align: center;'>#{r['last_modified'].to_date}</td> |
<td style='text-align: center;'>#{r['last_modified'].to_date}</td> |
| 240 |
</tr> |
</tr> |
| 241 |
EOF |
EOF |
| 311 |
puts "</table>" |
puts "</table>" |
| 312 |
sth2 = dbh.prepare("select max(start_time) from timestamps where source = 'bugs' and command = 'run'") |
sth2 = dbh.prepare("select max(start_time) from timestamps where source = 'bugs' and command = 'run'") |
| 313 |
sth2.execute ; r2 = sth2.fetch_all |
sth2.execute ; r2 = sth2.fetch_all |
| 314 |
puts "<p><b>Generated in #{Time::now - tstart} seconds. Last data update: #{r2[0][0]}</b></p>" |
puts "<p><b>Generated in #{Time::now - tstart} seconds. Last data update: #{r2[0][0]}" |
| 315 |
|
puts " (%.1f hours ago)</b></p>" % ((Time::now - r2[0][0].to_time) / 3600) |
| 316 |
puts "<pre>#{q}</pre>" |
puts "<pre>#{q}</pre>" |
| 317 |
end # if cgi.params != {} |
end # if cgi.params != {} |
| 318 |
puts <<-EOF |
puts <<-EOF |
| 319 |
<hr/> |
</div> |
| 320 |
<small>Suggestions / comments / patches to lucas at debian dot org. <a href="http://svn.debian.org/wsvn/collab-qa/udd/web/cgi-bin/bugs.cgi">source code</a>.</small> |
<div class="footer"> |
| 321 |
|
<small>Suggestions / comments / patches to lucas@debian.org. <a href="http://svn.debian.org/wsvn/collab-qa/udd/web/cgi-bin/bugs.cgi">source code</a>.</small> |
| 322 |
|
</div> |
| 323 |
</body> |
</body> |
| 324 |
</html> |
</html> |
| 325 |
EOF |
EOF |