repart: Don't descend into directories assigned to other partitions
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 23 Sep 2022 19:15:01 +0000 (21:15 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 10 Nov 2022 15:40:33 +0000 (16:40 +0100)
commitc0fad2d9b60eed5a1cb3c51848a2b57f77699000
tree1192832eb236b27f5999653f142313c572cd9cbc
parent58b4ad76ca91309a570ae4811e90b8d7b8a09777
repart: Don't descend into directories assigned to other partitions

Let's say we have the following repart definitions files root.conf
and home.conf:

```
[Partition]
Type=root
CopyFiles=/
```

```
[Partition]
Type=home
CopyFiles=/home
```

Currently, we'd end up copying /home to both the root partition and
the home partition. To prevent this from happening, let's adopt a
new policy when copying files for a partition: We won't copy any
files/directories that appear in the CopyFiles= list of another
partition, unless that directory explicitly appears in our own
CopyFiles= list.

This way, we prevent copying /home twice into the root and home
partition, but should a user really want that behavior, they can
have it by adding /home to the CopyFIles= list of the root partition
as well.
src/partition/repart.c