From 111413fb7b73c411d57db64ac0c9eaa1f15e27c4 Mon Sep 17 00:00:00 2001 From: Ivo De Decker Date: Mon, 19 Nov 2018 15:46:34 +0000 Subject: [PATCH] Don't remove package if removal is blocked Support blocking the removal of a package with a removal hint. This is useful to block an auto-removal. Before this patch, only removals for packages not in unstable could be blocked. Signed-off-by: Ivo De Decker --- britney.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/britney.py b/britney.py index d5bf84a..6c15905 100755 --- a/britney.py +++ b/britney.py @@ -1681,10 +1681,22 @@ class Britney(object): continue # add the removal of the package to upgrade_me and build a new excuse - upgrade_me_add("-%s" % (src)) excuse = Excuse("-%s" % (src)) excuse.set_vers(tsrcv, None) excuse.addhtml("Removal request by %s" % (hint.user)) + # if the removal of the package is blocked, skip it + blocked = False + for blockhint in self.hints.search('block', package=src, removal=True): + excuse.addhtml("Not removing package, due to block hint by %s " + "(contact debian-release if update is needed)" % blockhint.user) + excuse.addreason("block") + blocked = True + + if blocked: + excuses[excuse.name] = excuse + continue + + upgrade_me_add("-%s" % (src)) excuse.addhtml("Package is broken, will try to remove") excuse.add_hint(hint) # Using "PASS" here as "Created by a hint" != "accepted due to hint". In a future