summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-20 14:21:25 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-20 14:21:25 +0000
commitbc77fbb7e0812d5d5561ff46c3da9c3a2fdeeb60 (patch)
tree942dd46423a462d6a66cd88a51b4cb917e6c0e60 /pym
parent77376663481712ce7ebf5fb0d13bc55ec37e0299 (diff)
downloadportage-bc77fbb7e0812d5d5561ff46c3da9c3a2fdeeb60.tar.gz
portage-bc77fbb7e0812d5d5561ff46c3da9c3a2fdeeb60.tar.bz2
portage-bc77fbb7e0812d5d5561ff46c3da9c3a2fdeeb60.zip
Filter out some non-category directories in portdbapi.cp_all().
svn path=/main/trunk/; revision=8993
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dbapi/porttree.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 4b66b6125..083485472 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -21,13 +21,14 @@ import portage.gpg, portage.checksum
from portage import eclass_cache, auxdbkeys, auxdbkeylen, doebuild, flatten, \
listdir, dep_expand, eapi_is_supported, key_expand, dep_check
-import os, stat, sys
+import os, re, stat, sys
from itertools import izip
class portdbapi(dbapi):
"""this tree will scan a portage directory located at root (passed to init)"""
portdbapi_instances = []
-
+ _non_category_dirs = re.compile(r'(%s)^$' % \
+ "|".join(["eclass", "profiles", "scripts"]))
def __init__(self, porttree_root, mysettings=None):
portdbapi.portdbapi_instances.append(self)
@@ -487,7 +488,8 @@ class portdbapi(dbapi):
d = {}
for oroot in self.porttrees:
for x in listdir(oroot, EmptyOnError=1, ignorecvs=1, dirsonly=1):
- if not self._category_re.match(x):
+ if not self._category_re.match(x) or \
+ self._non_category_dirs.match(x):
continue
for y in listdir(oroot+"/"+x, EmptyOnError=1, ignorecvs=1, dirsonly=1):
d[x+"/"+y] = None