From 771f5d15924679395ac1b33885f5ca807c0ea473 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 25 Jun 2013 10:54:53 +0000 Subject: [PATCH] =?UTF-8?q?Don't=C2=A0crash=C2=A0on=C2=A0unversioned=C2=A0?= =?UTF-8?q?unblock=C2=A0hints.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adam D. Barratt --- britney.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/britney.py b/britney.py index 11c4480..84f2e63 100755 --- a/britney.py +++ b/britney.py @@ -1335,7 +1335,7 @@ class Britney(object): unblock_cmd = "un" + block_cmd unblocks = self.hints.search(unblock_cmd, package=src) - if unblocks and self.same_source(unblocks[0].version, source_u[VERSION]): + if unblocks and unblocks[0].version is not None and self.same_source(unblocks[0].version, source_u[VERSION]): 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)) @@ -1343,8 +1343,12 @@ class Britney(object): 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)) + if unblocks[0].version is None: + excuse.addhtml("%s request by %s ignored due to missing version" % + (unblock_cmd.capitalize(), unblocks[0].user)) + else: + excuse.addhtml("%s request by %s ignored due to version mismatch: %s" % + (unblock_cmd.capitalize(), unblocks[0].user, unblocks[0].version)) 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))