copy: Support both inode exclusion and contents exclusion
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 20 Feb 2023 19:30:44 +0000 (20:30 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 22 Feb 2023 11:44:36 +0000 (12:44 +0100)
commitb63bd125d4fb8ad1905d6c7dc4d87033ecf8148c
treeb49e4ae1f36c310a56a33579742294ab38bb5882
parent5ab863be51ba8a700c30f9d7b4f42ca82836263a
copy: Support both inode exclusion and contents exclusion

In some cases, we want to exclude a directory's contents but not
the directory itself. In other cases, we want to exclude a directory
and its contents. Let's extend the denylist logic in copy.h to support
both by changing the denylist from a set to hashmap so we can store the
deny type as the value.

We also modify the repart ExcludeFiles= option to make use of this. If
a directory to exclude ends with a "/", we'll only exclude its contents.
Otherwise, we'll exclude the full directory.
man/repart.d.xml
src/partition/repart.c
src/shared/copy.c
src/shared/copy.h
src/test/test-copy.c
test/units/testsuite-58.sh