diff options
author | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2018-12-23 16:00:17 +0000 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2018-12-23 16:00:17 +0000 |
commit | 75df431b9458615bea97a50d2d578c3821833ab9 (patch) | |
tree | e1e7af2e83e748340a49bf41209ccc201c2d72d5 /subr | |
parent | 9505c235cb77771f489636fdc7e97c2fa79f382c (diff) | |
download | midipix_build-75df431b9458615bea97a50d2d578c3821833ab9.tar.bz2 midipix_build-75df431b9458615bea97a50d2d578c3821833ab9.tar.xz |
subr/build_init.subr:build_init(): rename build logs from previous builds w/ appended modification time postfix.
subr/build_init.subr:build_init(): turn ${DEFAULT_BUILD_LOG_LAST_FNAME} into symbolic link to last previous build log.
Diffstat (limited to 'subr')
-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; |