diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2012-12-30 01:08:50 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2012-12-30 01:08:50 +0200 |
commit | 9f7e1bd826ebce0cab45b9e8c490150a0afd85fc (patch) | |
tree | 5f7fbe5f84f519eb8c8c6391559800ecfd522582 /shellgenerator.py | |
parent | a455780ccf5c6615b7ff7449129654d47795be8e (diff) | |
download | meson-9f7e1bd826ebce0cab45b9e8c490150a0afd85fc.zip meson-9f7e1bd826ebce0cab45b9e8c490150a0afd85fc.tar.gz meson-9f7e1bd826ebce0cab45b9e8c490150a0afd85fc.tar.bz2 |
Bail out if any command fails.
Diffstat (limited to 'shellgenerator.py')
-rwxr-xr-x | shellgenerator.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/shellgenerator.py b/shellgenerator.py index e4317a7..3333dd3 100755 --- a/shellgenerator.py +++ b/shellgenerator.py @@ -32,6 +32,7 @@ class ShellGenerator(): outfile.write('#!/bin/sh\n\n') outfile.write('echo This is an autogenerated shell script build file for project \\"%s\\".\n' % self.interpreter.get_project()) + outfile.write('echo This is experimental and most likely will not work!\n') self.generate_commands(outfile) outfile.close() os.chmod(outfilename, stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC |\ @@ -58,9 +59,9 @@ class ShellGenerator(): commands.append(abs_src) commands += compiler.get_output_flags() commands.append(abs_obj) - quoted = environment.shell_quote(commands) + ['\n'] + quoted = environment.shell_quote(commands) outfile.write('\necho Compiling \\"%s\\"\n' % src) - outfile.write(' '.join(quoted)) + outfile.write(' '.join(quoted) + ' || exit\n') return abs_obj def generate_link(self, target, outfile, outname, obj_list): @@ -72,9 +73,9 @@ class ShellGenerator(): commands += dep.get_link_flags() commands += linker.get_output_flags() commands.append(outname) - quoted = environment.shell_quote(commands) + ['\n'] + quoted = environment.shell_quote(commands) outfile.write('\necho Linking \\"%s\\".\n' % outname) - outfile.write(' '.join(quoted)) + outfile.write(' '.join(quoted) + ' || exit\n') def generate_commands(self, outfile): for i in self.interpreter.get_executables().items(): |