mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-03-10 02:41:10 +00:00
Merge excuses "unblock" parsing for unstable and *pu
The primary difference between the parsing / output of excuses for *pu and unstable unblocks is the messages displayed. We can therefore remove some duplication by having the same code handle both, outputting the appropriate message. Where a *pu package is also the subject of a "block" (most likely during a freeze) we only supply the "needs approval" or "approved" message; previously both "needs approval" and "not touching due to block" were output, which is redundant. We ensure that there is always a dummy "block" hint for *pu packages to provide the "needs approval" behaviour. Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
This commit is contained in:
parent
83f25ca602
commit
67a181d8fc
25
britney.py
25
britney.py
@ -1305,6 +1305,8 @@ class Britney(object):
|
||||
blocked['block-udeb'] = hint
|
||||
for hint in self.hints.search(type='block-all', package='source'):
|
||||
blocked.setdefault('block', hint)
|
||||
if suite in ['pu', 'tpu']:
|
||||
blocked['block'] = '%s-block' % (suite)
|
||||
|
||||
# if the source is blocked, then look for an `unblock' hint; the unblock request
|
||||
# is processed only if the specified version is correct. If a package is blocked
|
||||
@ -1314,14 +1316,20 @@ class Britney(object):
|
||||
unblocks = self.hints.search(unblock_cmd, package=src)
|
||||
|
||||
if unblocks and self.same_source(unblocks[0].version, source_u[VERSION]):
|
||||
excuse.addhtml("Ignoring %s request by %s, due to %s request by %s" %
|
||||
(block_cmd, blocked[block_cmd].user, unblock_cmd, unblocks[0].user))
|
||||
if suite == 'unstable' or block_cmd == 'block-udeb':
|
||||
excuse.addhtml("Ignoring %s request by %s, due to %s request by %s" %
|
||||
(block_cmd, blocked[block_cmd].user, unblock_cmd, unblocks[0].user))
|
||||
else:
|
||||
excuse.addhtml("Approved by %s" % (unblocks[0].user))
|
||||
else:
|
||||
if unblocks:
|
||||
excuse.addhtml("%s request by %s ignored due to version mismatch: %s" %
|
||||
(unblock_cmd.capitalize(), unblocks[0].user, unblocks[0].version))
|
||||
excuse.addhtml("Not touching package due to %s request by %s (contact debian-release if update is needed)" %
|
||||
(block_cmd, blocked[block_cmd].user))
|
||||
if suite == 'unstable' or block_cmd == 'block-udeb':
|
||||
excuse.addhtml("Not touching package due to %s request by %s (contact debian-release if update is needed)" %
|
||||
(block_cmd, blocked[block_cmd].user))
|
||||
else:
|
||||
excuse.addhtml("NEEDS APPROVAL BY RM")
|
||||
update_candidate = False
|
||||
|
||||
# if the suite is unstable, then we have to check the urgency and the minimum days of
|
||||
@ -1476,15 +1484,6 @@ class Britney(object):
|
||||
excuse.addhtml("Should ignore, but forced by %s" % (forces[0].user))
|
||||
update_candidate = True
|
||||
|
||||
# if the suite is *-proposed-updates, the package needs an explicit approval in order to go in
|
||||
if suite in ['tpu', 'pu']:
|
||||
approves = [ x for x in self.hints.search('unblock', package=src) if self.same_source(source_u[VERSION], x.version) ]
|
||||
if approves:
|
||||
excuse.addhtml("Approved by %s" % approves[0].user)
|
||||
else:
|
||||
excuse.addhtml("NEEDS APPROVAL BY RM")
|
||||
update_candidate = False
|
||||
|
||||
# if the package can be updated, it is a valid candidate
|
||||
if update_candidate:
|
||||
excuse.is_valid = True
|
||||
|
Loading…
x
Reference in New Issue
Block a user