summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-03-28 09:46:43 +0000
committerZac Medico <zmedico@gentoo.org>2008-03-28 09:46:43 +0000
commit2e7fd2222063a5390af350958080940d5a4ba71a (patch)
tree59705ccf3e3f9a66468ffe20b9d4007ab235db99 /pym
parentc775fab794d9b17d9c6820d6a5b6b4a770bf152e (diff)
downloadportage-2e7fd2222063a5390af350958080940d5a4ba71a.tar.gz
portage-2e7fd2222063a5390af350958080940d5a4ba71a.tar.bz2
portage-2e7fd2222063a5390af350958080940d5a4ba71a.zip
Revert portdbapi category auto-detection code since it's not really needed
and can cause problems if we need to add new non-category directories in the future. We only really need the category auto-detection for bindbapi and vardbapi anyway. (trunk r9368) svn path=/main/branches/2.1.2/; revision=9536
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/pym/portage.py b/pym/portage.py
index d2edcf0f1..4b3df78eb 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -6814,9 +6814,6 @@ def close_portdbapi_caches():
class portdbapi(dbapi):
"""this tree will scan a portage directory located at root (passed to init)"""
portdbapi_instances = []
- _non_category_dirs = ["distfiles", "eclass", "licenses",
- "local", "metadata", "packages", "profiles", "scripts"]
- _non_category_dirs = re.compile(r'^(%s)$' % "|".join(_non_category_dirs))
def __init__(self,porttree_root,mysettings=None):
portdbapi.portdbapi_instances.append(self)
@@ -6825,6 +6822,7 @@ class portdbapi(dbapi):
else:
global settings
self.mysettings = config(clone=settings)
+ self._categories = set(self.mysettings.categories)
# This is strictly for use in aux_get() doebuild calls when metadata
# is generated by the depend phase. It's safest to use a clone for
# this purpose because doebuild makes many changes to the config
@@ -7268,11 +7266,8 @@ class portdbapi(dbapi):
def cp_all(self):
"returns a list of all keys in our tree"
d={}
- for oroot in self.porttrees:
- for x in listdir(oroot, EmptyOnError=1, ignorecvs=1, dirsonly=1):
- if not self._category_re.match(x) or \
- self._non_category_dirs.match(x):
- continue
+ for x in self.mysettings.categories:
+ for oroot in self.porttrees:
for y in listdir(oroot+"/"+x, EmptyOnError=1, ignorecvs=1, dirsonly=1):
if not self._pkg_dir_name_re.match(y) or \
y == "CVS":
@@ -7302,7 +7297,7 @@ class portdbapi(dbapi):
self.xcache["match-all"][mycp] = cachelist
return cachelist[:]
mysplit = mycp.split("/")
- invalid_category = not self._category_re.match(mysplit[0])
+ invalid_category = mysplit[0] not in self._categories
d={}
if mytree:
mytrees = [mytree]