From b0172d74c4591aa8c88011f3f7b23f46b3e954dd Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sat, 12 Jan 2013 12:31:17 +0100 Subject: [PATCH 1/4] Ignore sources only referenced by Built-Using Signed-off-by: Niels Thykier Signed-off-by: Adam D. Barratt --- britney.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/britney.py b/britney.py index 0b03d30..7f56976 100755 --- a/britney.py +++ b/britney.py @@ -453,6 +453,9 @@ class Britney(object): step = Packages.step while step(): + if get_field('Extra-Source-Only', 'no') == 'yes': + # Ignore sources only referenced by Built-Using + continue pkg = get_field('Package') ver = get_field('Version') # There may be multiple versions of the source package From ce69eb334533175016486306b05910a2e2ac5954 Mon Sep 17 00:00:00 2001 From: "Adam D. Barratt" Date: Fri, 18 Jan 2013 18:42:10 +0000 Subject: [PATCH 2/4] Make "approve" an alias for "unblock" An "approve" hint is effectively an unblock for tpu packages and britney is already quiite happy to parse "unblock $pkg/$tpuversion". We allow the old name to be used for compatibility and replace it with "unblock" internally. Signed-off-by: Adam D. Barratt --- britney.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/britney.py b/britney.py index 7f56976..28b5b96 100755 --- a/britney.py +++ b/britney.py @@ -831,6 +831,7 @@ class Britney(object): # All current hints require at least one argument self.__log("Malformed hint found in %s: '%s'" % (filename, line), type="W") elif l[0] in ["approve", "block", "block-all", "block-udeb", "unblock", "unblock-udeb", "force", "urgent", "remove"]: + if l[0] == 'approve': l[0] = 'unblock' for package in l[1:]: hints.add_hint('%s %s' % (l[0], package), who) elif l[0] in ["age-days"]: @@ -1483,7 +1484,7 @@ class Britney(object): # 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('approve', package=src) if self.same_source(source_u[VERSION], x.version) ] + 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: From 83f25ca602efb05c09907dbe653b18dc8da011e7 Mon Sep 17 00:00:00 2001 From: "Adam D. Barratt" Date: Fri, 18 Jan 2013 18:47:06 +0000 Subject: [PATCH 3/4] Remove remaining "approve" hint support code Signed-off-by: Adam D. Barratt --- britney.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/britney.py b/britney.py index 28b5b96..4353992 100755 --- a/britney.py +++ b/britney.py @@ -840,7 +840,7 @@ class Britney(object): else: hints.add_hint(l, who) - for x in ["approve", "block", "block-all", "block-udeb", "unblock", "unblock-udeb", "force", "urgent", "remove", "age-days"]: + for x in ["block", "block-all", "block-udeb", "unblock", "unblock-udeb", "force", "urgent", "remove", "age-days"]: z = {} for hint in hints[x]: package = hint.package @@ -870,12 +870,6 @@ class Britney(object): if len(hints["block"]) == 0 and len(hints["block-udeb"]) == 0: self.__log("WARNING: No block hints at all, not even udeb ones!", type="W") - # A (t-)p-u approval overrides an unstable block - for p in hints["approve"]: - for o in hints.search('unblock', package=p.package): - o.set_active(False) - hints.add_hint('unblock %s/%s' % (p.package, p.version), p.user) - return hints def write_heidi(self, filename): From 67a181d8fc5b5acca7b0e41a4fa722e8df075312 Mon Sep 17 00:00:00 2001 From: "Adam D. Barratt" Date: Fri, 18 Jan 2013 18:52:07 +0000 Subject: [PATCH 4/4] 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 --- britney.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/britney.py b/britney.py index 4353992..ab87016 100755 --- a/britney.py +++ b/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