From e89b9526a8e77f0ce6f730bff29e2236a5928f6e Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 13 Jul 2018 15:19:29 -0700 Subject: [PATCH] portdbapi.findname2: avoid os.access call (bug 650814) Bug: https://bugs.gentoo.org/650814 --- pym/portage/dbapi/porttree.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 3e36024ff..24e3f49bf 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -495,8 +495,12 @@ class portdbapi(dbapi): relative_path = mysplit[0] + _os.sep + psplit[0] + _os.sep + \ mysplit[1] + ".ebuild" + skip_access = myrepo is not None and myrepo is getattr(mycpv, 'repo', None) + for x in mytrees: filename = x + _os.sep + relative_path + if skip_access: + return (filename, x) if _os.access(_unicode_encode(filename, encoding=encoding, errors=errors), _os.R_OK): return (filename, x) @@ -644,7 +648,7 @@ class portdbapi(dbapi): future.set_exception(PortageKeyError(mycpv)) return future - myebuild, mylocation = self.findname2(mycpv, mytree) + myebuild, mylocation = self.findname2(mycpv, mytree=mytree, myrepo=myrepo) if not myebuild: writemsg("!!! aux_get(): %s\n" % \ -- 2.13.6