pmb.helpers.run_core: fix sudo timer when not using sudo

pmb.config.sudo expects a list of commands + args, so when a string is
passed (e.g. "true"), it results in pmb trying to execute the equivalent
of "$ t r u e":

(8/119) Installing linux-purism-librem5 (6.3.4-r0)

doas: t: command not found
doas: t: command not found
doas: t: command not found
doas: t: command not found

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230613141929.15718-1-clayton@craftyguy.net%3E
This commit is contained in:
Clayton Craft 2023-06-13 07:19:29 -07:00 committed by Oliver Smith
parent 7671353158
commit d6c6e70933
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 1 additions and 1 deletions

View File

@ -230,7 +230,7 @@ def sudo_timer_iterate():
if pmb.config.which_sudo() == "sudo":
subprocess.Popen(["sudo", "-v"]).wait()
else:
subprocess.Popen(pmb.config.sudo("true")).wait()
subprocess.Popen(pmb.config.sudo(["true"])).wait()
timer = threading.Timer(interval=60, function=sudo_timer_iterate)
timer.daemon = True