summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2018-11-25 21:23:22 +0100
committerJürg Billeter <j@bitron.ch>2018-11-27 13:41:09 +0000
commit69005c76c458e6d356e5208cb36af7164c6ec5b1 (patch)
tree10f0b58215f2ab8e7f56fd7ca5deb4898394359f
parentbdd6925f7cdd690f155eb62701bd05bc11c2d567 (diff)
downloadbuildstream-69005c76c458e6d356e5208cb36af7164c6ec5b1.tar.gz
scriptelement.py: Use SandboxFlags.NONE instead of 0
-rw-r--r--buildstream/scriptelement.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/buildstream/scriptelement.py b/buildstream/scriptelement.py
index d2165ce32..b03311552 100644
--- a/buildstream/scriptelement.py
+++ b/buildstream/scriptelement.py
@@ -271,14 +271,17 @@ class ScriptElement(Element):
def assemble(self, sandbox):
+ flags = SandboxFlags.NONE
+ if self.__root_read_only:
+ flags |= SandboxFlags.ROOT_READ_ONLY
+
for groupname, commands in self.__commands.items():
with self.timed_activity("Running '{}'".format(groupname)):
for cmd in commands:
self.status("Running command", detail=cmd)
# Note the -e switch to 'sh' means to exit with an error
# if any untested command fails.
- exitcode = sandbox.run(['sh', '-c', '-e', cmd + '\n'],
- SandboxFlags.ROOT_READ_ONLY if self.__root_read_only else 0)
+ exitcode = sandbox.run(['sh', '-c', '-e', cmd + '\n'], flags)
if exitcode != 0:
raise ElementError("Command '{}' failed with exitcode {}".format(cmd, exitcode),
collect=self.__install_root)