diff options
author | Henrik Riomar <henrik.riomar@gmail.com> | 2017-02-03 00:37:23 +0100 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2017-02-15 13:44:04 +0200 |
commit | 349c61c9612a328f3a80f301d37aa8c14adcb43a (patch) | |
tree | fb779b62735e2cb47ed9f1d763bc1451ed19bcd9 /src/io.c | |
parent | 28a9dcda568c575c569ffa4b68775034b655230a (diff) | |
download | apk-tools-349c61c9612a328f3a80f301d37aa8c14adcb43a.tar.gz apk-tools-349c61c9612a328f3a80f301d37aa8c14adcb43a.tar.bz2 apk-tools-349c61c9612a328f3a80f301d37aa8c14adcb43a.tar.xz apk-tools-349c61c9612a328f3a80f301d37aa8c14adcb43a.zip |
add support for pre and post commit hooks
This allows for instance integration of etckeeper
[TT: Reorganized code a bit, and modified to use single
directory commit_hooks.d with argument for script of stage.]
Diffstat (limited to 'src/io.c')
-rw-r--r-- | src/io.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -741,6 +741,7 @@ int apk_dir_foreach_file(int dirfd, apk_dir_file_cb cb, void *ctx) { struct dirent *de; DIR *dir; + int ret = 0; if (dirfd < 0) return -1; @@ -759,11 +760,11 @@ int apk_dir_foreach_file(int dirfd, apk_dir_file_cb cb, void *ctx) (de->d_name[1] == '.' && de->d_name[2] == 0)) continue; } - cb(ctx, dirfd, de->d_name); + ret = cb(ctx, dirfd, de->d_name); + if (ret) break; } closedir(dir); - - return 0; + return ret; } struct apk_istream *apk_istream_from_file_gz(int atfd, const char *file) |