diff options
author | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2015-07-31 13:25:50 +0000 |
---|---|---|
committer | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2015-08-12 16:40:52 +0000 |
commit | c5cb1b57cab30d089ad577f89a82e83a6d487d4f (patch) | |
tree | 4ddca03b76217f32e4677e3b9af8871d9966fefa /morphlib | |
parent | 2cf830f7df706cab0042481e772b1bd6f4f8ab8a (diff) | |
download | morph-c5cb1b57cab30d089ad577f89a82e83a6d487d4f.tar.gz |
Use the shell X-ray mode
Instead of logging every command for ourselves, use the shell X-ray
mode. As side effect, each command argument will now be printed out in
its evaluated form, which aids debugging.
Also, improve the visual separation between the different build steps,
and display those steps with finer granularity.
Change-Id: I16ebe9ba4ac46fef82e37d0b3e05f42d14249de8
Diffstat (limited to 'morphlib')
-rw-r--r-- | morphlib/builder.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/morphlib/builder.py b/morphlib/builder.py index 4f6f2194..39af4146 100644 --- a/morphlib/builder.py +++ b/morphlib/builder.py @@ -350,7 +350,7 @@ class ChunkBuilder(BuilderBase): with open(logfilepath, 'a') as log: self.app.status(msg='Running %(key)s', key=key) - log.write('# %s\n' % step) + log.write('### %s ###\n' % key.upper()) for cmd in cmds: if cmd is False: cmd = "false" @@ -365,9 +365,6 @@ class ChunkBuilder(BuilderBase): extra_env['MAKEFLAGS'] = '-j1' try: - with open(logfilepath, 'a') as log: - log.write('# # %s\n' % cmd) - # flushing is needed because writes from python and # writes from being the output in Popen have different # buffers, but flush handles both @@ -375,7 +372,7 @@ class ChunkBuilder(BuilderBase): stdout.flush() with open(os.devnull) as devnull: - self.runcmd(['sh', '-c', cmd], + self.runcmd(['sh', '-x', '-c', cmd], extra_env=extra_env, cwd=relative_builddir, stdin=devnull, |