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 03942138334 for ; Wed, 23 Jan 2019 04:36:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 11FD1E0A7E; Wed, 23 Jan 2019 04:36:02 +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 D9502E0A7E for ; Wed, 23 Jan 2019 04:36:01 +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 0423E335CEA for ; Wed, 23 Jan 2019 04:36:00 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0A1C153B for ; Wed, 23 Jan 2019 04:35:58 +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: <1548211316.6a738002397ab9cfe1ff02571ffb4cddb596544a.zmedico@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: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 6a738002397ab9cfe1ff02571ffb4cddb596544a X-VCS-Branch: master Date: Wed, 23 Jan 2019 04:35:58 +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: dcf94bea-c40e-45da-a673-7ce8229c63f7 X-Archives-Hash: ebb01d842a4fa6ce5b95a0f66ba15c99 commit: 6a738002397ab9cfe1ff02571ffb4cddb596544a Author: Zac Medico gentoo org> AuthorDate: Tue Jan 22 03:38:14 2019 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Jan 23 02:41:56 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=6a738002 inherit: use local -x ECLASS (bug 676014) Use local -x ECLASS, and also make __export_funcs_var a local variable, since this is simpler than managing these variables as globals (eliminates PECLASS and prev_export_funcs_var variables). As an additional benefit, this prevents interference from ebuild variables as reported in bug 656354 for the ECLASS variable. Bug: https://bugs.gentoo.org/656354 Bug: https://bugs.gentoo.org/676014 Signed-off-by: Zac Medico gentoo.org> bin/ebuild.sh | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 0ec033ae7..d3bf0fd29 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -240,23 +240,22 @@ inherit() { ECLASS_DEPTH=$(($ECLASS_DEPTH + 1)) if [[ ${ECLASS_DEPTH} -gt 1 ]]; then debug-print "*** Multiple Inheritence (Level: ${ECLASS_DEPTH})" - fi - if [[ -n $ECLASS && -n ${!__export_funcs_var} ]] ; then - eqawarn "QA Notice: EXPORT_FUNCTIONS is called before inherit in ${ECLASS}.eclass." - eqawarn "For compatibility with <=portage-2.1.6.7, only call EXPORT_FUNCTIONS" - eqawarn "after inherit(s)." + # Since ECLASS_DEPTH > 1, the following variables are locals from the + # previous inherit call in the call stack. + if [[ -n ${ECLASS} && -n ${!__export_funcs_var} ]] ; then + eqawarn "QA Notice: EXPORT_FUNCTIONS is called before inherit in ${ECLASS}.eclass." + eqawarn "For compatibility with <=portage-2.1.6.7, only call EXPORT_FUNCTIONS" + eqawarn "after inherit(s)." + fi fi + local -x ECLASS + local __export_funcs_var local repo_location local location local potential_location local x - - # These variables must be restored before returning. - local PECLASS=$ECLASS - local prev_export_funcs_var=$__export_funcs_var - local B_IUSE local B_REQUIRED_USE local B_DEPEND @@ -268,7 +267,7 @@ inherit() { location="" potential_location="" - export ECLASS="$1" + ECLASS="$1" __export_funcs_var=__export_functions_$ECLASS_DEPTH unset $__export_funcs_var @@ -378,12 +377,6 @@ inherit() { shift done ((--ECLASS_DEPTH)) # Returns 1 when ECLASS_DEPTH reaches 0. - if (( ECLASS_DEPTH > 0 )) ; then - export ECLASS=$PECLASS - __export_funcs_var=$prev_export_funcs_var - else - unset ECLASS __export_funcs_var - fi return 0 }