From 917b84845575bfa6135f71551e742e5971d0fb56 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sun, 11 Dec 2011 23:34:29 +0100 Subject: [PATCH] Simplified get_reverse_tree Removed the "packages" variable from get_reverse_tree as it was just a "list" variant of "seen". Signed-off-by: Niels Thykier --- britney.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/britney.py b/britney.py index 2995056..7a577d3 100755 --- a/britney.py +++ b/britney.py @@ -1952,15 +1952,12 @@ class Britney: return (item, affected, undo) def get_reverse_tree(self, pkg, arch, suite): - packages = [] binaries = self.binaries[suite][arch][0] rev_deps = set(binaries[pkg][RDEPENDS]) seen = set() while len(rev_deps) > 0: # mark all of the current iteration of packages as affected - packages.extend( [ x for x in rev_deps ] ) - # and as processed seen |= rev_deps # generate the next iteration, which is the reverse-dependencies of # the current iteration @@ -1970,9 +1967,7 @@ class Britney: # in the process rev_deps = set([ package for sublist in new_rev_deps \ for package in sublist if package not in seen ]) - # remove duplicates from the list of affected packages - packages = list(set(packages)) - return packages + return list(seen) def get_full_tree(self, pkg, arch, suite): """Calculate the full dependency tree for the given package