forked from Mirror/pmbootstrap
Make pmb.helpers.run.root support non-timeout output modes (MR 1996)
Before this commit, pmb.helpers.run_core.sanity_checks would raise a runtime error when pmb.helpers.run.root was called with an output mode that did not support timeouts (like background).
This commit is contained in:
parent
de175bfb1f
commit
82d149c85d
3 changed files with 15 additions and 3 deletions
|
@ -73,5 +73,9 @@ def root(args, cmd, working_dir=None, output="log", output_return=False,
|
|||
if env:
|
||||
cmd = ["sh", "-c", flat_cmd(cmd, env=env)]
|
||||
cmd = ["sudo"] + cmd
|
||||
|
||||
# pmbootstrap shall use 'sudo kill' to get rid of timed out programs
|
||||
kill_as_root = output in pmb.config.run_outputs_with_timeout or None
|
||||
|
||||
return user(args, cmd, working_dir, output, output_return, check, env,
|
||||
True)
|
||||
kill_as_root)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue