Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/ingest-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ function update_lmod_caches() {
error "the script for updating the Lmod caches (${update_caches_script}) does not have execute permissions!"
fi
${cvmfs_server} transaction "${cvmfs_repo}"
${update_caches_script} "${CVMFS_ROOT}/${cvmfs_repo}/${basedir}/${version}"
# Find the oldest version that we have, and use its Lmod to generate the cache to get better backwards compatibilty with old Lmod versions
oldest_stack=$(ls -1 -v "${CVMFS_ROOT}/${cvmfs_repo}/${basedir}" | head -n 1)
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"
${update_caches_script} "${CVMFS_ROOT}/${cvmfs_repo}/${basedir}/${version}" "${oldest_stack_lmod_update_script}"
ec=$?
if [ $ec -eq 0 ]; then
${cvmfs_server} publish -m "update Lmod caches after ingesting ${tar_file_basename}" "${cvmfs_repo}"
Expand Down
12 changes: 8 additions & 4 deletions scripts/update_lmod_caches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,24 @@ function error() {
}

# Check if a stack base dir has been specified
if [ "$#" -ne 1 ]; then
error "usage: $0 <path to main directory of an EESSI stack>"
if [ "$#" -lt 1 ] || [ "$#" -gt 2 ]; then
error "usage: $0 <path to main directory of an EESSI stack> [<path to Lmod's update_lmod_system_cache_files script>]"
fi

stack_base_dir="$1"
update_lmod_system_cache_files="$2"

# Check if the given stack base dir exists
if [ ! -d ${stack_base_dir} ]
then
error "${stack_base_dir} does not point to an existing directory!"
fi

# Check if Lmod's cache update script can be found at the expected location (in the compatibility layer of the given stack)
update_lmod_system_cache_files="${stack_base_dir}/compat/linux/$(uname -m)/usr/share/Lmod/libexec/update_lmod_system_cache_files"
# If no Lmod cache update script was specified, try to find one in the compatibility layer of the given stack
if [ -z ${update_lmod_system_cache_files} ]; then
update_lmod_system_cache_files="${stack_base_dir}/compat/linux/$(uname -m)/usr/share/Lmod/libexec/update_lmod_system_cache_files"
fi
# Make sure that the expected Lmod cache update script exists
if [ ! -f ${update_lmod_system_cache_files} ]
then
error "expected to find Lmod's cache update script at ${update_lmod_system_cache_files}, but it doesn't exist."
Expand Down
Loading