summaryrefslogtreecommitdiff
path: root/buildstream/buildelement.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-02-23 01:31:18 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-02-23 01:31:18 +0900
commit9164dbb5c375d586343361cfa4aacb6f489ba0ec (patch)
tree1ca94918c2840aebcab4a91bcfe1b1012b55d5ce /buildstream/buildelement.py
parent84638c30f713ef7c3ffca8cfb072c7cfaf47c794 (diff)
downloadbuildstream-9164dbb5c375d586343361cfa4aacb6f489ba0ec.tar.gz
build-element.bst: Append newline to build commands run in sandbox
They are loaded with stripped whitespace, but when launching the command sometimes having a newline can make a difference (especially when doing cat > file << EOF ... EOF, the final EOF must have a newline)
Diffstat (limited to 'buildstream/buildelement.py')
-rw-r--r--buildstream/buildelement.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/buildstream/buildelement.py b/buildstream/buildelement.py
index f753bdb9b..3e7335b37 100644
--- a/buildstream/buildelement.py
+++ b/buildstream/buildelement.py
@@ -102,7 +102,7 @@ class BuildElement(Element):
# Note the -e switch to 'sh' means to exit with an error
# if any untested command fails.
#
- exitcode, _, _ = sandbox.run(['sh', '-c', '-e', cmd])
+ exitcode, _, _ = sandbox.run(['sh', '-c', '-e', cmd + '\n'])
if exitcode != 0:
raise ElementError("Command '{}' failed with exitcode {}".format(cmd, exitcode))