Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Arfrever Frehtes Taifersar Arahesis <Arfrever@××××××.Org>, Zac Medico <zmedico@g.o>
Subject: [gentoo-portage-dev] [PATCH] make.conf: Treat __* variables as local and do not propagate them.
Date: Sun, 06 Sep 2020 01:19:53
Message-Id: 20200906011716.30730-1-zmedico@gentoo.org
1 From: Arfrever Frehtes Taifersar Arahesis <Arfrever@××××××.Org>
2
3 Bug: https://bugs.gentoo.org/740588
4 Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@××××××.Org>
5 Signed-off-by: Zac Medico <zmedico@g.o>
6 ---
7 lib/portage/package/ebuild/config.py | 6 ++++++
8 man/make.conf.5 | 4 +++-
9 2 files changed, 9 insertions(+), 1 deletion(-)
10
11 diff --git a/lib/portage/package/ebuild/config.py b/lib/portage/package/ebuild/config.py
12 index b62ad3069..a09fdbced 100644
13 --- a/lib/portage/package/ebuild/config.py
14 +++ b/lib/portage/package/ebuild/config.py
15 @@ -370,6 +370,9 @@ class config:
16 _("Found 2 make.conf files, using both '%s' and '%s'") %
17 tuple(make_conf_paths), noiselevel=-1)
18
19 + # __* variables set in make.conf are local and are not be propagated.
20 + make_conf = {k: v for k, v in make_conf.items() if not k.startswith("__")}
21 +
22 # Allow ROOT setting to come from make.conf if it's not overridden
23 # by the constructor argument (from the calling environment).
24 locations_manager.set_root_override(make_conf.get("ROOT"))
25 @@ -621,6 +624,9 @@ class config:
26 tolerant=tolerant, allow_sourcing=True,
27 expand=expand_map, recursive=True) or {})
28
29 + # __* variables set in make.conf are local and are not be propagated.
30 + mygcfg = {k: v for k, v in mygcfg.items() if not k.startswith("__")}
31 +
32 # Don't allow the user to override certain variables in make.conf
33 profile_only_variables = self.configdict["defaults"].get(
34 "PROFILE_ONLY_VARIABLES", "").split()
35 diff --git a/man/make.conf.5 b/man/make.conf.5
36 index eb812150f..914121b16 100644
37 --- a/man/make.conf.5
38 +++ b/man/make.conf.5
39 @@ -1,4 +1,4 @@
40 -.TH "MAKE.CONF" "5" "Jun 2020" "Portage VERSION" "Portage"
41 +.TH "MAKE.CONF" "5" "Sep 2020" "Portage VERSION" "Portage"
42 .SH "NAME"
43 make.conf \- custom settings for Portage
44 .SH "SYNOPSIS"
45 @@ -36,6 +36,8 @@ make.defaults to make.globals to make.conf to the environment
46 settings. Clearing these variables requires a clear\-all as in:
47 export USE="\-*"
48 .br
49 +__* variables set in make.conf are local and are not be propagated.
50 +.br
51 In order to create per\-package environment settings, refer to
52 \fBpackage.env\fR in \fBportage\fR(5).
53 .SH "VARIABLES"
54 --
55 2.25.3