summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2008-04-18 01:55:15 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2008-04-18 01:55:15 +0200
commit4cc1e681aaec4accbc72f33f51677d9aded037cc (patch)
treedaae6f362c3baa5a085777deda8c638025734ada /portato
parente4f0e899d681aeb3577054644b032101e3cd2d16 (diff)
downloadportato-4cc1e681aaec4accbc72f33f51677d9aded037cc.tar.gz
portato-4cc1e681aaec4accbc72f33f51677d9aded037cc.tar.bz2
portato-4cc1e681aaec4accbc72f33f51677d9aded037cc.zip
Fixed update world to fit current portage handling
Diffstat (limited to '')
-rw-r--r--portato/backend/portage/system.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py
index a3583b1..10fa9bc 100644
--- a/portato/backend/portage/system.py
+++ b/portato/backend/portage/system.py
@@ -36,6 +36,8 @@ class PortageSystem (SystemInterface):
self.use_descs = {}
self.local_use_descs = defaultdict(dict)
+ self._version = tuple([x.split("_")[0] for x in portage.VERSION.split(".")])
+
def get_version (self):
return "Portage %s" % portage.VERSION
@@ -155,7 +157,7 @@ class PortageSystem (SystemInterface):
return PortagePackage(portage.best(list))
def find_best_match (self, search_key, masked = False, only_installed = False, only_cpv = False):
- t = None
+ t = []
if not only_installed:
try:
@@ -173,11 +175,14 @@ class PortageSystem (SystemInterface):
t += self.settings.porttree.dbapi.match(cp)
else:
raise
- else:
- t = self.find_installed_packages(search_key, masked, only_cpv = True)
+
+ if self._version >= (2,1,5) or only_installed:
+ t += [pkg.get_cpv() for pkg in self.find_installed_packages(search_key) if not pkg.is_masked()]
if t:
+ t = unique_array(t)
return self.find_best(t, only_cpv)
+
return None
def find_packages (self, search_key, masked=False, only_cpv = False):
@@ -373,7 +378,7 @@ class PortageSystem (SystemInterface):
# append system packages
packages.extend(unique_array([p.get_cp() for p in self.find_all_system_packages()]))
- states = [(["RDEPEND"], True)]
+ states = [(["RDEPEND", "PDEPEND"], True)]
if self.with_bdeps():
states.append((["DEPEND"], True))