Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10192 - main/trunk/pym/portage/dbapi
Date: Mon, 05 May 2008 04:44:33
Message-Id: E1JssYx-0000BP-CF@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-05-05 04:44:30 +0000 (Mon, 05 May 2008)
3 New Revision: 10192
4
5 Modified:
6 main/trunk/pym/portage/dbapi/vartree.py
7 Log:
8 Bug #220171 - Filter out 'lost+found' directories in vardbapi.cpv_all()
9 in order to avoid fatal 'Permission denied' errors. Currently, CVS and
10 names beginning with '.' are also filtered.
11
12
13 Modified: main/trunk/pym/portage/dbapi/vartree.py
14 ===================================================================
15 --- main/trunk/pym/portage/dbapi/vartree.py 2008-05-05 03:31:40 UTC (rev 10191)
16 +++ main/trunk/pym/portage/dbapi/vartree.py 2008-05-05 04:44:30 UTC (rev 10192)
17 @@ -223,6 +223,12 @@
18 return rValue
19
20 class vardbapi(dbapi):
21 +
22 + _excluded_dirs = ["CVS", "lost+found"]
23 + _excluded_dirs = [re.escape(x) for x in _excluded_dirs]
24 + _excluded_dirs = re.compile(r'^(\..*|' + \
25 + "|".join(_excluded_dirs) + r')$')
26 +
27 def __init__(self, root, categories=None, settings=None, vartree=None):
28 """
29 The categories parameter is unused since the dbapi class
30 @@ -443,10 +449,12 @@
31 returnme = []
32 basepath = os.path.join(self.root, VDB_PATH) + os.path.sep
33 for x in listdir(basepath, EmptyOnError=1, ignorecvs=1, dirsonly=1):
34 + if self._excluded_dirs.match(x) is not None:
35 + continue
36 if not self._category_re.match(x):
37 continue
38 for y in listdir(basepath + x, EmptyOnError=1):
39 - if y.startswith("."):
40 + if self._excluded_dirs.match(y) is not None:
41 continue
42 subpath = x + "/" + y
43 # -MERGING- should never be a cpv, nor should files.
44
45 --
46 gentoo-commits@l.g.o mailing list