diff options
-rw-r--r-- | subr/build_init.subr | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/subr/build_init.subr b/subr/build_init.subr index a76b9c42..7e52a280 100644 --- a/subr/build_init.subr +++ b/subr/build_init.subr @@ -9,7 +9,7 @@ build_fini() { }; build_init() { - local __="" _env_vars="" _env_vars_except="" _env_var=""; + local __="" _env_vars="" _env_vars_except="" _env_var="" _log_last_fname="" _log_last_ts=""; set -o noglob; umask 022; if [ -z "${DEFAULT_BUILD_CPUS}" ]\ && [ -e /proc/cpuinfo ]; then @@ -65,7 +65,11 @@ build_init() { touch "${DEFAULT_BUILD_STATUS_IN_PROGRESS_FNAME}"; fi; if [ -e "${DEFAULT_BUILD_LOG_FNAME}" ]; then - ex_rtl_fileop mv "${DEFAULT_BUILD_LOG_FNAME}" "${DEFAULT_BUILD_LOG_LAST_FNAME}"; + _log_last_ts="$(stat -c %Y "${DEFAULT_BUILD_LOG_FNAME}")"; + _log_last_ts="$(awk 'BEGIN {printf(strftime("%Y-%m-%d-%H-%M-%S", '"${_log_last_ts}"'))}')"; + _log_last_fname="${DEFAULT_BUILD_LOG_FNAME}.${_log_last_ts}"; + ex_rtl_fileop mv "${DEFAULT_BUILD_LOG_FNAME}" "${_log_last_fname}"; + ex_rtl_fileop ln_symbolic "${_log_last_fname}" "${DEFAULT_BUILD_LOG_LAST_FNAME}"; fi; ex_rtl_fileop touch "${DEFAULT_BUILD_LOG_FNAME}"; BUILD_IS_PARENT=1; |