From 98dd424c0a71e186e8ceb119afa433925d0c687f Mon Sep 17 00:00:00 2001 From: Jason Stubbs Date: Thu, 29 Sep 2005 16:41:34 +0000 Subject: [PATCH] Ignore files (such as metadata.xml) within portdir category dirs. svn path=/main/branches/2.0/; revision=2059 --- pym/portage.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pym/portage.py b/pym/portage.py index 8da8712bc..0c399295c 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -272,7 +272,7 @@ def cacheddir(my_original_path, ignorecvs, ignorelist, EmptyOnError, followSymli def listdir(mypath, recursive=False, filesonly=False, ignorecvs=False, ignorelist=[], followSymlinks=True, - EmptyOnError=False): + EmptyOnError=False, dirsonly=False): list, ftype = cacheddir(mypath, ignorecvs, ignorelist, EmptyOnError, followSymlinks) @@ -302,6 +302,11 @@ def listdir(mypath, recursive=False, filesonly=False, ignorecvs=False, ignorelis for x in range(0,len(ftype)): if ftype[x]==0: rlist=rlist+[list[x]] + elif dirsonly: + rlist = [] + for x in range(0, len(ftype)): + if ftype[x] == 1: + rlist = rlist + [list[x]] else: rlist=list @@ -5547,8 +5552,7 @@ class portdbapi(dbapi): d={} for x in self.mysettings.categories: for oroot in self.porttrees: - for y in listdir(oroot+"/"+x,EmptyOnError=1,ignorecvs=1): - mykey=x+"/"+y + for y in listdir(oroot+"/"+x,EmptyOnError=1,ignorecvs=1,dirsonly=1): d[x+"/"+y] = None l = d.keys() l.sort() -- 2.26.2