Resolve "modbuild: cleanup source and build directory before and after building"

This commit is contained in:
2024-03-22 15:35:01 +01:00
parent 6c70eb37f0
commit 0ffdf599a1
3 changed files with 10 additions and 23 deletions
+2
View File
@@ -9,6 +9,8 @@
(issue #236)
* BUGFIX: writing list of 'systems' to module configuration file fixed
(issue #235)
* CHANGE: files in `$PMODULES_TMPDIR/<module>` are now removed before
and after building a module (except cleanup has been disbaled).
### Toolchain
* update to Tcl 8.6.14 (issue #239)
+4 -2
View File
@@ -1570,7 +1570,7 @@ _build_module() {
}
cleanup_build() {
[[ ${enable_cleanup_build} == yes ]] || return 0
[[ ${enable_cleanup_build} != 'yes' ]] && return 0
[[ "${BUILD_DIR}" == "${SRC_DIR}" ]] && return 0
{
cd "/${BUILD_DIR}/.." || std::die 42 "Internal error"
@@ -1590,7 +1590,7 @@ _build_module() {
}
cleanup_src() {
[[ ${enable_cleanup_src} == yes ]] || return 0
[[ ${enable_cleanup_src} != 'yes' ]] && return 0
{
cd "/${SRC_DIR}/.." || std::die 42 "Internal error"
[[ $(pwd) == / ]] && \
@@ -1799,6 +1799,8 @@ _build_module() {
"%s " \
"${module_name}/${module_version}:" \
"start building ..."
cleanup_build
cleanup_src
compile_and_install
post_install
fi
+4 -21
View File
@@ -129,19 +129,12 @@ MISCELLANEOUS OPTIONS:
Dry run.
--disable-cleanup-build
--enable-cleanup-build
Cleanup files in the build directory. Default is to remove.
all files in the build-directory.
--disable-cleanup-src
--enable-cleanup-src
Cleanup files in the source directory. Default is to
remove all files in the source directory.
--disable-cleanup
--enable-cleanup
Cleanup all files in temporary directory. Default is to
remove all files created during building.
Disable the cleanup of files in the build and/or source
directory. Default is to remove all files in the build
respective source directory at the beginning of a build
and after a successful build.
--distdir
Directory where to store and lookup downloaded files.
@@ -237,23 +230,13 @@ parse_args() {
--dry-run )
opt_dry_run='yes'
;;
--enable-cleanup )
opt_enable_cleanup_build='yes'
opt_enable_cleanup_src='yes'
;;
--disable-cleanup )
opt_enable_cleanup_build='no'
opt_enable_cleanup_src='no'
;;
--enable-cleanup-build )
opt_enable_cleanup_build='yes'
;;
--disable-cleanup-build )
opt_enable_cleanup_build='no'
;;
--enable-cleanup-src )
opt_enable_cleanup_src='yes'
;;
--disable-cleanup-src )
opt_enable_cleanup_src='no'
;;