1 |
Author: zmedico |
2 |
Date: 2010-02-05 22:30:26 +0000 (Fri, 05 Feb 2010) |
3 |
New Revision: 15323 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/portage/dbapi/porttree.py |
7 |
Log: |
8 |
Add an optional 'categories' parameter to portdbapi.cp_all(), for listing |
9 |
a subset of categories. Thanks to dol-sen for the suggestion. |
10 |
|
11 |
|
12 |
Modified: main/trunk/pym/portage/dbapi/porttree.py |
13 |
=================================================================== |
14 |
--- main/trunk/pym/portage/dbapi/porttree.py 2010-02-04 23:00:41 UTC (rev 15322) |
15 |
+++ main/trunk/pym/portage/dbapi/porttree.py 2010-02-05 22:30:26 UTC (rev 15323) |
16 |
@@ -889,10 +889,12 @@ |
17 |
else: |
18 |
return 0 |
19 |
|
20 |
- def cp_all(self): |
21 |
+ def cp_all(self, categories=None): |
22 |
"returns a list of all keys in our tree" |
23 |
d = {} |
24 |
- for x in self.settings.categories: |
25 |
+ if categories is None: |
26 |
+ categories = self.settings.categories |
27 |
+ for x in categories: |
28 |
for oroot in self.porttrees: |
29 |
for y in listdir(oroot+"/"+x, EmptyOnError=1, ignorecvs=1, dirsonly=1): |
30 |
if not self._pkg_dir_name_re.match(y) or \ |