1 |
Author: zmedico |
2 |
Date: 2008-05-05 18:42:13 +0000 (Mon, 05 May 2008) |
3 |
New Revision: 10205 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.2/pym/portage.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 |
(trunk r10204) |
13 |
|
14 |
|
15 |
Modified: main/branches/2.1.2/pym/portage.py |
16 |
=================================================================== |
17 |
--- main/branches/2.1.2/pym/portage.py 2008-05-05 18:40:49 UTC (rev 10204) |
18 |
+++ main/branches/2.1.2/pym/portage.py 2008-05-05 18:42:13 UTC (rev 10205) |
19 |
@@ -6726,13 +6726,19 @@ |
20 |
continue |
21 |
if not self._category_re.match(x): |
22 |
continue |
23 |
- for y in listdir(basepath+x,EmptyOnError=1): |
24 |
+ for y in listdir(basepath + x, EmptyOnError=1, dirsonly=1): |
25 |
if self._excluded_dirs.match(y) is not None: |
26 |
continue |
27 |
- subpath = x+"/"+y |
28 |
+ subpath = x + "/" + y |
29 |
# -MERGING- should never be a cpv, nor should files. |
30 |
- if os.path.isdir(basepath+subpath) and (pkgsplit(y) is not None): |
31 |
- returnme += [subpath] |
32 |
+ try: |
33 |
+ if catpkgsplit(subpath) is None: |
34 |
+ self.invalidentry(os.path.join(self.root, subpath)) |
35 |
+ continue |
36 |
+ except portage_exception.InvalidData: |
37 |
+ self.invalidentry(os.path.join(self.root, subpath)) |
38 |
+ continue |
39 |
+ returnme.append(subpath) |
40 |
return returnme |
41 |
|
42 |
def cp_all(self,use_cache=1): |
43 |
|
44 |
-- |
45 |
gentoo-commits@l.g.o mailing list |