Skip to content
Snippets Groups Projects
Unverified Commit ac099f2b authored by Casey's avatar Casey :recycle:
Browse files

helpers: apk: sanity check final command


When running "apk add" we must always have --cache-dir set! We also
expect --no-interactive to be set.

Add some asserts so we don't regress here.

Signed-off-by: default avatarCaleb Connolly <caleb@postmarketos.org>
parent 5efcc944
No related branches found
No related tags found
No related merge requests found
Pipeline #209103 failed
......@@ -204,6 +204,12 @@ def run(command: Sequence[PathString], chroot: Chroot, with_progress=True):
"""
_command = _prepare_cmd(command, chroot)
# Sanity checks. We should avoid accidentally writing to
# /var/cache/apk on the host!
if "add" in command:
assert "--no-interactive" in _command
assert "--cache-dir" in _command
if with_progress:
_apk_with_progress(_command)
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment