From a701b884a9ec299351d431cbfaa68b858d9158d0 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 22 Mar 2009 22:05:47 +0000 Subject: [PATCH] =?utf8?q?Inside=20spawn(),=20avoid=20redundant=20os.acces?= =?utf8?q?s()=20and=20stat()=20calls=20on=20commonly=20spawned=20binaries?= =?utf8?q?=20such=20as=20BASH=5FBINARY,=20SANDBOX=5FBINARY,=20and=20FAKERO?= =?utf8?q?OT=5FBINARY.=20Thanks=20to=20Piotr=20Jaroszy=C5=84ski=20=20for=20reporting.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit svn path=/main/trunk/; revision=13144 --- pym/portage/process.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pym/portage/process.py b/pym/portage/process.py index 6f449c3d6..a88f5bf28 100644 --- a/pym/portage/process.py +++ b/pym/portage/process.py @@ -181,7 +181,8 @@ def spawn(mycommand, env={}, opt_name=None, fd_pipes=None, returnpid=False, # If an absolute path to an executable file isn't given # search for it unless we've been told not to. binary = mycommand[0] - if (not os.path.isabs(binary) or not os.path.isfile(binary) + if binary not in (BASH_BINARY, SANDBOX_BINARY, FAKEROOT_BINARY) and \ + (not os.path.isabs(binary) or not os.path.isfile(binary) or not os.access(binary, os.X_OK)): binary = path_lookup and find_binary(binary) or None if not binary: -- 2.26.2