diff --git a/README.new b/README.new index b26cbb851..ea5ce4bfb 100644 --- a/README.new +++ b/README.new @@ -150,8 +150,10 @@ Lmod 8.7+ (8.7.39) * Fix busted test for ModuleA. (8.7.40) * Bug fix for prepend/append path when trying to add an empty string. * Bug fix for serializeTbl: handle empty or single blank string as key -W.I.P: (8.7.41) * Issue #680: Adding new function depends_on_any() * Issue #680: If $MODULES_AUTO_HANDLING is set then prereq() -> depends_on(); prereq_any() -> depends_on_any() * Issue #686: Generate a perl pod format for manpage for module.1' * ModuleTable modification: Changes to $MODULEPATH are stored in an entry. + (8.7.42) * Fix setting of $FPATH when running bash or ksh shell and executing zsh -l. + + diff --git a/init/bash.in b/init/bash.in index dae3da65b..c19efffc4 100644 --- a/init/bash.in +++ b/init/bash.in @@ -23,20 +23,26 @@ fi # Prepend the FPATH variable for ksh functions when ssh is being used, # except for zsh as it breaks things there. -SUPPORT_KSH="@support_ksh@" -if [ $SUPPORT_KSH = yes -o -n "${KSH_VERSION+x}" ]; then - if [ -z "${__LMOD_SET_FPATH+x}" ]; then - zv=${ZSH_VERSION} - orig_zsh_version=@orig_zsh_version@ - zsh_fpath=@zsh_fpath@ - zsh_fpath=$(echo $zsh_fpath | sed -e "s|/$orig_zsh_version/|/$zv/|g" ) - export FPATH=$(@PKGV@/libexec/addto --append FPATH $zsh_fpath @PKGV@/init/ksh_funcs) - export __LMOD_SET_FPATH=1 - unset zv - unset orig_zsh_version - unset zsh_fpath - fi + +if [ -n "${ZSH_VERSION+x}" -a -z "${__LMOD_SET_ZSH_FPATH+x}" ]; then + export __LMOD_SET_ZSH_FPATH=1 + zv=${ZSH_VERSION} + orig_zsh_version=@orig_zsh_version@ + zsh_fpath=@zsh_fpath@ + zsh_fpath=$(echo $zsh_fpath | sed -e "s|/$orig_zsh_version/|/$zv/|g" ) + export FPATH=$(@PKGV@/libexec/addto --append FPATH $zsh_fpath @PKGV@/init/ksh_funcs) + unset zv + unset orig_zsh_version + unset zsh_fpath fi + +SUPPORT_KSH="@support_ksh@" +if [ $SUPPORT_KSH = yes -o -n "${KSH_VERSION+x}" -o -n "${BASH_VERSION+x}" ]; then + if [ -z "${__LMOD_SET_KSH_FPATH:-}" ]; then + export __LMOD_SET_KSH_FPATH=1 + export FPATH=$(@PKGV@/libexec/addto --append FPATH $FPATH @PKGV@/init/ksh_funcs) + fi +fi unset SUPPORT_KSH export LMOD_ROOT=@lmod_root@