diff --git a/britney.py b/britney.py index f602745..12096c1 100755 --- a/britney.py +++ b/britney.py @@ -1214,12 +1214,18 @@ class Britney(object): for hint in self.hints.search(package=src): if hint.type == 'block': blocked['block'] = hint + excuse.add_hint(hint) if hint.type == 'block-udeb': blocked['block-udeb'] = hint - for hint in self.hints.search(type='block-all', package='source'): - blocked.setdefault('block', hint) - if suite in ['pu', 'tpu']: + excuse.add_hint(hint) + if 'block' not in blocked: + for hint in self.hints.search(type='block-all', package='source'): + blocked['block'] = hint + excuse.add_hint(hint) + break + if suite in ('pu', 'tpu'): blocked['block'] = '%s-block' % (suite) + excuse.needs_approval = True # 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 @@ -1229,7 +1235,8 @@ class Britney(object): unblocks = self.hints.search(unblock_cmd, package=src) if unblocks and unblocks[0].version is not None and unblocks[0].version == source_u[VERSION]: - if suite == 'unstable' or block_cmd == 'block-udeb': + excuse.add_hint(unblocks[0]) + if block_cmd == 'block-udeb' or not excuse.needs_approval: 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: diff --git a/excuse.py b/excuse.py index e1da7c3..0760841 100644 --- a/excuse.py +++ b/excuse.py @@ -50,6 +50,8 @@ class Excuse(object): self.section = None self._is_valid = False self._dontinvalidate = False + self.needs_approval = False + self.hints = [] self.forced = False self.invalid_deps = [] @@ -147,6 +149,9 @@ class Excuse(object): """Denote than an old binary ("cruft") is available from a previous source version""" self.old_binaries[from_source_version].add(binary) + def add_hint(self, hint): + self.hints.append(hint) + def html(self): """Render the excuse in HTML""" res = "%s (%s to %s)\n