diff options
author | Tristan Maat <tristan.maat@codethink.com> | 2017-06-23 10:39:19 +0100 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-06-28 14:40:04 +0900 |
commit | 33cd809df40a6acec43564c90b478e7eace752fb (patch) | |
tree | 19e60312b2dd821904b54d67013c0573698da2e1 /buildstream/buildelement.py | |
parent | 042390bd85a6fae2f38c26166ecf23730c4e4156 (diff) | |
download | buildstream-33cd809df40a6acec43564c90b478e7eace752fb.tar.gz |
buildelement.py: Implement generate_script
Diffstat (limited to 'buildstream/buildelement.py')
-rwxr-xr-x[-rw-r--r--] | buildstream/buildelement.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/buildstream/buildelement.py b/buildstream/buildelement.py index 35e3c3b02..f6d1df3b0 100644..100755 --- a/buildstream/buildelement.py +++ b/buildstream/buildelement.py @@ -208,3 +208,15 @@ class BuildElement(Element): commands.append(command) return commands + + def generate_script(self): + script = "" + for step in _command_steps: + for prefix in _command_prefixes: + command_name = prefix + step + commands = self.commands[command_name] + + for cmd in commands: + script += "(set -e; {}\n) || exit 1\n".format(cmd) + + return script |