diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-03-22 22:05:47 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-03-22 22:05:47 +0000 |
commit | a701b884a9ec299351d431cbfaa68b858d9158d0 (patch) | |
tree | d7dae5ae7f73cf7a07130e55a46f228a4e6dcc4b | |
parent | 66a25ee0b933016d5ffdb96326bb15cd1ef7b6b9 (diff) | |
download | portage-a701b884a9ec299351d431cbfaa68b858d9158d0.tar.gz portage-a701b884a9ec299351d431cbfaa68b858d9158d0.tar.bz2 portage-a701b884a9ec299351d431cbfaa68b858d9158d0.zip |
Inside spawn(), avoid redundant os.access() and stat() calls on commonly
spawned binaries such as BASH_BINARY, SANDBOX_BINARY, and FAKEROOT_BINARY.
Thanks to Piotr JaroszyĆski <peper@g.o> for reporting.
svn path=/main/trunk/; revision=13144
-rw-r--r-- | pym/portage/process.py | 3 |
1 files changed, 2 insertions, 1 deletions
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: |