From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1295475-garchives=archives.gentoo.org@lists.gentoo.org>
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 550AA1382C5
	for <garchives@archives.gentoo.org>; Sun, 20 Jun 2021 20:21:38 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 90038E0831;
	Sun, 20 Jun 2021 20:21:37 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(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 75B72E0831
	for <gentoo-commits@lists.gentoo.org>; Sun, 20 Jun 2021 20:21:37 +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 D0D8C335C06
	for <gentoo-commits@lists.gentoo.org>; Sun, 20 Jun 2021 20:21:35 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 4008878E
	for <gentoo-commits@lists.gentoo.org>; Sun, 20 Jun 2021 20:21:34 +0000 (UTC)
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Message-ID: <1624220489.c8a52e17017058394ea35394ebfae0e049c8779c.mgorny@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: bin/
X-VCS-Repository: proj/portage
X-VCS-Files: bin/ebuild.sh
X-VCS-Directories: bin/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: c8a52e17017058394ea35394ebfae0e049c8779c
X-VCS-Branch: master
Date: Sun, 20 Jun 2021 20:21:34 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 06abcc52-7348-48b1-8a9d-df73c3b565ce
X-Archives-Hash: 799b728948a8baff85b01355c1d0992f

commit:     c8a52e17017058394ea35394ebfae0e049c8779c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 20 19:48:43 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jun 20 20:21:29 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c8a52e17

Fix exposing evaluated PROPERTIES & RESTRICT in EAPI 8

Reorder the code to prevent eclass PROPERTIES & RESTRICT logic from
overriding the processed values gotten from PORTAGE_PROPERTIES
and PORTAGE_RESTRICT.  Otherwise, code in Portage misbehaves due to
unexpected USE-conditionals in PROPERTIES/RESTRICT.

Bug: https://bugs.gentoo.org/796959
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/733
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 bin/ebuild.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 2c3b985a9..904fdf54e 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -653,13 +653,6 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 			shopt -u failglob
 		fi
 
-		if [[ "${EBUILD_PHASE}" != "depend" ]] ; then
-			PROPERTIES=${PORTAGE_PROPERTIES}
-			RESTRICT=${PORTAGE_RESTRICT}
-			[[ -e $PORTAGE_BUILDDIR/.ebuild_changed ]] && \
-			rm "$PORTAGE_BUILDDIR/.ebuild_changed"
-		fi
-
 		[ "${EAPI+set}" = set ] || EAPI=0
 
 		# export EAPI for helpers (especially since we unset it above)
@@ -688,6 +681,13 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 		unset ECLASS E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND
 		unset E_BDEPEND E_PROPERTIES E_RESTRICT __INHERITED_QA_CACHE
 
+		if [[ "${EBUILD_PHASE}" != "depend" ]] ; then
+			PROPERTIES=${PORTAGE_PROPERTIES}
+			RESTRICT=${PORTAGE_RESTRICT}
+			[[ -e $PORTAGE_BUILDDIR/.ebuild_changed ]] && \
+			rm "$PORTAGE_BUILDDIR/.ebuild_changed"
+		fi
+
 		# alphabetically ordered by $EBUILD_PHASE value
 		case ${EAPI} in
 			0|1)