forked from Mirror/pmbootstrap
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:
parent
46789ccee8
commit
20a0ccf36f
8 changed files with 54 additions and 48 deletions
|
@ -5,6 +5,7 @@ import os
|
|||
import logging
|
||||
|
||||
import pmb.helpers.run
|
||||
import pmb.helpers.run_core
|
||||
import pmb.parse.apkindex
|
||||
import pmb.config.pmaports
|
||||
import pmb.build
|
||||
|
@ -29,7 +30,7 @@ def scp_abuild_key(args, user, host, port):
|
|||
keyname = os.path.join("/tmp", os.path.basename(key))
|
||||
remote_cmd = ['sudo', '-p', pmb.config.sideload_sudo_prompt,
|
||||
'-S', 'mv', '-n', keyname, "/etc/apk/keys/"]
|
||||
remote_cmd = pmb.helpers.run.flat_cmd(remote_cmd)
|
||||
remote_cmd = pmb.helpers.run_core.flat_cmd(remote_cmd)
|
||||
command = ['ssh', '-t', '-p', port, f'{user}@{host}', remote_cmd]
|
||||
pmb.helpers.run.user(args, command, output="tui")
|
||||
|
||||
|
@ -53,8 +54,8 @@ def ssh_install_apks(args, user, host, port, paths):
|
|||
logging.info(f"Installing packages at {user}@{host}")
|
||||
add_cmd = ['sudo', '-p', pmb.config.sideload_sudo_prompt,
|
||||
'-S', 'apk', '--wait', '30', 'add'] + remote_paths
|
||||
add_cmd = pmb.helpers.run.flat_cmd(add_cmd)
|
||||
clean_cmd = pmb.helpers.run.flat_cmd(['rm'] + remote_paths)
|
||||
add_cmd = pmb.helpers.run_core.flat_cmd(add_cmd)
|
||||
clean_cmd = pmb.helpers.run_core.flat_cmd(['rm'] + remote_paths)
|
||||
command = ['ssh', '-t', '-p', port, f'{user}@{host}',
|
||||
f'{add_cmd}; rc=$?; {clean_cmd}; exit $rc']
|
||||
pmb.helpers.run.user(args, command, output="tui")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue