Gentoo Archives: gentoo-catalyst

From: Matt Turner <mattst88@g.o>
To: gentoo-catalyst@l.g.o
Subject: Re: [gentoo-catalyst] Re: [PATCH 1/2] Ensure deep copying of config defaults
Date: Fri, 30 Oct 2020 15:57:14
Message-Id: CAEdQ38HZPEwJN1f82fgCOgJ9B3839HkVrXayNF2duAMEQAcP5w@mail.gmail.com
In Reply to: [gentoo-catalyst] Re: [PATCH 1/2] Ensure deep copying of config defaults by Felix Bier
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.

Replies

Subject Author
Re: [Newsletter] Re: [gentoo-catalyst] Re: [PATCH 1/2] Ensure deep copying of config defaults Felix Bier <Felix.Bier@×××××××××××××.com>