File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,10 @@ function update_lmod_caches() {
182182 error " the script for updating the Lmod caches (${update_caches_script} ) does not have execute permissions!"
183183 fi
184184 ${cvmfs_server} transaction " ${cvmfs_repo} "
185- ${update_caches_script} " ${CVMFS_ROOT} /${cvmfs_repo} /${basedir} /${version} "
185+ # Find the oldest version that we have, and use its Lmod to generate the cache to get better backwards compatibilty with old Lmod versions
186+ oldest_stack=$( ls -1 -v " ${CVMFS_ROOT} /${cvmfs_repo} /${basedir} " | head -n 1)
187+ oldest_stack_lmod_update_script=" ${CVMFS_ROOT} /${cvmfs_repo} /${basedir} /${oldest_stack} /compat/linux/$( uname -m) /usr/share/Lmod/libexec/update_lmod_system_cache_files"
188+ ${update_caches_script} " ${CVMFS_ROOT} /${cvmfs_repo} /${basedir} /${version} " " ${oldest_stack_lmod_update_script} "
186189 ec=$?
187190 if [ $ec -eq 0 ]; then
188191 ${cvmfs_server} publish -m " update Lmod caches after ingesting ${tar_file_basename} " " ${cvmfs_repo} "
Original file line number Diff line number Diff line change @@ -14,20 +14,24 @@ function error() {
1414}
1515
1616# Check if a stack base dir has been specified
17- if [ " $# " -ne 1 ]; then
18- error " usage: $0 <path to main directory of an EESSI stack>"
17+ if [ " $# " -lt 1 ] || [ " $# " -gt 2 ]; then
18+ error " usage: $0 <path to main directory of an EESSI stack> [<path to Lmod's update_lmod_system_cache_files script>] "
1919fi
2020
2121stack_base_dir=" $1 "
22+ update_lmod_system_cache_files=" $2 "
2223
2324# Check if the given stack base dir exists
2425if [ ! -d ${stack_base_dir} ]
2526then
2627 error " ${stack_base_dir} does not point to an existing directory!"
2728fi
2829
29- # Check if Lmod's cache update script can be found at the expected location (in the compatibility layer of the given stack)
30- update_lmod_system_cache_files=" ${stack_base_dir} /compat/linux/$( uname -m) /usr/share/Lmod/libexec/update_lmod_system_cache_files"
30+ # If no Lmod cache update script was specified, try to find one in the compatibility layer of the given stack
31+ if [ -z ${update_lmod_system_cache_files} ]; then
32+ update_lmod_system_cache_files=" ${stack_base_dir} /compat/linux/$( uname -m) /usr/share/Lmod/libexec/update_lmod_system_cache_files"
33+ fi
34+ # Make sure that the expected Lmod cache update script exists
3135if [ ! -f ${update_lmod_system_cache_files} ]
3236then
3337 error " expected to find Lmod's cache update script at ${update_lmod_system_cache_files} , but it doesn't exist."
You can’t perform that action at this time.
0 commit comments