Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r13144 - main/trunk/pym/portage
Date: Sun, 22 Mar 2009 22:05:49
Message-Id: E1LlVnf-0005c1-Rg@stork.gentoo.org
Author: zmedico
Date: 2009-03-22 22:05:47 +0000 (Sun, 22 Mar 2009)
New Revision: 13144

Modified:
   main/trunk/pym/portage/process.py
Log:
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?\197?\132ski <peper@g.o> for reporting.


Modified: main/trunk/pym/portage/process.py
===================================================================
--- main/trunk/pym/portage/process.py	2009-03-22 21:31:23 UTC (rev 13143)
+++ main/trunk/pym/portage/process.py	2009-03-22 22:05:47 UTC (rev 13144)
@@ -181,7 +181,8 @@
 	# 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: