Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9536 - main/branches/2.1.2/pym
Date: Fri, 28 Mar 2008 09:46:47
Message-Id: E1JfBAa-0005kx-SB@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-03-28 09:46:43 +0000 (Fri, 28 Mar 2008)
3 New Revision: 9536
4
5 Modified:
6 main/branches/2.1.2/pym/portage.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. (trunk r9368)
12
13
14 Modified: main/branches/2.1.2/pym/portage.py
15 ===================================================================
16 --- main/branches/2.1.2/pym/portage.py 2008-03-28 09:43:03 UTC (rev 9535)
17 +++ main/branches/2.1.2/pym/portage.py 2008-03-28 09:46:43 UTC (rev 9536)
18 @@ -6814,9 +6814,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 @@ -6825,6 +6822,7 @@
29 else:
30 global 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 @@ -7268,11 +7266,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 @@ -7302,7 +7297,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