public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] make.defaults: prevent USE="${USE} ..." misbehavior
@ 2021-02-19  6:12 Zac Medico
  0 siblings, 0 replies; only message in thread
From: Zac Medico @ 2021-02-19  6:12 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

Discard parent profile USE from the expand_map variable before
it is used to evaluate a child profile. This prevents accidents
triggered by USE="${USE} ..." settngs at the top of make.defaults
which caused parent profile USE to override parent profile
package.use settings.

Bug: https://bugs.gentoo.org/771549
Signed-off-by: Zac Medico <zmedico@gentoo.org>
---
 lib/portage/package/ebuild/config.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/lib/portage/package/ebuild/config.py b/lib/portage/package/ebuild/config.py
index e5ec681af..638c72959 100644
--- a/lib/portage/package/ebuild/config.py
+++ b/lib/portage/package/ebuild/config.py
@@ -612,9 +612,16 @@ class config:
 
 			mygcfg = {}
 			if profiles_complex:
-				mygcfg_dlists = [getconfig(os.path.join(x.location, "make.defaults"),
-					tolerant=tolerant, expand=expand_map, recursive=x.portage1_directories)
-					for x in profiles_complex]
+				mygcfg_dlists = []
+				for x in profiles_complex:
+					# Prevent accidents triggered by USE="${USE} ..." settings
+					# at the top of make.defaults which caused parent profile
+					# USE to override parent profile package.use settings.
+					expand_map.pop("USE", None)
+					mygcfg_dlists.append(
+						getconfig(os.path.join(x.location, "make.defaults"),
+						tolerant=tolerant, expand=expand_map,
+						recursive=x.portage1_directories))
 				self._make_defaults = mygcfg_dlists
 				mygcfg = stack_dicts(mygcfg_dlists,
 					incrementals=self.incrementals)
-- 
2.26.2



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-19  6:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-19  6:12 [gentoo-portage-dev] [PATCH] make.defaults: prevent USE="${USE} ..." misbehavior Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox