Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9368 - main/trunk/pym/portage/dbapi
Date: Fri, 22 Feb 2008 23:53:12
Message-Id: E1JShhV-0000bD-8B@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-02-22 23:53:08 +0000 (Fri, 22 Feb 2008)
3 New Revision: 9368
4
5 Modified:
6 main/trunk/pym/portage/dbapi/porttree.py
7 Log:
8 Revert portdbapi category auto-detection code since it's not really needed
9 and can cause problems if we need to add new non-category directories in
10 the future. We only really need the category auto-detection for bindbapi and
11 vardbapi anyway.
12
13
14 Modified: main/trunk/pym/portage/dbapi/porttree.py
15 ===================================================================
16 --- main/trunk/pym/portage/dbapi/porttree.py 2008-02-22 22:20:50 UTC (rev 9367)
17 +++ main/trunk/pym/portage/dbapi/porttree.py 2008-02-22 23:53:08 UTC (rev 9368)
18 @@ -27,9 +27,6 @@
19 class portdbapi(dbapi):
20 """this tree will scan a portage directory located at root (passed to init)"""
21 portdbapi_instances = []
22 - _non_category_dirs = ["distfiles", "eclass", "licenses",
23 - "local", "metadata", "packages", "profiles", "scripts"]
24 - _non_category_dirs = re.compile(r'^(%s)$' % "|".join(_non_category_dirs))
25 def __init__(self, porttree_root, mysettings=None):
26 portdbapi.portdbapi_instances.append(self)
27
28 @@ -39,6 +36,7 @@
29 else:
30 from portage import settings
31 self.mysettings = config(clone=settings)
32 + self._categories = set(self.mysettings.categories)
33 # This is strictly for use in aux_get() doebuild calls when metadata
34 # is generated by the depend phase. It's safest to use a clone for
35 # this purpose because doebuild makes many changes to the config
36 @@ -486,11 +484,8 @@
37 def cp_all(self):
38 "returns a list of all keys in our tree"
39 d = {}
40 - for oroot in self.porttrees:
41 - for x in listdir(oroot, EmptyOnError=1, ignorecvs=1, dirsonly=1):
42 - if not self._category_re.match(x) or \
43 - self._non_category_dirs.match(x):
44 - continue
45 + for x in self.mysettings.categories:
46 + for oroot in self.porttrees:
47 for y in listdir(oroot+"/"+x, EmptyOnError=1, ignorecvs=1, dirsonly=1):
48 if not self._pkg_dir_name_re.match(y) or \
49 y == "CVS":
50 @@ -520,7 +515,7 @@
51 self.xcache["match-all"][mycp] = cachelist
52 return cachelist[:]
53 mysplit = mycp.split("/")
54 - invalid_category = not self._category_re.match(mysplit[0])
55 + invalid_category = mysplit[0] not in self._categories
56 d={}
57 if mytree:
58 mytrees = [mytree]
59
60 --
61 gentoo-commits@l.g.o mailing list