diff options
author | Paul Spooren <mail@aparcar.org> | 2021-12-18 17:42:13 +0100 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2021-12-29 09:50:50 +0200 |
commit | f2a595913960a5a68806d4e32f1b849bfdce6933 (patch) | |
tree | e792233983fddbabf9e1b73f133542bcfb4e91f9 /src/apk.c | |
parent | 2da3f347d8851f6344ea6dba47676e488084debf (diff) | |
download | apk-tools-f2a595913960a5a68806d4e32f1b849bfdce6933.tar.gz apk-tools-f2a595913960a5a68806d4e32f1b849bfdce6933.tar.bz2 apk-tools-f2a595913960a5a68806d4e32f1b849bfdce6933.tar.xz apk-tools-f2a595913960a5a68806d4e32f1b849bfdce6933.zip |
apk: add --preserve-env option
This options is useful for (post)install scripts to run with the same
environment variables as apk is executed.
[TT: minor stylistic changes]
Signed-off-by: Paul Spooren <mail@aparcar.org>
Diffstat (limited to 'src/apk.c')
-rw-r--r-- | src/apk.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -74,6 +74,7 @@ static void version(struct apk_out *out, const char *prefix) OPT(OPT_GLOBAL_no_logfile, "no-logfile") \ OPT(OPT_GLOBAL_no_network, "no-network") \ OPT(OPT_GLOBAL_no_progress, "no-progress") \ + OPT(OPT_GLOBAL_preserve_env, "preserve-env") \ OPT(OPT_GLOBAL_print_arch, "print-arch") \ OPT(OPT_GLOBAL_progress, "progress") \ OPT(OPT_GLOBAL_progress_fd, APK_OPT_ARG "progress-fd") \ @@ -155,6 +156,9 @@ static int option_parse_global(void *ctx, struct apk_ctx *ac, int opt, const cha case OPT_GLOBAL_interactive: ac->flags |= APK_INTERACTIVE; break; + case OPT_GLOBAL_preserve_env: + ac->flags |= APK_PRESERVE_ENV; + break; case OPT_GLOBAL_progress: ac->progress.out = &ac->out; break; |