1 |
On Sun, Oct 18, 2020 at 11:12 AM Felix Bier |
2 |
<Felix.Bier@×××××××××××××.com> wrote: |
3 |
> This commit adds deep copying operations when initializing config |
4 |
> objects from a default config. This prevents the config from being |
5 |
> a shallow copy of the default, ensuring that modifications to the |
6 |
> config do not modify the default. |
7 |
> |
8 |
> In particular, this fixes a check in write_make_conf, where the PORTDIR |
9 |
> variable is only written to the generated make.conf when a non-default |
10 |
> repo_basedir is set in /etc/catalyst/catalyst.conf. This check is never |
11 |
> satisfied, because confvalues is a shallow copy of confdefaults, |
12 |
> therefore both will always hold the same value for repo_basedir. |
13 |
> |
14 |
> For self.mounts / MOUNT_DEFAULTS this problem can also be observed, the |
15 |
> modifications done to self.mounts are also visible in MOUNT_DEFAULTS. |
16 |
> I am not aware of any bugs due to this shallow copy, but I would prefer |
17 |
> adding a deep copy to prevent future bugs, in case a comparision |
18 |
> against the default mounts is ever needed. |
19 |
|
20 |
Nice! Thanks. |