portage.listdir(), and do the same for update_config_files().
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import codecs
'remove_slot',
'portage.util:ConfigProtect,grabfile,new_protect_filename,' + \
'normalize_path,write_atomic,writemsg',
+ 'portage.util.listdir:_ignorecvs_dirs',
'portage.versions:ververify'
)
except UnicodeDecodeError:
dirs.remove(y_enc)
continue
- if y.startswith("."):
+ if y.startswith(".") or y in _ignorecvs_dirs:
dirs.remove(y_enc)
for y in files:
try:
-# Copyright 2004-2009 Gentoo Foundation
+# Copyright 2004-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
__all__ = ['apply_permissions', 'apply_recursive_permissions',
import traceback
import portage
+portage.proxy.lazyimport.lazyimport(globals(),
+ 'portage.util.listdir:_ignorecvs_dirs'
+)
from portage import StringIO
from portage import os
from portage import pickle
def grablines(myfilename,recursive=0):
mylines=[]
if recursive and os.path.isdir(myfilename):
- if os.path.basename(myfilename) in ["RCS", "CVS", "SCCS"]:
+ if os.path.basename(myfilename) in _ignorecvs_dirs:
return mylines
dirlist = os.listdir(myfilename)
dirlist.sort()
from portage.exception import DirectoryNotFound, PermissionDenied, PortageException
from portage.util import normalize_path, writemsg
+_ignorecvs_dirs = ('CVS', 'RCS', 'SCCS', '.svn', '.git')
dircache = {}
cacheHit = 0
cacheMiss = 0
writemsg("cacheddirStats: H:%d/M:%d/S:%d\n" % (cacheHit, cacheMiss, cacheStale),10)
return ret_list, ret_ftype
-_ignorecvs_dirs = ('CVS', 'SCCS', '.svn', '.git')
-
def listdir(mypath, recursive=False, filesonly=False, ignorecvs=False, ignorelist=[], followSymlinks=True,
EmptyOnError=False, dirsonly=False):
"""