1.1 --- a/scripts/functions Thu Mar 03 23:46:03 2011 +0100
1.2 +++ b/scripts/functions Sun Mar 20 00:02:21 2011 +0100
1.3 @@ -15,7 +15,7 @@
1.4 for((depth=2; ${BASH_LINENO[$((${depth}-1))]}>0; depth++)); do
1.5 CT_DoLog ERROR " called from '${BASH_SOURCE[${depth}]}' at line # ${BASH_LINENO[${depth}-1]} in function '${FUNCNAME[${depth}]}'"
1.6 done
1.7 - [ "${CT_LOG_TO_FILE}" = "y" ] && CT_DoLog ERROR "Look at '${CT_LOG_FILE}' for more info on this error."
1.8 + [ "${CT_LOG_TO_FILE}" = "y" ] && CT_DoLog ERROR "Look at '${tmp_log_file}' for more info on this error."
1.9 CT_STEP_COUNT=1
1.10 CT_DoEnd ERROR
1.11 exit $ret
1.12 @@ -40,8 +40,9 @@
1.13 # Log policy:
1.14 # - first of all, save stdout so we can see the live logs: fd #6
1.15 exec 6>&1
1.16 -# - then point stdout to the log file (temporary for now)
1.17 -tmp_log_file="${CT_TOP_DIR}/log.$$"
1.18 +# - then point stdout to the log file
1.19 +tmp_log_file="${CT_TOP_DIR}/build.log"
1.20 +rm -f "${tmp_log_file}"
1.21 exec >>"${tmp_log_file}"
1.22
1.23 # The different log levels:
1.24 @@ -1024,15 +1025,13 @@
1.25 CT_DoTarballIfExists "${CT_CC_CORE_SHARED_PREFIX_DIR}" "${state_dir}/cc_core_shared_prefix_dir"
1.26 CT_DoTarballIfExists "${CT_PREFIX_DIR}" "${state_dir}/prefix_dir" --exclude '*.log'
1.27
1.28 - if [ "${CT_LOG_TO_FILE}" = "y" ]; then
1.29 - CT_DoLog STATE " Saving log file"
1.30 - exec >/dev/null
1.31 - case "${CT_DEBUG_CT_SAVE_STEPS_GZIP}" in
1.32 - y) gzip -3 -c "${CT_LOG_FILE}" >"${state_dir}/log.gz";;
1.33 - *) cat "${CT_LOG_FILE}" >"${state_dir}/log";;
1.34 - esac
1.35 - exec >>"${CT_LOG_FILE}"
1.36 - fi
1.37 + CT_DoLog STATE " Saving log file"
1.38 + exec >/dev/null
1.39 + case "${CT_DEBUG_CT_SAVE_STEPS_GZIP}" in
1.40 + y) gzip -3 -c "${tmp_log_file}" >"${state_dir}/log.gz";;
1.41 + *) cat "${tmp_log_file}" >"${state_dir}/log";;
1.42 + esac
1.43 + exec >>"${tmp_log_file}"
1.44 }
1.45
1.46 # This function restores a previously saved state
1.47 @@ -1072,15 +1071,13 @@
1.48 CT_STOP="${old_STOP}"
1.49 unset old_stop old_restart
1.50
1.51 - if [ "${CT_LOG_TO_FILE}" = "y" ]; then
1.52 - CT_DoLog STATE " Restoring log file"
1.53 - exec >/dev/null
1.54 - case "${CT_DEBUG_CT_SAVE_STEPS_GZIP}" in
1.55 - y) zcat "${state_dir}/log.gz" >"${CT_LOG_FILE}";;
1.56 - *) cat "${state_dir}/log" >"${CT_LOG_FILE}";;
1.57 - esac
1.58 - cat "${state_dir}/tail.log" >>"${CT_LOG_FILE}"
1.59 - exec >>"${CT_LOG_FILE}"
1.60 - rm -f "${state_dir}/tail.log"
1.61 - fi
1.62 + CT_DoLog STATE " Restoring log file"
1.63 + exec >/dev/null
1.64 + case "${CT_DEBUG_CT_SAVE_STEPS_GZIP}" in
1.65 + y) zcat "${state_dir}/log.gz" >"${tmp_log_file}";;
1.66 + *) cat "${state_dir}/log" >"${tmp_log_file}";;
1.67 + esac
1.68 + cat "${state_dir}/tail.log" >>"${tmp_log_file}"
1.69 + exec >>"${tmp_log_file}"
1.70 + rm -f "${state_dir}/tail.log"
1.71 }