summaryrefslogtreecommitdiff
path: root/portato/backend
diff options
context:
space:
mode:
authorNecoro <>2008-01-14 22:14:32 +0000
committerNecoro <>2008-01-14 22:14:32 +0000
commit8c5320ff7a2be84e3260ef614059ddc6223d7f30 (patch)
tree231652506e35e01d1b4f3b451409c08bf750f838 /portato/backend
parent1f2f723d4f380055e078eb780267ad563158c65d (diff)
downloadportato-8c5320ff7a2be84e3260ef614059ddc6223d7f30.tar.gz
portato-8c5320ff7a2be84e3260ef614059ddc6223d7f30.tar.bz2
portato-8c5320ff7a2be84e3260ef614059ddc6223d7f30.zip
Diffstat (limited to '')
-rw-r--r--portato/backend/package.py9
-rw-r--r--portato/backend/portage/package.py7
2 files changed, 16 insertions, 0 deletions
diff --git a/portato/backend/package.py b/portato/backend/package.py
index 8df7dae..4f90765 100644
--- a/portato/backend/package.py
+++ b/portato/backend/package.py
@@ -330,6 +330,15 @@ class Package (_Package):
raise NotImplementedError
+ def get_files (self):
+ """
+ Returns an iterator over the installed files of a package.
+ If the package is not installed, the iterator should be "empty".
+
+ @returns: the installed files
+ @rtype: string<iterator>
+ """
+
def get_package_settings(self, var, tree = None):
"""Returns a package specific setting, such as DESCRIPTION, SRC_URI, IUSE ...
diff --git a/portato/backend/portage/package.py b/portato/backend/portage/package.py
index 0c8e5f1..845cc0b 100644
--- a/portato/backend/portage/package.py
+++ b/portato/backend/portage/package.py
@@ -263,6 +263,13 @@ class PortagePackage (Package):
def get_ebuild_path(self):
return self._settings.porttree.dbapi.findname(self._cpv)
+ def get_files (self):
+ if self.is_installed():
+ path = os.path.join(self.get_global_settings("ROOT"), portage.VDB_PATH, self.get_cpv(), "CONTENTS")
+ with open(path) as f:
+ for line in f:
+ yield line.split()[1].strip()
+
def get_package_settings(self, var, tree = None):
if not tree:
mytree = self._settings.vartree