diff options
author | Jürg Billeter <j@bitron.ch> | 2018-11-25 21:23:22 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2018-11-25 21:23:22 +0100 |
commit | 7cfce23a7e22300dcdb53937932693b92c823fcf (patch) | |
tree | f373de11c18387e11c142bcd09ee0da4ab0c9bae | |
parent | a2585457ae9fd85881cd3a153ad21d09f1fd1c7d (diff) | |
download | buildstream-7cfce23a7e22300dcdb53937932693b92c823fcf.tar.gz |
scriptelement.py: Use SandboxFlags.NONE instead of 0
-rw-r--r-- | buildstream/scriptelement.py | 7 |
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) |