diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-03-23 02:20:42 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-03-23 02:20:42 +0000 |
commit | 62cbda66a40db1282cd9d8acae201b31c2ed1dfb (patch) | |
tree | 85467007d326995c504775c85d8dc2b1d559b41b | |
parent | e0f6e327a88b649d54f450193946ca28bee43f25 (diff) | |
download | portage-62cbda66a40db1282cd9d8acae201b31c2ed1dfb.tar.gz portage-62cbda66a40db1282cd9d8acae201b31c2ed1dfb.tar.bz2 portage-62cbda66a40db1282cd9d8acae201b31c2ed1dfb.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. (trunk r13144)
svn path=/main/branches/2.1.6/; revision=13161
-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: |