From 8821f98c7c2dafae58add0ebacaad1da60a66ae2 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Tue, 2 Aug 2016 10:17:49 +0000 Subject: builder.py: Run commands using '-e' flag in 'sh' Some failing commands in a yaml block were being ignored. For example the following commands... pre-configure-commands: - | cp nonexistent foo echo foo ... where giving the following result without making the build fail: ### PRE-CONFIGURE-COMMANDS ### + cp nonexistent foo cp: can't stat 'nonexistent': No such file or directory + echo foo foo This commit also adjusts the test-shell.c to allow the use of '-e' flag. No other changes because the shell was already failing after the first failure found. Change-Id: Ie78b25a99f1b5d6d0d26be74ddc377025dff69fd --- morphlib/builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'morphlib') diff --git a/morphlib/builder.py b/morphlib/builder.py index 0bac730c..1ad19d06 100644 --- a/morphlib/builder.py +++ b/morphlib/builder.py @@ -378,7 +378,7 @@ class ChunkBuilder(BuilderBase): stdout.flush() with open(os.devnull) as devnull: - exit_code = self.runcmd(['sh', '-x', '-c', cmd], + exit_code = self.runcmd(['sh', '-x', '-e', '-c', cmd], extra_env=extra_env, cwd=relative_builddir, stdin=devnull, -- cgit v1.2.1