apk: add --force-no-chroot option

[TT: reoder changes to alphabetically sorted locations]

Signed-off-by: Paul Spooren <mail@aparcar.org>
cute-signatures
Paul Spooren 2021-12-09 07:17:42 -10:00 committed by Timo Teräs
parent 70fe7b121a
commit 2da3f347d8
2 changed files with 9 additions and 0 deletions

View File

@ -120,6 +120,11 @@ The following options are available for all commands.
*--force-broken-world*
Continue even if _world_ cannot be satisfied.
*--force-no-chroot*
Disable chroot for scripts. This can be used for rootfs creation when
chroot is not available. Scripts running outside a chroot environment
may modify and damage the host system.
*--force-non-repository*
Continue even if packages may be lost on reboot. This can happen when
running in run-from-tmpfs mode, and installing non-repository package.

View File

@ -62,6 +62,7 @@ static void version(struct apk_out *out, const char *prefix)
OPT(OPT_GLOBAL_force, APK_OPT_SH("f") "force") \
OPT(OPT_GLOBAL_force_binary_stdout, "force-binary-stdout") \
OPT(OPT_GLOBAL_force_broken_world, "force-broken-world") \
OPT(OPT_GLOBAL_force_no_chroot, "force-no-chroot") \
OPT(OPT_GLOBAL_force_non_repository, "force-non-repository") \
OPT(OPT_GLOBAL_force_old_apk, "force-old-apk") \
OPT(OPT_GLOBAL_force_overwrite, "force-overwrite") \
@ -142,6 +143,9 @@ static int option_parse_global(void *ctx, struct apk_ctx *ac, int opt, const cha
case OPT_GLOBAL_force_refresh:
ac->force |= APK_FORCE_REFRESH;
break;
case OPT_GLOBAL_force_no_chroot:
ac->flags |= APK_NO_CHROOT;
break;
case OPT_GLOBAL_force_non_repository:
ac->force |= APK_FORCE_NON_REPOSITORY;
break;