icecc: Use bb.utils.which instead of calling which

The icecc class often calls 'which' for determining paths. This leads
to many messages on stderr in case 'which' doesn't find the
executable. Using bb.utils.which is more appropriate here and doesn't
pollute stderr.

(From OE-Core rev: 7ed7aa38182ce8c7300a08e3aefcc65da2b524a8)

Signed-off-by: Tobias Henkel <tobias.henkel@bmw-carit.de>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Tobias Henkel
2013-11-15 08:36:41 +01:00
committed by Richard Purdie
parent f2ed8fa276
commit 17c155b9c3

View File

@@ -55,7 +55,7 @@ def get_cross_kernel_cc(bb,d):
return kernel_cc
def get_icecc(d):
return d.getVar('ICECC_PATH') or os.popen("which icecc").read()[:-1]
return d.getVar('ICECC_PATH') or bb.utils.which(os.getenv("PATH"), "icecc")
def create_path(compilers, bb, d):
"""
@@ -175,9 +175,9 @@ def icc_get_external_tool(bb, d, tool):
def icc_get_tool(bb, d, tool):
if icc_is_native(bb, d):
return os.popen("which %s" % tool).read()[:-1]
return bb.utils.which(os.getenv("PATH"), tool)
elif icc_is_kernel(bb, d):
return os.popen("which %s" % get_cross_kernel_cc(bb, d)).read()[:-1]
return bb.utils.which(os.getenv("PATH"), get_cross_kernel_cc(bb, d))
else:
ice_dir = d.expand('${STAGING_BINDIR_TOOLCHAIN}')
target_sys = d.expand('${TARGET_SYS}')