summaryrefslogtreecommitdiff
path: root/src/apk.c
diff options
context:
space:
mode:
authorPaul Spooren <mail@aparcar.org>2021-12-18 17:42:13 +0100
committerTimo Teräs <timo.teras@iki.fi>2021-12-29 09:50:50 +0200
commitf2a595913960a5a68806d4e32f1b849bfdce6933 (patch)
treee792233983fddbabf9e1b73f133542bcfb4e91f9 /src/apk.c
parent2da3f347d8851f6344ea6dba47676e488084debf (diff)
downloadapk-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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/apk.c b/src/apk.c
index da5fdd7..34f5c72 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -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;