Use local -x ECLASS. Bug: https://bugs.gentoo.org/656354 Bug: https://bugs.gentoo.org/676014
Signed-off-by: Zac Medico <zmed...@gentoo.org> --- bin/ebuild.sh | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 820db50ca..64041dff9 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -242,21 +242,13 @@ inherit() { debug-print "*** Multiple Inheritence (Level: ${ECLASS_DEPTH})" fi - if [[ -n $ECLASS && -n ${!__export_funcs_var} ]] ; then - echo "QA Notice: EXPORT_FUNCTIONS is called before inherit in" \ - "$ECLASS.eclass. For compatibility with <=portage-2.1.6.7," \ - "only call EXPORT_FUNCTIONS after inherit(s)." \ - | fmt -w 75 | while read -r ; do eqawarn "$REPLY" ; done - fi - 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 -x ECLASS local B_IUSE local B_REQUIRED_USE @@ -265,11 +257,19 @@ inherit() { local B_PDEPEND local B_HDEPEND local B_BDEPEND + + if [[ -n ${ECLASS} && -n ${!__export_funcs_var} ]] ; then + echo "QA Notice: EXPORT_FUNCTIONS is called before inherit in" \ + "${ECLASS}.eclass. For compatibility with <=portage-2.1.6.7," \ + "only call EXPORT_FUNCTIONS after inherit(s)." \ + | fmt -w 75 | while read -r ; do eqawarn "${REPLY}" ; done + fi + while [ "$1" ]; do location="" potential_location="" - export ECLASS="$1" + ECLASS="$1" __export_funcs_var=__export_functions_$ECLASS_DEPTH unset $__export_funcs_var @@ -379,12 +379,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 } -- 2.18.1