From 25edeccbc87cf8821aea8a26faabb899443a3f9c Mon Sep 17 00:00:00 2001 From: Necoro <> Date: Fri, 19 Oct 2007 19:25:45 +0000 Subject: fix in update world - find masked dependencies too --- portato/backend/catapult/system.py | 4 ++-- portato/backend/portage/system.py | 22 ++++++++++++++++------ portato/backend/system_interface.py | 4 +++- 3 files changed, 21 insertions(+), 9 deletions(-) (limited to 'portato') diff --git a/portato/backend/catapult/system.py b/portato/backend/catapult/system.py index 4d9173e..cfa74ed 100644 --- a/portato/backend/catapult/system.py +++ b/portato/backend/catapult/system.py @@ -59,8 +59,8 @@ class CatapultSystem (SystemInterface): else: return CatapultPackage(self.proxy.find_best(list)) - def find_best_match (self, search_key, only_installed = False, only_cpv = False): - p = self.proxy.find_best_match(search_key, only_installed) + def find_best_match (self, search_key, masked = False, only_installed = False, only_cpv = False): + p = self.proxy.find_best_match(search_key, masked, only_installed) if p and not only_cpv: return CatapultPackage(p) diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py index 93c5ea0..d4f4aef 100644 --- a/portato/backend/portage/system.py +++ b/portato/backend/portage/system.py @@ -149,21 +149,27 @@ class PortageSystem (SystemInterface): else: return PortagePackage(portage.best(list)) - def find_best_match (self, search_key, only_installed = False, only_cpv = False): + def find_best_match (self, search_key, masked = False, only_installed = False, only_cpv = False): t = None if not only_installed: try: - t = self.settings.porttree.dbapi.match(search_key) + if masked: + t = self.settings.porttree.dbapi.xmatch("match-all", search_key) + else: + t = self.settings.porttree.dbapi.match(search_key) except ValueError, e: # ambigous package if isinstance(e[0], list): t = [] for cp in e[0]: - t += self.settings.porttree.dbapi.match(cp) + if masked: + t += self.settings.porttree.dbapi.xmatch("match-all", cp) + else: + t += self.settings.porttree.dbapi.match(cp) else: raise else: - t = self.find_installed_packages(search_key, only_cpv = True) + t = self.find_installed_packages(search_key, masked, only_cpv = True) if t: return self.find_best(t, only_cpv) @@ -320,8 +326,12 @@ class PortageSystem (SystemInterface): best_p = self.find_best_match(p) if best_p is None: - warning(_("No best match for %s. It seems not to be in the tree anymore.") % p) - continue + best_p = self.find_best_match(p, masked = True) + if best_p is None: + warning(_("No best match for %s. It seems not to be in the tree anymore.") % p) + continue + else: + debug("Best match for %s is masked" % p) if len(inst) > 1: myslots = set() diff --git a/portato/backend/system_interface.py b/portato/backend/system_interface.py index c0f4e68..fce8069 100644 --- a/portato/backend/system_interface.py +++ b/portato/backend/system_interface.py @@ -50,11 +50,13 @@ class SystemInterface (object): raise NotImplementedError - def find_best_match (self, search_key, only_installed = False, only_cpv = False): + def find_best_match (self, search_key, masked = False, only_installed = False, only_cpv = False): """Finds the best match in the portage tree. It does not find masked packages! @param search_key: the key to find in the portage tree @type search_key: string + @param masked: if True, also look for masked packages + @type masked: boolean @param only_installed: if True, only installed packages are searched @type only_installed: boolean @param only_cpv: do not return package but only the cpv -- cgit v1.2.3-54-g00ecf