From bc77fbb7e0812d5d5561ff46c3da9c3a2fdeeb60 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 20 Dec 2007 14:21:25 +0000 Subject: [PATCH] Filter out some non-category directories in portdbapi.cp_all(). svn path=/main/trunk/; revision=8993 --- pym/portage/dbapi/porttree.py | 8 +++++--- 1 file 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 -- 2.26.2