From 9efcbd2805c439f34e5bdad1ac8ad05803d4a9cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Tue, 15 Apr 2008 13:56:07 +0200 Subject: Fixed the accidential removal of packages in the install queue if one is masked. --- portato/gui/queue.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'portato/gui/queue.py') diff --git a/portato/gui/queue.py b/portato/gui/queue.py index 76db6b2..9627cef 100644 --- a/portato/gui/queue.py +++ b/portato/gui/queue.py @@ -169,10 +169,22 @@ class EmergeQueue: changedUse.append("+"+i) except backend.PackageNotFoundException, e: # package not found / package is masked -> delete current tree and re-raise the exception - if self.tree.iter_has_parent(it): - while self.tree.iter_has_parent(it): + if type == "update": # remove complete tree + if self.tree.iter_has_parent(it): + while self.tree.iter_has_parent(it): + it = self.tree.parent_iter(it) + self.remove_with_children(it, removeNewFlags = False) + elif type == "install": # remove only the intentionally added package + top = self.tree.first_iter(it) + parent = self.tree.parent_iter(it) + while not self.tree.iter_equal(top, parent): + parent = self.tree.parent_iter(parent) it = self.tree.parent_iter(it) + self.remove_with_children(it, removeNewFlags = False) + + if not self.tree.iter_has_children(top): # remove completely if nothing left + self.remove(top) raise # add iter -- cgit v1.2.3