From 7ff82e776f80f119885ae585f85ceebaa1329edc Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Mon, 7 Mar 2011 19:42:40 +0100 Subject: [PATCH] [entropy.client.interfaces.dep] filter out list of removable packages by excluding those with reverse dependencies --- libraries/entropy/client/interfaces/dep.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libraries/entropy/client/interfaces/dep.py b/libraries/entropy/client/interfaces/dep.py index 2a3b4adbe..08102704a 100644 --- a/libraries/entropy/client/interfaces/dep.py +++ b/libraries/entropy/client/interfaces/dep.py @@ -2106,6 +2106,13 @@ class CalculatorsMixin: if m_action > 0 and (matchresults not in update): update.append(matchresults) + # validate remove, do not return installed packages that are + # still referenced by others as "removable" + # check inverse dependencies at the cost of growing complexity + if remove: + remove = [x for x in remove if not \ + self._installed_repository.retrieveReverseDependencies(x)] + if self.xcache: c_hash = self._get_updates_cache_hash(repo_hash, empty, ignore_spm_downgrades)