Make portdbapi.cp_list() use os.listdir() instead of
authorZac Medico <zmedico@gentoo.org>
Mon, 29 Oct 2007 00:08:28 +0000 (00:08 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 29 Oct 2007 00:08:28 +0000 (00:08 -0000)
portage.listdir() since portage.listdir() has unnecessary
overhead and it's cache isn't needed since cp_list() has
it's own cache.

svn path=/main/trunk/; revision=8336

pym/portage/dbapi/porttree.py

index 84f8c196dd36116eaf3c7a0b5874feacd4fa9e6b..ec38e0850dfc6a0c36462ee83454d13671734a6f 100644 (file)
@@ -511,7 +511,11 @@ class portdbapi(dbapi):
                else:
                        mytrees = self.porttrees
                for oroot in mytrees:
-                       for x in listdir(oroot+"/"+mycp, EmptyOnError=1, ignorecvs=1):
+                       try:
+                               file_list = os.listdir(os.path.join(oroot, mycp))
+                       except OSError:
+                               continue
+                       for x in file_list:
                                if x.endswith(".ebuild"):
                                        pf = x[:-7]
                                        ps = pkgsplit(pf)