Skip to content

Commit

Permalink
make sure SitePackage.lua exists AND is updated if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
truib committed May 24, 2024
1 parent 5c04f16 commit f8a2266
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions EESSI-install-software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,19 @@ _lmod_sitepackage_file=${_lmod_cfg_dir}/SitePackage.lua
if [ ! -f ${_lmod_sitepackage_file} ]; then
command -V python3
python3 ${TOPDIR}/create_lmodsitepackage.py ${_eessi_software_path}
echo "newly created '${_lmod_sitepackage_file}':"
cat -n ${_lmod_sitepackage_file}
else
echo ">> Updating Lmod SitePackage.lua ..."
export LMOD_PACKAGE_PATH="${EASYBUILD_INSTALLPATH}/.lmod"
lmod_sitepackage_file="$LMOD_PACKAGE_PATH/SitePackage.lua"
sitepackage_changed=$(cat ${pr_diff} | grep '^+++' | cut -f2 -d' ' | sed 's@^[a-z]/@@g' | grep '^create_lmodsitepackage.py$' > /dev/null; echo $?)
if [ ! -f "$lmod_sitepackage_file" ] || [ "${sitepackage_changed}" == '0' ]; then
python3 $TOPDIR/create_lmodsitepackage.py ${EASYBUILD_INSTALLPATH}
check_exit_code $? "$lmod_sitepackage_file created" "Failed to create $lmod_sitepackage_file"
fi
echo "just updated '${lmod_sitepackage_file}':"
cat -n ${lmod_sitepackage_file}
fi

# Set all the EESSI environment variables (respecting $EESSI_SOFTWARE_SUBDIR_OVERRIDE)
Expand Down

0 comments on commit f8a2266

Please sign in to comment.