summaryrefslogtreecommitdiff
path: root/src/commit.c
diff options
context:
space:
mode:
authorHenrik Riomar <henrik.riomar@gmail.com>2017-12-29 21:10:44 +0100
committerTimo Teräs <timo.teras@iki.fi>2018-01-03 14:20:58 +0200
commit23cb10477537a2bbf40ac06a61046f75f2b160c5 (patch)
tree2a9f983f1e03ee1becb32783b57bf5e90fb2e9c8 /src/commit.c
parent99e7bb93dfff2f43987b81ce7600ad8fbd0ce64c (diff)
downloadapk-tools-23cb10477537a2bbf40ac06a61046f75f2b160c5.tar.gz
apk-tools-23cb10477537a2bbf40ac06a61046f75f2b160c5.tar.bz2
apk-tools-23cb10477537a2bbf40ac06a61046f75f2b160c5.tar.xz
apk-tools-23cb10477537a2bbf40ac06a61046f75f2b160c5.zip
add new flag --no-commit-hooks
This flag skips running hook scripts This flag *must* be used during initramfs tmpfs initial install. The reason that this new flag is needed is that the hooks will currently always fail as musl and /bin/sh is missing at this stage on diskless.
Diffstat (limited to 'src/commit.c')
-rw-r--r--src/commit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/commit.c b/src/commit.c
index 0c0bb34..af49f5c 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -236,6 +236,10 @@ static int run_commit_hook(void *ctx, int dirfd, const char *file)
return 0;
snprintf(fn, sizeof(fn), "etc/apk/commit_hooks.d" "/%s", file);
+ if ((apk_flags & APK_NO_COMMIT_HOOKS) != 0) {
+ apk_message("Skipping: %s %s", fn, commit_hook_str[hook->type]);
+ return 0;
+ }
if (apk_verbosity >= 2) apk_message("Executing: %s %s", fn, commit_hook_str[hook->type]);
if (apk_db_run_script(db, fn, argv) < 0 && hook->type == PRE_COMMIT_HOOK)