From a451482790e266041fad933b652f28fe7abf1592 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 22 Jan 2009 00:51:19 +0000 Subject: [PATCH] Make listdir(ignorecvs=True) ignore .git directories. Thanks to Christian Ruppert for the suggestion. svn path=/main/trunk/; revision=12545 --- pym/portage/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 77254bad4..a3acb91d1 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