Ignore files (such as metadata.xml) within portdir category dirs.
authorJason Stubbs <jstubbs@gentoo.org>
Thu, 29 Sep 2005 16:41:34 +0000 (16:41 -0000)
committerJason Stubbs <jstubbs@gentoo.org>
Thu, 29 Sep 2005 16:41:34 +0000 (16:41 -0000)
svn path=/main/branches/2.0/; revision=2059

pym/portage.py

index 8da8712bc2ba5544c5c4f97ce00b6ec824d55bae..0c399295c12ed1db21f3d7671121d33b32a6f78b 100644 (file)
@@ -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()