summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-08-02 10:17:49 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-08-02 14:25:25 +0000
commit8821f98c7c2dafae58add0ebacaad1da60a66ae2 (patch)
tree83697801693fa39bc6d172ebed4727fab779ebf1 /scripts
parent9fc92c1403e374d78712db852fb4342f770162fb (diff)
downloadmorph-8821f98c7c2dafae58add0ebacaad1da60a66ae2.tar.gz
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
Diffstat (limited to 'scripts')
-rw-r--r--scripts/test-shell.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/test-shell.c b/scripts/test-shell.c
index a57fddce..22aa86f9 100644
--- a/scripts/test-shell.c
+++ b/scripts/test-shell.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2015 Codethink Limited
+/* Copyright (C) 2014-2016 Codethink Limited
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -201,16 +201,17 @@ int run_commands(FILE *cmdstream){
}
int main(int argc, char *argv[]) {
- if (argc == 4 && strcmp(argv[1], "-x") == 0 \
- && strcmp(argv[2], "-c") == 0) {
- size_t cmdlen = strlen(argv[3]);
- FILE *cmdstream = fmemopen(argv[3], cmdlen, "r");
+ if (argc == 5 && strcmp(argv[1], "-x") == 0 \
+ && strcmp(argv[2], "-e") == 0 \
+ && strcmp(argv[3], "-c") == 0) {
+ size_t cmdlen = strlen(argv[4]);
+ FILE *cmdstream = fmemopen(argv[4], cmdlen, "r");
return run_commands(cmdstream);
} else if (argc == 2) {
FILE *cmdstream = fopen(argv[1], "r");
return run_commands(cmdstream);
} else {
- fprintf(stderr, "Usage: %s -x -c COMMAND|%s SCRIPT\n",
+ fprintf(stderr, "Usage: %s -x -e -c COMMAND|%s SCRIPT\n",
argv[0], argv[0]);
return 1;
}