pmb: sideload: wait for apk database lock

When installing the APK wait for a while for the APK database lock,
services like apk-polkit-server sometimes hog it for a while but there's
no point bailing out immediately.

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20221111212251.1360612-1-kc@postmarketos.org%3E
This commit is contained in:
Caleb Connolly 2022-11-11 21:22:51 +00:00 committed by Oliver Smith
parent 4a6c5657d5
commit ab0aa7f956
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -52,7 +52,7 @@ def ssh_install_apks(args, user, host, port, paths):
logging.info(f"Installing packages at {user}@{host}") logging.info(f"Installing packages at {user}@{host}")
add_cmd = ['sudo', '-p', pmb.config.sideload_sudo_prompt, add_cmd = ['sudo', '-p', pmb.config.sideload_sudo_prompt,
'-S', 'apk', 'add'] + remote_paths '-S', 'apk', '--wait', '30', 'add'] + remote_paths
add_cmd = pmb.helpers.run.flat_cmd(add_cmd) add_cmd = pmb.helpers.run.flat_cmd(add_cmd)
clean_cmd = pmb.helpers.run.flat_cmd(['rm'] + remote_paths) clean_cmd = pmb.helpers.run.flat_cmd(['rm'] + remote_paths)
command = ['ssh', '-t', '-p', port, f'{user}@{host}', command = ['ssh', '-t', '-p', port, f'{user}@{host}',