From 563556de95cb54914f01f192c62e84d41e2ffaf2 Mon Sep 17 00:00:00 2001 From: Ivo De Decker Date: Sun, 9 Feb 2020 14:54:05 +0000 Subject: [PATCH] Suite: add is_cruft function --- britney2/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/britney2/__init__.py b/britney2/__init__.py index 10a2a5e..dd3dab7 100644 --- a/britney2/__init__.py +++ b/britney2/__init__.py @@ -102,6 +102,15 @@ class Suite(object): """ yield from (x for x in pkgs if x in self.all_binaries_in_suite) + def is_cruft(self, pkg): + """Check if the package is cruft in the suite + + :param pkg: BinaryPackage to check + Note that this package is assumed to be in the suite + """ + newest_src_in_suite = self.sources[pkg.source] + return pkg.source_version != newest_src_in_suite.version + class TargetSuite(Suite):