From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 55648138359 for ; Fri, 30 Oct 2020 15:57:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7F914E0871; Fri, 30 Oct 2020 15:57:13 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 668CBE0871 for ; Fri, 30 Oct 2020 15:57:13 +0000 (UTC) Received: by mail-ej1-f54.google.com with SMTP id o9so7211907ejg.1 for ; Fri, 30 Oct 2020 08:57:12 -0700 (PDT) X-Gm-Message-State: AOAM533SuLcNESEAcU8m+V2NhX9mkmunSCNUeqFZk6Wn54oHk1O7iXg/ SU+RO3yobm8eb/YOjhQQnOD9CsAq4CFGReQLmR0= X-Google-Smtp-Source: ABdhPJwiJUMdXM5lk/m6dgMM6VYDSpum9DYxzYpInpj9Dfw86od/uNpwoTFdee9TXs8NVeBOVt8TSET2hsT4/DvS7fY= X-Received: by 2002:a17:906:14d1:: with SMTP id y17mr3213229ejc.15.1604073429521; Fri, 30 Oct 2020 08:57:09 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 References: <65e99c4f47f284937ab5b4acc4b10b999b44b0cf.camel@rohde-schwarz.com> <4de1aa0c362394a606752503533b2346ffabff2e.camel@rohde-schwarz.com> In-Reply-To: <4de1aa0c362394a606752503533b2346ffabff2e.camel@rohde-schwarz.com> From: Matt Turner Date: Fri, 30 Oct 2020 11:56:57 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [gentoo-catalyst] Re: [PATCH 1/2] Ensure deep copying of config defaults To: gentoo-catalyst@lists.gentoo.org Content-Type: text/plain; charset="UTF-8" X-Archives-Salt: c07fd251-c3e6-4476-98fa-1dc0a026072e X-Archives-Hash: ac1b553542c807cfec0c6272a8e59ab4 On Sun, Oct 18, 2020 at 11:12 AM Felix Bier 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.