1 |
Author: zmedico |
2 |
Date: 2008-05-05 18:40:49 +0000 (Mon, 05 May 2008) |
3 |
New Revision: 10204 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/portage/dbapi/vartree.py |
7 |
Log: |
8 |
* In vardbapi.cpv_all() use catpkgsplit() for validation since that's what |
9 |
with cp_all() uses. |
10 |
* Use the listdir() dirsonly=1 parameter to avoid unnecessary stat calls |
11 |
via os.path.isdir(). |
12 |
|
13 |
|
14 |
Modified: main/trunk/pym/portage/dbapi/vartree.py |
15 |
=================================================================== |
16 |
--- main/trunk/pym/portage/dbapi/vartree.py 2008-05-05 16:55:47 UTC (rev 10203) |
17 |
+++ main/trunk/pym/portage/dbapi/vartree.py 2008-05-05 18:40:49 UTC (rev 10204) |
18 |
@@ -460,13 +460,19 @@ |
19 |
continue |
20 |
if not self._category_re.match(x): |
21 |
continue |
22 |
- for y in listdir(basepath + x, EmptyOnError=1): |
23 |
+ for y in listdir(basepath + x, EmptyOnError=1, dirsonly=1): |
24 |
if self._excluded_dirs.match(y) is not None: |
25 |
continue |
26 |
subpath = x + "/" + y |
27 |
# -MERGING- should never be a cpv, nor should files. |
28 |
- if os.path.isdir(basepath + subpath) and (pkgsplit(y) is not None): |
29 |
- returnme += [subpath] |
30 |
+ try: |
31 |
+ if catpkgsplit(subpath) is None: |
32 |
+ self.invalidentry(os.path.join(self.root, subpath)) |
33 |
+ continue |
34 |
+ except portage.exception.InvalidData: |
35 |
+ self.invalidentry(os.path.join(self.root, subpath)) |
36 |
+ continue |
37 |
+ returnme.append(subpath) |
38 |
return returnme |
39 |
|
40 |
def cp_all(self, use_cache=1): |
41 |
|
42 |
-- |
43 |
gentoo-commits@l.g.o mailing list |