summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/devtool/__init__.py')
-rw-r--r--scripts/lib/devtool/__init__.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index 88665124d1..5a06c78b57 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -44,13 +44,14 @@ def exec_build_env_command(init_path, builddir, cmd, watch=False, **options):
44 if watch: 44 if watch:
45 if sys.stdout.isatty(): 45 if sys.stdout.isatty():
46 # Fool bitbake into thinking it's outputting to a terminal (because it is, indirectly) 46 # Fool bitbake into thinking it's outputting to a terminal (because it is, indirectly)
47 cmd = 'script -q -c "%s" /dev/null' % cmd 47 cmd = 'script -e -q -c "%s" /dev/null' % cmd
48 return exec_watch('%s%s' % (init_prefix, cmd), **options) 48 return exec_watch('%s%s' % (init_prefix, cmd), **options)
49 else: 49 else:
50 return bb.process.run('%s%s' % (init_prefix, cmd), **options) 50 return bb.process.run('%s%s' % (init_prefix, cmd), **options)
51 51
52def exec_watch(cmd, **options): 52def exec_watch(cmd, **options):
53 """Run program with stdout shown on sys.stdout""" 53 """Run program with stdout shown on sys.stdout"""
54 import bb
54 if isinstance(cmd, basestring) and not "shell" in options: 55 if isinstance(cmd, basestring) and not "shell" in options:
55 options["shell"] = True 56 options["shell"] = True
56 57
@@ -67,7 +68,11 @@ def exec_watch(cmd, **options):
67 buf += out 68 buf += out
68 elif out == '' and process.poll() != None: 69 elif out == '' and process.poll() != None:
69 break 70 break
70 return buf 71
72 if process.returncode != 0:
73 raise bb.process.ExecutionError(cmd, process.returncode, buf, None)
74
75 return buf, None
71 76
72def setup_tinfoil(): 77def setup_tinfoil():
73 """Initialize tinfoil api from bitbake""" 78 """Initialize tinfoil api from bitbake"""