diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2008-05-21 21:03:58 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2008-05-21 21:03:58 +0200 |
commit | 43509c27dd08219147e4bcdb0897ebb2f5ec22cc (patch) | |
tree | 59bc82411931488974eda9cb37190dcb4e7884a7 | |
parent | 406603141a35e2be08e559fc9ec090c6c968b596 (diff) | |
download | portato-43509c27dd08219147e4bcdb0897ebb2f5ec22cc.tar.gz portato-43509c27dd08219147e4bcdb0897ebb2f5ec22cc.tar.bz2 portato-43509c27dd08219147e4bcdb0897ebb2f5ec22cc.zip |
Some more fixes
Diffstat (limited to '')
-rw-r--r-- | portato/backend/portage/system.py | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py index f92e34e..d0a0bc3 100644 --- a/portato/backend/portage/system.py +++ b/portato/backend/portage/system.py @@ -165,9 +165,7 @@ class PortageSystem (SystemInterface): t = self.find_packages(search_key, pkgSet = pkgSet, masked = masked, with_version = True, only_cpv = True) if t: - return self.find_best(t) - - return self.geneticize_list(t, only_cpv) + return self.find_best(t, only_cpv) def find_packages (self, key = "", pkgSet = "all", masked = False, with_version = True, only_cpv = False): if key is None: key = "" @@ -214,14 +212,14 @@ class PortageSystem (SystemInterface): return list(alist - inst) def _ws (key, crit, pkglist): - list = self.__find_resolved_unresolved(pkglist, crit)[0] + pkgs = self.__find_resolved_unresolved(pkglist, crit, only_cpv = with_version)[0] if not with_version: - list = [self.pkg.get_cp(x) for x in list] + pkgs = [x.get_cp(x) for x in list] if is_regexp: - return filter(lambda x: re.match(key, x, re.I), list) + return filter(lambda x: re.match(key, x, re.I), pkgs) - return list + return pkgs def world (key): with open(portage.WORLD_FILE) as f: @@ -232,19 +230,19 @@ class PortageSystem (SystemInterface): def system (key): return _ws(key, lambda cpv: cpv[0] == "*", self.settings.settings.packages) + funcmap = { + "all" : all, + "installed" : installed, + "uninstalled" : uninstalled, + "world" : world, + "system" : system, + "tree" : tree + } + pkgSet = pkgSet.lower() - if pkgSet == "" or pkgSet == "all": - func = all - elif pkgSet == "installed": - func = installed - elif pkgSet == "uninstalled": - func = uninstalled - elif pkgSet == "world": - func = world - elif pkgSet == "system": - func = system - elif pkgSet == "tree": - func = tree + if pkgSet == "": pkgSet = "all" + + func = funcmap[pkgSet] try: t = func(key) |