diff options
author | Bryan Drewery <bryan@shatow.net> | 2021-09-09 03:45:41 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2021-09-09 03:53:04 +0300 |
commit | c50f10d2116efb8f1de0efbb6b3ed36b22e3f723 (patch) | |
tree | ae953df9bd8893ef470389c2cf143dbdef5edbf0 /src | |
parent | 5ec89b5f35056f15a40f72a51a4a12e629282f94 (diff) |
crashed_build: Factor out log file paths and use install -lrs
Diffstat (limited to 'src')
-rw-r--r-- | src/share/poudriere/common.sh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index 7fea724b..4ca419a1 100644 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -4820,30 +4820,32 @@ crashed_build() { [ $# -eq 2 ] || eargs crashed_build pkgname failed_phase local pkgname="$1" local failed_phase="$2" - local origin originspec log + local origin originspec logd log log_error - _log_path log + _log_path logd get_originspec_from_pkgname originspec "${pkgname}" originspec_decode "${originspec}" origin '' '' echo "Build crashed: ${failed_phase}" >> "${log}/logs/${pkgname}.log" + log="${logd}/logs/${pkgname}.log" + log_error="${logd}/logs/errors/${pkgname}.log" # If the file already exists then all of this handling was done in # build_pkg() already; The port failed already. What crashed # came after. - if ! [ -e "${log}/logs/errors/${pkgname}.log" ]; then + if ! [ -e "${log_error}" ]; then # Symlink the buildlog into errors/ - ln -s "../${pkgname}.log" "${log}/logs/errors/${pkgname}.log" + install -lrs "${log}" "${log_error}" badd ports.failed \ "${originspec} ${pkgname} ${failed_phase} ${failed_phase}" COLOR_ARROW="${COLOR_FAIL}" job_msg \ "${COLOR_FAIL}Finished ${COLOR_PORT}${originspec} | ${pkgname}${COLOR_FAIL}: Failed: ${COLOR_PHASE}${failed_phase}" run_hook pkgbuild failed "${origin}" "${pkgname}" \ "${failed_phase}" \ - "${log}/logs/errors/${pkgname}.log" + "${log_error}" fi clean_pool "${pkgname}" "${originspec}" "${failed_phase}" - stop_build "${pkgname}" "${originspec}" 1 >> "${log}/logs/${pkgname}.log" + stop_build "${pkgname}" "${originspec}" 1 >> "${log}" } clean_pool() { |