pmb.helpers.run_core: move flat_cmd here

Move pmb.helpers.run.flat_cmd to run_core, as it will be used by
pmb.helpers.run_core.core in the next patch.

Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230713182337.6185-2-ollieparanoid@postmarketos.org%3E
This commit is contained in:
Oliver Smith 2023-07-13 20:19:47 +02:00
parent 46789ccee8
commit 20a0ccf36f
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
8 changed files with 54 additions and 48 deletions

View file

@ -7,6 +7,7 @@ import pmb_test # noqa
import pmb.chroot.root
import pmb.chroot.user
import pmb.helpers.run
import pmb.helpers.run_core
import pmb.helpers.logging
@ -79,7 +80,7 @@ def test_shell_escape_env(args):
def test_flat_cmd_simple():
func = pmb.helpers.run.flat_cmd
func = pmb.helpers.run_core.flat_cmd
cmd = ["echo", "test"]
working_dir = None
ret = "echo test"
@ -88,7 +89,7 @@ def test_flat_cmd_simple():
def test_flat_cmd_wrap_shell_string_with_spaces():
func = pmb.helpers.run.flat_cmd
func = pmb.helpers.run_core.flat_cmd
cmd = ["echo", "string with spaces"]
working_dir = None
ret = "echo 'string with spaces'"
@ -97,7 +98,7 @@ def test_flat_cmd_wrap_shell_string_with_spaces():
def test_flat_cmd_wrap_env_simple():
func = pmb.helpers.run.flat_cmd
func = pmb.helpers.run_core.flat_cmd
cmd = ["echo", "test"]
working_dir = None
ret = "JOBS=5 echo test"
@ -106,7 +107,7 @@ def test_flat_cmd_wrap_env_simple():
def test_flat_cmd_wrap_env_spaces():
func = pmb.helpers.run.flat_cmd
func = pmb.helpers.run_core.flat_cmd
cmd = ["echo", "test"]
working_dir = None
ret = "JOBS=5 TEST='spaces string' echo test"