From b637566020abe184cdda199d640c636a7565a05c Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Sun, 6 Aug 2023 21:35:58 +0200 Subject: tar2sqfs: Add option to exclude files Using --exclude or -E it is now possible to exclude files from the input tar stream. The options can be used multiple times. Signed-off-by: Richard Weinberger --- bin/tar2sqfs/src/tar2sqfs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bin/tar2sqfs/src/tar2sqfs.c') diff --git a/bin/tar2sqfs/src/tar2sqfs.c b/bin/tar2sqfs/src/tar2sqfs.c index ed671f5..ae8b548 100644 --- a/bin/tar2sqfs/src/tar2sqfs.c +++ b/bin/tar2sqfs/src/tar2sqfs.c @@ -8,9 +8,10 @@ int main(int argc, char **argv) { - int status = EXIT_FAILURE; sqfs_istream_t *input_file = NULL; + tar_iterator_opts topts = { 0 }; dir_iterator_t *tar = NULL; + int status = EXIT_FAILURE; sqfs_writer_t sqfs; int ret; @@ -22,7 +23,10 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - tar = tar_open_stream(input_file); + topts.excludedirs = excludedirs; + topts.num_excludedirs = num_excludedirs; + + tar = tar_open_stream(input_file, &topts); sqfs_drop(input_file); if (tar == NULL) { fputs("Creating tar stream: out-of-memory\n", stderr); -- cgit v1.2.3