From: Zac Medico Date: Wed, 11 Mar 2009 03:21:20 +0000 (-0000) Subject: Make listdir(ignorecvs=True) ignore .git directories. Thanks to Christian X-Git-Tag: v2.1.6.8~246 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b26852ce621d0eb7fa01f0fc6f880b99f7ff1aee;p=portage.git Make listdir(ignorecvs=True) ignore .git directories. Thanks to Christian Ruppert for the suggestion. (trunk r12545) svn path=/main/branches/2.1.6/; revision=12831 --- diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index a468146ca..406f15d27 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -265,6 +265,8 @@ def cacheddir(my_original_path, ignorecvs, ignorelist, EmptyOnError, followSymli 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): """ @@ -276,7 +278,7 @@ def listdir(mypath, recursive=False, filesonly=False, ignorecvs=False, ignorelis @type recursive: Boolean @param filesonly; Only return files, not more directories @type filesonly: Boolean - @param ignorecvs: Ignore CVS directories ('CVS','.svn','SCCS') + @param ignorecvs: Ignore CVS directories ('CVS','SCCS','.svn','.git') @type ignorecvs: Boolean @param ignorelist: List of filenames/directories to exclude @type ignorelist: List @@ -303,7 +305,8 @@ def listdir(mypath, recursive=False, filesonly=False, ignorecvs=False, ignorelis if recursive: x=0 while x