Occasionally people put a setting like USE="${USE} foo" a the top of make.defaults, and that pulls USE from the parent profile into the current profile, which can cause unexpected override of parent profile package.use. We can guard against this if we remove the parent profile's USE setting from the expand_map variable.
Patch posted for review: https://archives.gentoo.org/gentoo-portage-dev/message/10b2115ed7f1c42f36ec45108a5f4e20 https://github.com/gentoo/portage/pull/670
It would be nice to guard the USE_EXPAND variables like this too, but USE_EXPAND is not known until after make.defaults is evaluated.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=784d2c19f2d62982db16af9055bdab6b595a661b commit 784d2c19f2d62982db16af9055bdab6b595a661b Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2021-02-19 05:51:43 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2021-02-22 05:26:53 +0000 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 <zmedico@gentoo.org> lib/portage/package/ebuild/config.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6b98e103aa15da331d647a8f65a45bb3bb4e3197 commit 6b98e103aa15da331d647a8f65a45bb3bb4e3197 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2021-02-22 13:46:04 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2021-02-22 13:54:29 +0000 sys-apps/portage: Bump to version 3.0.15 #715112 default enable FEATURES=binpkg-multi-instance #756778 content-hash distfiles layout #766459 emirrordist: prevent distfiles_db _pkg_str pickle problems #766767 emaint --fix merges: add -y, --yes option #766773 emerge: disable --autounmask-license by default #767913 portage.getpid: call os.getpid() lazily #770712 PopenProcess: use call_soon for _async_waipid in _start #771549 prevent USE="${USE} ..." misbehavior Bug: https://bugs.gentoo.org/766117 Bug: https://bugs.gentoo.org/715112 Bug: https://bugs.gentoo.org/756778 Bug: https://bugs.gentoo.org/766459 Bug: https://bugs.gentoo.org/766767 Bug: https://bugs.gentoo.org/766773 Bug: https://bugs.gentoo.org/767913 Bug: https://bugs.gentoo.org/770712 Bug: https://bugs.gentoo.org/771549 Package-Manager: Portage-3.0.15, Repoman-3.0.2 Signed-off-by: Zac Medico <zmedico@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-3.0.15.ebuild | 268 +++++++++++++++++++++++++++++++++ 2 files changed, 269 insertions(+)
*** Bug 560166 has been marked as a duplicate of this bug. ***