summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-02-05 22:30:26 +0000
committerZac Medico <zmedico@gentoo.org>2010-02-05 22:30:26 +0000
commit5424a4cd309737d9fc218f6e1d884db0a34efa48 (patch)
treeca5746b91197285ea098248fd3f2b8932628557e /pym
parent1f1535974e10416903ca56edde83b791c2113bd1 (diff)
downloadportage-5424a4cd309737d9fc218f6e1d884db0a34efa48.tar.gz
portage-5424a4cd309737d9fc218f6e1d884db0a34efa48.tar.bz2
portage-5424a4cd309737d9fc218f6e1d884db0a34efa48.zip
Add an optional 'categories' parameter to portdbapi.cp_all(), for listing
a subset of categories. Thanks to dol-sen for the suggestion. svn path=/main/trunk/; revision=15323
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dbapi/porttree.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 4cf7d410d..cf7eeac7f 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -889,10 +889,12 @@ class portdbapi(dbapi):
else:
return 0
- def cp_all(self):
+ def cp_all(self, categories=None):
"returns a list of all keys in our tree"
d = {}
- for x in self.settings.categories:
+ if categories is None:
+ categories = self.settings.categories
+ for x in categories:
for oroot in self.porttrees:
for y in listdir(oroot+"/"+x, EmptyOnError=1, ignorecvs=1, dirsonly=1):
if not self._pkg_dir_name_re.match(y) or \