diff --git a/britney.py b/britney.py index 6a7262f..7d754b1 100755 --- a/britney.py +++ b/britney.py @@ -1498,11 +1498,10 @@ class Britney(object): # check if there is a `force' hint for this package, which allows it to go in even if it is not updateable forces = self.hints.search('force', package=src, version=source_u.version) if forces: - excuse.dontinvalidate = True - if not excuse.is_valid: + # force() updates the final verdict for us + changed_state = excuse.force() + if changed_state: excuse.addhtml("Should ignore, but forced by %s" % (forces[0].user)) - excuse.force() - excuse.is_valid = True self.excuses[excuse.name] = excuse return excuse.is_valid diff --git a/britney2/excuse.py b/britney2/excuse.py index d7afd18..706e95a 100644 --- a/britney2/excuse.py +++ b/britney2/excuse.py @@ -48,7 +48,6 @@ class Excuse(object): self.mindays = None self.section = None self._is_valid = False - self._dontinvalidate = False self.needs_approval = False self.hints = [] self.forced = False @@ -80,13 +79,7 @@ class Excuse(object): def is_valid(self, value): self._is_valid = value - @property - def dontinvalidate(self): - return self._dontinvalidate - @dontinvalidate.setter - def dontinvalidate(self, value): - self._dontinvalidate = value def set_vers(self, tver, uver): """Set the testing and unstable versions""" @@ -127,6 +120,10 @@ class Excuse(object): def force(self): """Add force hint""" self.forced = True + if not self._is_valid: + self._is_valid = True + return True + return False def addhtml(self, note): """Add a note in HTML""" diff --git a/britney2/utils.py b/britney2/utils.py index c819362..3827aa0 100644 --- a/britney2/utils.py +++ b/britney2/utils.py @@ -802,14 +802,14 @@ def invalidate_excuses(excuses, valid, invalid): continue # loop on the reverse dependencies for x in revdeps[ename]: - # if the item is valid and it is marked as `dontinvalidate', skip the item - if x in valid and excuses[x].dontinvalidate: - continue - - # otherwise, invalidate the dependency and mark as invalidated and - # remove the depending excuses - excuses[x].invalidate_dep(ename) if x in valid: + # if the item is valid and it is marked as `forced', skip the item + if excuses[x].forced: + continue + + # otherwise, invalidate the dependency and mark as invalidated and + # remove the depending excuses + excuses[x].invalidate_dep(ename) p = valid.index(x) invalid.append(valid.pop(p)) excuses[x].addhtml("Invalidated by dependency")