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 3242F1382C5 for ; Mon, 22 Feb 2021 05:32:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3DD3DE085A; Mon, 22 Feb 2021 05:32:04 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 263A9E085A for ; Mon, 22 Feb 2021 05:32:04 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B4115340F13 for ; Mon, 22 Feb 2021 05:32:02 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E48BB4DC for ; Mon, 22 Feb 2021 05:32:00 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1613971613.784d2c19f2d62982db16af9055bdab6b595a661b.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/package/ebuild/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/package/ebuild/config.py X-VCS-Directories: lib/portage/package/ebuild/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 784d2c19f2d62982db16af9055bdab6b595a661b X-VCS-Branch: master Date: Mon, 22 Feb 2021 05:32:00 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ae844d1d-db3b-42c0-b707-df5522e340fb X-Archives-Hash: 5d90df8c08d1f6b07be8bc5e8999ec27 commit: 784d2c19f2d62982db16af9055bdab6b595a661b Author: Zac Medico gentoo org> AuthorDate: Fri Feb 19 05:51:43 2021 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Feb 22 05:26:53 2021 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=784d2c19 make.defaults: prevent USE="${USE} ..." misbehavior 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} ..." settings at the top of make.defaults which caused parent profile USE to override parent profile package.use settings. Note that would be nice to guard the USE_EXPAND variables like this too, but unfortunately USE_EXPAND is not known until after make.defaults has been evaluated, so that will require some form of make.defaults preprocessing. Bug: https://bugs.gentoo.org/771549 Signed-off-by: Zac Medico gentoo.org> lib/portage/package/ebuild/config.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/portage/package/ebuild/config.py b/lib/portage/package/ebuild/config.py index e5ec681af..690efde9d 100644 --- a/lib/portage/package/ebuild/config.py +++ b/lib/portage/package/ebuild/config.py @@ -612,9 +612,20 @@ 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. + # It would be nice to guard USE_EXPAND variables like + # this too, but unfortunately USE_EXPAND is not known + # until after make.defaults has been evaluated, so that + # will require some form of make.defaults preprocessing. + 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)