From: Zac Medico Date: Mon, 29 Oct 2007 00:08:28 +0000 (-0000) Subject: Make portdbapi.cp_list() use os.listdir() instead of X-Git-Tag: v2.2_pre1~487 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=58ae97c54525b1572f2c96ad81f28bca69b8edc2;p=portage.git Make portdbapi.cp_list() use os.listdir() instead of 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 --- diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 84f8c196d..ec38e0850 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -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)