from daklib.dbconn import DBConn, has_new_comment, DBChange, DBSource, get_uid_from_fingerprint
from daklib.textutils import fix_maintainer
from daklib.dak_exceptions import *
+import debianbts
Cnf = None
direction = []
"""
def table_header(type, source_count, total_count):
- print "<h1>Summary for: %s</h1>" % (type)
+ print "<h1 class='binNEW'>Summary for: %s</h1>" % (type)
+ print "<h1 class='binNEW' style='display: none'>Summary for: binary-%s only</h1>" % (type)
print """
<table class="NEW">
<p class="togglepkg" onclick="togglePkg()">Click to toggle all/binary-NEW packages</p>
- <caption>
+ <caption class="binNEW">
"""
print "Package count in <strong>%s</strong>: <em>%s</em> | Total Package count: <em>%s</em>" % (type, source_count, total_count)
print """
print "</tbody></table>"
-def table_row(source, version, arch, last_mod, maint, distribution, closes, fingerprint, sponsor, changedby):
+def find_bug_severities(bugnrs):
+ """Take a list of bug numbers and
+ return a dictionary with bug number - severity pairs."""
+ statuses = None
+ try: statuses = debianbts.get_status(bugnrs)
+ except Exception:
+ return None
+ severities = {}
+ for bug_status in statuses:
+ severities[bug_status.bug_num] = bug_status.severity
+ return severities
+
+def rcbug_close_check(closes):
+ """Take a list of bug numbers and determine if at least one of them
+ is release critical."""
+ severity_list = find_bug_severities(closes)
+ if severity_list:
+ severities = severity_list.values()
+ return ('critical' in severities) or \
+ ('serious' in severities) or \
+ ('grave' in severities)
+ return False
+
+def table_row(source, version, arch, last_mod, maint, distribution, closes, fingerprint, sponsor, changedby, fixes_rcbug):
global row_number
if dist == "experimental":
trclass = "exp"
+ if fixes_rcbug:
+ trclass = "rcfix"
+
if not len(session.query(DBSource).filter_by(source = source).all()):
trclass += " binNEW"
session.commit()
print "<td class=\"package\">%s</td>" % (source)
print "<td class=\"version\">"
for vers in version.split():
- print "<a href=\"/new/%s_%s.html\">%s</a><br/>" % (source, utils.html_escape(vers), utils.html_escape(vers))
+ print "<a href=\"new/%s_%s.html\">%s</a><br/>" % (source, utils.html_escape(vers), utils.html_escape(vers))
print "</td>"
print "<td class=\"arch\">%s</td>" % (arch)
print "<td class=\"distribution\">"
note = " | [N]"
else:
note = ""
- entries.append([source, binary, version_list, arch_list, note, last_modified, maint, distribution, closes, fingerprint, sponsor, changedby, filename])
+ fixes_rcbug = rcbug_close_check(closes)
+ entries.append([source, binary, version_list, arch_list, note, last_modified, maint, distribution, closes, fingerprint, sponsor, changedby, filename, fixes_rcbug])
# direction entry consists of "Which field, which direction, time-consider" where
# time-consider says how we should treat last_modified. Thats all.
if Cnf.has_key("Queue-Report::Options::822"):
# print stuff out in 822 format
for entry in entries:
- (source, binary, version_list, arch_list, note, last_modified, maint, distribution, closes, fingerprint, sponsor, changedby, changes_file) = entry
+ (source, binary, version_list, arch_list, note, last_modified, maint, distribution, closes, fingerprint, sponsor, changedby, changes_file, fixes_rcbug) = entry
# We'll always have Source, Version, Arch, Mantainer, and Dist
# For the rest, check to see if we have them, then print them out
source_count = len(per_source_items)
table_header(type.upper(), source_count, total_count)
for entry in entries:
- (source, binary, version_list, arch_list, note, last_modified, maint, distribution, closes, fingerprint, sponsor, changedby, undef) = entry
- table_row(source, version_list, arch_list, time_pp(last_modified), maint, distribution, closes, fingerprint, sponsor, changedby)
+ (source, binary, version_list, arch_list, note, last_modified, maint, distribution, closes, fingerprint, sponsor, changedby, undef, fixes_rcbug) = entry
+ table_row(source, version_list, arch_list, time_pp(last_modified), maint, distribution, closes, fingerprint, sponsor, changedby, entries, fixes_rcbug)
table_footer(type.upper())
elif not Cnf.has_key("Queue-Report::Options::822"):
# The "normal" output without any formatting.
msg = ""
for entry in entries:
- (source, binary, version_list, arch_list, note, last_modified, undef, undef, undef, undef, undef, undef, undef) = entry
+ (source, binary, version_list, arch_list, note, last_modified, undef, undef, undef, undef, undef, undef, undef, fixes_rcbug) = entry
msg += format % (source, version_list, arch_list, note, time_pp(last_modified))
if msg: