forked from Mirror/pmbootstrap
Don't use 'sudo' when running as root
This cancels the need to install and configure `sudo` or `doas` on single-user installations (e.g.: a VM dedicated to running pmbootstrap). Fixes: https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2224 Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org> Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230529203922.22161-1-hugo@whynothugo.nl%3E
This commit is contained in:
parent
27618d5ffd
commit
d31313f7dc
5 changed files with 30 additions and 10 deletions
|
@ -72,7 +72,7 @@ def root(args, cmd, working_dir=None, output="log", output_return=False,
|
|||
"""
|
||||
if env:
|
||||
cmd = ["sh", "-c", flat_cmd(cmd, env=env)]
|
||||
cmd = [pmb.config.sudo] + cmd
|
||||
cmd = pmb.config.sudo(cmd)
|
||||
|
||||
return user(args, cmd, working_dir, output, output_return, check, env,
|
||||
True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue