Fix problem with incomplete environment restoration after module purge.

This commit is contained in:
Christoph Niethammer 2018-03-09 11:29:07 +00:00
parent b52256ad1f
commit 71d0d13852

View file

@ -49,6 +49,7 @@ module_clean_env_file="$tmpdir/.module_clean_env" # original environment
# safe the original environment # safe the original environment
set > $module_clean_env_file set > $module_clean_env_file
module -f save check_modules
# list of all failed modules # list of all failed modules
failed_modules=() failed_modules=()
@ -131,6 +132,7 @@ do
# Reset the complete environment manually to overcome problems with # Reset the complete environment manually to overcome problems with
# inconsistent internal caches of the module command after module purge. # inconsistent internal caches of the module command after module purge.
source $module_clean_env_file 2>/dev/null source $module_clean_env_file 2>/dev/null
module restore check_modules 2>/dev/null
# clean up intermediate files # clean up intermediate files
rm -f $module_load_logfile rm -f $module_load_logfile