Files
meta-external-toolchain/conf/distro/include/external-run.inc
Christopher Larson 6ffb77e4c9 external-run: use debug messages, not warnings
While these messages are useful when debugging, the warnings clutter up the
log due to running before our sanity checks, potentially confusing the user.

Signed-off-by: Christopher Larson <kergoth@gmail.com>
2015-04-20 13:16:10 -07:00

25 lines
906 B
C++

def external_run(d, cmd, *args):
import subprocess
topdir = d.getVar('TMPDIR', True)
toolchain_path = d.getVar('EXTERNAL_TOOLCHAIN', True)
if toolchain_path:
target_prefix = d.getVar('EXTERNAL_TARGET_SYS', True) + '-'
path = os.path.join(toolchain_path, 'bin', target_prefix + cmd)
args = [path] + list(args)
try:
output = oe.path.check_output(args, cwd=topdir, stderr=subprocess.STDOUT)
except oe.path.CalledProcessError as exc:
import pipes
bb.debug(1, "{0} failed: {1}".format(' '.join(pipes.quote(a) for a in args), exc.output))
except OSError as exc:
import pipes
bb.debug(1, "{0} failed: {1}".format(' '.join(pipes.quote(a) for a in args), str(exc)))
else:
return output
return 'UNKNOWN'
external_run[vardepsexclude] += "EXTERNAL_TOOLCHAIN TMPDIR"