diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2008-05-21 21:13:05 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2008-05-21 21:13:05 +0200 |
commit | f4368fbfb9fd0de6f1d1625ffddee17b67926c89 (patch) | |
tree | 274c6fe882a2f22aa99d0c301fb90a882e379900 /portato/backend | |
parent | 43509c27dd08219147e4bcdb0897ebb2f5ec22cc (diff) | |
parent | c24b4970e48771a32155cbc79060c76d218fdd85 (diff) | |
download | portato-f4368fbfb9fd0de6f1d1625ffddee17b67926c89.tar.gz portato-f4368fbfb9fd0de6f1d1625ffddee17b67926c89.tar.bz2 portato-f4368fbfb9fd0de6f1d1625ffddee17b67926c89.zip |
Merged from trunk
Diffstat (limited to '')
-rw-r--r-- | portato/backend/portage/system.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py index d0a0bc3..fa4fece 100644 --- a/portato/backend/portage/system.py +++ b/portato/backend/portage/system.py @@ -31,11 +31,13 @@ class PortageSystem (SystemInterface): def __init__ (self): """Constructor.""" self.settings = PortageSettings() - portage.WORLD_FILE = os.path.join(self.settings.settings["ROOT"], portage.WORLD_FILE) + portage.WORLD_FILE = os.path.join(self.settings.settings["ROOT"],portage.WORLD_FILE) 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,18 +157,24 @@ 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: pkgSet = "tree" else: pkgSet = "installed" t = self.find_packages(search_key, pkgSet = pkgSet, masked = masked, with_version = True, only_cpv = True) + + if self._version >= (2,1,5): + t += [pkg.get_cpv() for pkg in self.find_installed_packages(search_key) if not (pkg.is_testing(True) or pkg.is_masked())] if t: + t = unique_array(t) return self.find_best(t, only_cpv) + return None + def find_packages (self, key = "", pkgSet = "all", masked = False, with_version = True, only_cpv = False): if key is None: key = "" @@ -355,7 +363,7 @@ class PortageSystem (SystemInterface): # append system packages packages.extend(unique_array([p.get_cp() for p in self.find_packages(pkgSet = "system")])) - states = [(["RDEPEND"], True)] + states = [(["RDEPEND", "PDEPEND"], True)] if self.with_bdeps(): states.append((["DEPEND"], True)) @@ -431,7 +439,7 @@ class PortageSystem (SystemInterface): else: for pkg in bm: if not pkg: continue - if pkg.is_masked() or pkg.is_testing(True): # check to not update unnecessairily + if not pkg.is_installed() and (pkg.is_masked() or pkg.is_testing(True)): # check to not update unnecessairily cont = False for inst in self.find_packages(pkg.get_cp(), "installed", only_cpv = True): if self.cpv_matches(inst, i): |