diff options
author | Li Guifu <bluce.lee@aliyun.com> | 2020-02-18 22:30:47 +0800 |
---|---|---|
committer | Gao Xiang <gaoxiang25@huawei.com> | 2020-02-21 09:40:50 +0800 |
commit | acd5f76653d0b455de537a271dca93ddc1c4f2e3 (patch) | |
tree | e48343cb2c3f6e122df39f60e581b9f61ffebf83 /include/erofs/exclude.h | |
parent | 622be103825c406226c7aa38e76b7b02268075f9 (diff) | |
download | erofs-utils-acd5f76653d0b455de537a271dca93ddc1c4f2e3.tar.gz |
erofs-utils: introduce exclude dirs and files
Add excluded file feature "--exclude-path=" and '--exclude-regex=',
which can be used to build EROFS image without some user specific
files or dirs.
The implementation is kept as simple as possible for now.
Note that you may give multiple '--exclude-path' and '--exclude-regex'
options.
Signed-off-by: Li Guifu <bluce.lee@aliyun.com>
Link: https://lore.kernel.org/r/20200219022056.GA56477@architecture4
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Diffstat (limited to 'include/erofs/exclude.h')
-rw-r--r-- | include/erofs/exclude.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/erofs/exclude.h b/include/erofs/exclude.h new file mode 100644 index 0000000..88c55d7 --- /dev/null +++ b/include/erofs/exclude.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * erofs-utils/include/erofs/exclude.h + * + * Created by Li Guifu <bluce.lee@aliyun.com> + */ +#ifndef __EROFS_EXCLUDE_H +#define __EROFS_EXCLUDE_H + +#include <sys/types.h> +#include <regex.h> + +struct erofs_exclude_rule { + struct list_head list; + + char *pattern; + regex_t reg; +}; + +void erofs_exclude_set_root(const char *rootdir); +void erofs_cleanup_exclude_rules(void); + +int erofs_parse_exclude_path(const char *args, bool is_regex); +struct erofs_exclude_rule *erofs_is_exclude_path(const char *dir, + const char *name); +#endif + |