diff options
Diffstat (limited to '')
-rw-r--r-- | portato/backend/catapult/package.py | 63 |
1 files changed, 43 insertions, 20 deletions
diff --git a/portato/backend/catapult/package.py b/portato/backend/catapult/package.py index ffc249b..e42ac6a 100644 --- a/portato/backend/catapult/package.py +++ b/portato/backend/catapult/package.py @@ -3,7 +3,7 @@ # File: portato/backend/catapult/package.py # This file is part of the Portato-Project, a graphical portage-frontend. # -# Copyright (C) 2007 René 'Necoro' Neumann +# Copyright (C) 2007-2008 René 'Necoro' Neumann # This is free software. You may redistribute copies of it under the terms of # the GNU General Public License version 2. # There is NO WARRANTY, to the extent permitted by law. @@ -29,6 +29,19 @@ class CatapultPackage(Package): dbus_object = bus.get_object("org.gentoo.catapult.portage", "/org/gentoo/catapult/Package", follow_name_owner_changes = True) proxy = dbus.Interface(dbus_object, "org.gentoo.catapult.Package") + def _new_flags (self): + flags = self.get_new_use_flags() + + nflags = [] + + for flag in flags: + if flag[0] == "~": + nflags.append(flag[1:], True) + else: + nflags.append(flag, False) + + return nflags + def use_expanded (self, flag, suggest = None): if not suggest: suggest = "" @@ -80,29 +93,17 @@ class CatapultPackage(Package): if self.proxy.is_masked(self.get_cpv()): if not flags.is_locally_masked(self, changes = False): # assume that if it is locally masked, it is not masked by the system return True -# else: # more difficult: get the ones we unmasked, but are masked by the system -# try: -# masked = self._settings.settings.pmaskdict[self.get_cp()] -# except KeyError: # key error: not masked -# return False -# -# for cpv in masked: -# if self.matches(cpv): -# if not flags.is_locally_masked(self, changes = False): # assume that if it is locally masked, it is not masked by the system -# return True -# else: -# return False return False def get_masking_reason (self): return str(self.proxy.get_masking_reason(self.get_cpv())) - def get_iuse_flags (self, installed = False): - return [str(x) for x in self.proxy.get_iuse_flags(self.get_cpv(), installed)] + def get_iuse_flags (self, installed = False, removeForced = True): + return [str(x) for x in self.proxy.get_iuse_flags(self.get_cpv(), installed, removeForced)] def get_matched_dep_packages (self, depvar): - return [str(x) for x in self.proxy.get_matched_dep_packages(self.get_cpv(), self.get_new_use_flags())] + return [str(x) for x in self.proxy.get_matched_dep_packages(self.get_cpv(), self._new_flags())] def get_dep_packages (self, depvar = ["RDEPEND", "PDEPEND", "DEPEND"], with_criterions = False): pkgs = self.proxy.get_dep_packages(self.get_cpv(), depvar, self.get_new_use_flags()) @@ -112,8 +113,8 @@ class CatapultPackage(Package): else: return [(str(x),str(y)) for x,y in pkgs] - def get_global_settings(self, key): - return str(self.proxy.get_global_settings(self.get_cpv(), key)) + def get_global_settings(self, key, installed = True): + return str(self.proxy.get_global_settings(self.get_cpv(), key, installed)) def get_ebuild_path(self): return str(self.proxy.get_ebuild_path(self.get_cpv())) @@ -121,11 +122,33 @@ class CatapultPackage(Package): def get_package_settings(self, var, tree = True): return str(self.proxy.get_package_settings(self.get_cpv(), var, tree)) - def get_use_flags(self): - return " ".join(self.proxy.get_use_flags(self.get_cpv())) + def get_installed_use_flags(self): + return self.proxy.get_installed_use_flags(self.get_cpv()) + + def get_actual_use_flags(self): + return self.proxy.get_actual_use_flags(self.get_cpv(), self._new_flags()) def compare_version(self, other): return self.proxy.compare_version(self.get_cpv(), other.get_cpv()) def matches (self, criterion): return self.proxy.matches(self.get_cpv(), criterion) + + def get_files (self): + return self.proxy.get_files(self.get_cpv()) + + def get_dependencies (self): + from ...dependency import DependencyTree + d = DependencyTree() + d.add("Dependency calculation not supported for Catapult Backend") + return d + + def get_name(self): + return str(self.proxy.get_name(self.get_cpv())) + + def get_version(self): + return str(self.proxy.get_version(self.get_cpv())) + + def get_category(self): + return str(self.proxy.get_category(self.get_cpv())) + |