On 11/10/2015 08:39 PM, Mike Frysinger wrote: > To try and provide better stability across bash versions, > set the language compat level based on the current EAPI. > --- > bin/eapi.sh | 8 ++++++++ > bin/ebuild.sh | 39 +++++++++++++++++++++++++++++++++++++++ > 2 files changed, 47 insertions(+) > > diff --git a/bin/eapi.sh b/bin/eapi.sh > index 528e6f2..b236344 100644 > --- a/bin/eapi.sh > +++ b/bin/eapi.sh > @@ -191,3 +191,11 @@ ___eapi_enables_failglob_in_global_scope() { > ___eapi_enables_globstar() { > [[ ${1-${EAPI-0}} =~ ^(4-python|5-progress)$ ]] > } > + > +__eapi_bash_3_2() { > + [[ ${1-${EAPI-0}} =~ > ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]] > +} > + > +__eapi_bash_4_2() { > + [[ ${1-${EAPI-0}} =~ ^(6)$ ]] > +} > diff --git a/bin/ebuild.sh b/bin/ebuild.sh > index 75a9d24..2d09fb8 100755 > --- a/bin/ebuild.sh > +++ b/bin/ebuild.sh > @@ -6,8 +6,47 @@ > # Make sure it's before everything so we don't mess aliases that follow. > unalias -a > > +# Make sure this isn't exported to scripts we execute. > +unset BASH_COMPAT > + > source "${PORTAGE_BIN_PATH}/isolated-functions.sh" || exit 1 > > +# Set up the bash version compatibility level. > +__check_bash_version() {
Please unset all new internal function inside bin/save-ebuild-env.sh. Note that it already uses this line to unset functions beginning with ___eapi: unset -f $(compgen -A function ___eapi_) However, your __eapi functions will not be matched because they only begin with 2 underscores. -- Thanks, Zac