From aa3adc79cc70a78bf98e6d2b9fe902bf11fce5f6 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 9 Feb 2023 09:55:19 +0100 Subject: [PATCH] modbuild: sym-link issue fixed $ROOT/$GROUP/modulefiles/$NAME can be a directory but also a sym-link. The installation of the modulefile failed in case of a sym-link. This is fixed now. --- Pmodules/libpbuild.bash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Pmodules/libpbuild.bash b/Pmodules/libpbuild.bash index ae823c2..5e32a11 100644 --- a/Pmodules/libpbuild.bash +++ b/Pmodules/libpbuild.bash @@ -763,6 +763,9 @@ pbuild::make_all() { "${PMODULES_ROOT}/${GROUP}/${PMODULES_MODULEFILES_DIR}" \ "${names[@]}" \ "${module_name}") + if [[ -L "${modulefile_dir}" ]]; then + modulefile_dir=$(readlink -m "${modulefile_dir}") + fi modulefile_name="${modulefile_dir}/${module_version}" PREFIX="${PMODULES_ROOT}/${GROUP}/${module_name}/${module_version}" local -i i=0 @@ -954,6 +957,7 @@ pbuild::make_all() { "%s " \ "${module_name}/${module_version}:" \ "installing modulefile '${modulefile_name}' ..." + mkdir -p "${modulefile_dir}" install -m 0444 "${src}" "${modulefile_name}" }