From: Matt Turner <mattst88@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Subject: Re: [gentoo-catalyst] Re: [PATCH 1/2] Ensure deep copying of config defaults
Date: Fri, 30 Oct 2020 11:56:57 -0400 [thread overview]
Message-ID: <CAEdQ38HZPEwJN1f82fgCOgJ9B3839HkVrXayNF2duAMEQAcP5w@mail.gmail.com> (raw)
In-Reply-To: <4de1aa0c362394a606752503533b2346ffabff2e.camel@rohde-schwarz.com>
On Sun, Oct 18, 2020 at 11:12 AM Felix Bier
<Felix.Bier@rohde-schwarz.com> wrote:
> This commit adds deep copying operations when initializing config
> objects from a default config. This prevents the config from being
> a shallow copy of the default, ensuring that modifications to the
> config do not modify the default.
>
> In particular, this fixes a check in write_make_conf, where the PORTDIR
> variable is only written to the generated make.conf when a non-default
> repo_basedir is set in /etc/catalyst/catalyst.conf. This check is never
> satisfied, because confvalues is a shallow copy of confdefaults,
> therefore both will always hold the same value for repo_basedir.
>
> For self.mounts / MOUNT_DEFAULTS this problem can also be observed, the
> modifications done to self.mounts are also visible in MOUNT_DEFAULTS.
> I am not aware of any bugs due to this shallow copy, but I would prefer
> adding a deep copy to prevent future bugs, in case a comparision
> against the default mounts is ever needed.
Nice! Thanks.
next prev parent reply other threads:[~2020-10-30 15:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-17 18:47 [gentoo-catalyst] [PATCH 1/2] Ensure deep copying of config defaults Felix Bier
2020-10-18 15:12 ` [gentoo-catalyst] " Felix Bier
2020-10-30 15:56 ` Matt Turner [this message]
2020-11-10 0:59 ` [Newsletter] " Felix Bier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEdQ38HZPEwJN1f82fgCOgJ9B3839HkVrXayNF2duAMEQAcP5w@mail.gmail.com \
--to=mattst88@gentoo.org \
--cc=gentoo-catalyst@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox