build-system: error in cleanup

Cleanup before building fails if ${BUILD_DIR}/../.. doesn't exist.
This commit is contained in:
2024-04-09 09:43:05 +02:00
parent a7b57641bd
commit 671d4ff7cc
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
(issues #235, #243)
* Files in `$PMODULES_TMPDIR/<module>` are now removed before
and after building a module (except cleanup has been disbaled).
(issue #242)
(issues #242, #245)
* Set prefix and directory/name of modulefile based on group not on
environment variables like `{COMPILER,MPI,HDF5}_VERSION` (issue #244)
+2
View File
@@ -1551,6 +1551,7 @@ _build_module() {
cleanup_build() {
[[ ${enable_cleanup_build} != 'yes' ]] && return 0
[[ "${BUILD_DIR}" == "${SRC_DIR}" ]] && return 0
[[ -d "${BUILD_DIR}/../.." ]] || return 0
{
cd "/${BUILD_DIR}/.." || std::die 42 "Internal error"
[[ "$(${pwd})" == "/" ]] && \
@@ -1570,6 +1571,7 @@ _build_module() {
cleanup_src() {
[[ ${enable_cleanup_src} != 'yes' ]] && return 0
[[ -d "${BUILD_DIR}/../.." ]] || return 0
{
cd "/${SRC_DIR}/.." || std::die 42 "Internal error"
[[ $(pwd) == / ]] && \