public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Zac Medico <zmedico@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Cc: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>,
	Zac Medico <zmedico@gentoo.org>
Subject: [gentoo-portage-dev] [PATCH] make.conf: Treat __* variables as local and do not propagate them.
Date: Sat,  5 Sep 2020 18:17:16 -0700	[thread overview]
Message-ID: <20200906011716.30730-1-zmedico@gentoo.org> (raw)

From: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>

Bug: https://bugs.gentoo.org/740588
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Signed-off-by: Zac Medico <zmedico@gentoo.org>
---
 lib/portage/package/ebuild/config.py | 6 ++++++
 man/make.conf.5                      | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/portage/package/ebuild/config.py b/lib/portage/package/ebuild/config.py
index b62ad3069..a09fdbced 100644
--- a/lib/portage/package/ebuild/config.py
+++ b/lib/portage/package/ebuild/config.py
@@ -370,6 +370,9 @@ class config:
 					_("Found 2 make.conf files, using both '%s' and '%s'") %
 					tuple(make_conf_paths), noiselevel=-1)
 
+			# __* variables set in make.conf are local and are not be propagated.
+			make_conf = {k: v for k, v in make_conf.items() if not k.startswith("__")}
+
 			# Allow ROOT setting to come from make.conf if it's not overridden
 			# by the constructor argument (from the calling environment).
 			locations_manager.set_root_override(make_conf.get("ROOT"))
@@ -621,6 +624,9 @@ class config:
 					tolerant=tolerant, allow_sourcing=True,
 					expand=expand_map, recursive=True) or {})
 
+			# __* variables set in make.conf are local and are not be propagated.
+			mygcfg = {k: v for k, v in mygcfg.items() if not k.startswith("__")}
+
 			# Don't allow the user to override certain variables in make.conf
 			profile_only_variables = self.configdict["defaults"].get(
 				"PROFILE_ONLY_VARIABLES", "").split()
diff --git a/man/make.conf.5 b/man/make.conf.5
index eb812150f..914121b16 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "Jun 2020" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "Sep 2020" "Portage VERSION" "Portage"
 .SH "NAME"
 make.conf \- custom settings for Portage
 .SH "SYNOPSIS"
@@ -36,6 +36,8 @@ make.defaults to make.globals to make.conf to the environment
 settings.  Clearing these variables requires a clear\-all as in:
 export USE="\-*"
 .br
+__* variables set in make.conf are local and are not be propagated.
+.br
 In order to create per\-package environment settings, refer to
 \fBpackage.env\fR in \fBportage\fR(5).
 .SH "VARIABLES"
-- 
2.25.3



                 reply	other threads:[~2020-09-06  1:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200906011716.30730-1-zmedico@gentoo.org \
    --to=zmedico@gentoo.org \
    --cc=Arfrever@Apache.Org \
    --cc=gentoo-portage-dev@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