1.1 --- a/.hgignore Thu Mar 17 22:08:33 2011 +0100
1.2 +++ b/.hgignore Sun Mar 20 00:02:21 2011 +0100
1.3 @@ -18,7 +18,7 @@
1.4
1.5 # Temporaries
1.6 .*.swp
1.7 -log.*
1.8 +build.log
1.9 .config.old
1.10
1.11 # This is the place where toolchains are built
2.1 --- a/ct-ng.in Thu Mar 17 22:08:33 2011 +0100
2.2 +++ b/ct-ng.in Sun Mar 20 00:02:21 2011 +0100
2.3 @@ -165,7 +165,7 @@
2.4 PHONY += clean
2.5 clean::
2.6 @$(ECHO) " CLEAN log"
2.7 - $(SILENT)rm -f log.* .config.* ..config*
2.8 + $(SILENT)rm -f build.log .config.* ..config*
2.9
2.10 PHONY += distclean
2.11 distclean:: clean
3.1 --- a/scripts/crosstool-NG.sh.in Thu Mar 17 22:08:33 2011 +0100
3.2 +++ b/scripts/crosstool-NG.sh.in Sun Mar 20 00:02:21 2011 +0100
3.3 @@ -222,8 +222,6 @@
3.4 # Don't eradicate directories if we need to restart
3.5 if [ -z "${CT_RESTART}" ]; then
3.6 # Get rid of pre-existing installed toolchain and previous build directories.
3.7 - # We need to do that _before_ we can safely log, because the log file will
3.8 - # most probably be in the toolchain directory.
3.9 if [ "${CT_FORCE_DOWNLOAD}" = "y" -a -d "${CT_TARBALLS_DIR}" ]; then
3.10 CT_DoForceRmdir "${CT_TARBALLS_DIR}"
3.11 fi
3.12 @@ -264,25 +262,9 @@
3.13 CT_DoExecLog DEBUG rm -f "${CT_PREFIX_DIR}/foo"
3.14
3.15 # Kludge: CT_INSTALL_DIR and CT_PREFIX_DIR might have grown read-only if
3.16 -# the previous build was successful. To be able to move the logfile there,
3.17 -# switch them back to read/write
3.18 +# the previous build was successful.
3.19 CT_DoExecLog ALL chmod -R u+w "${CT_INSTALL_DIR}" "${CT_PREFIX_DIR}"
3.20
3.21 -# Redirect log to the actual log file now we can
3.22 -# It's quite understandable that the log file will be installed in the install
3.23 -# directory, so we must first ensure it exists and is writeable (above) before
3.24 -# we can log there
3.25 -exec >/dev/null
3.26 -case "${CT_LOG_TO_FILE}" in
3.27 - y) CT_LOG_FILE="${CT_PREFIX_DIR}/build.log"
3.28 - cat "${tmp_log_file}" >>"${CT_LOG_FILE}"
3.29 - rm -f "${tmp_log_file}"
3.30 - exec >>"${CT_LOG_FILE}"
3.31 - ;;
3.32 - *) rm -f "${tmp_log_file}"
3.33 - ;;
3.34 -esac
3.35 -
3.36 # Setting up the rest of the environment only if not restarting
3.37 if [ -z "${CT_RESTART}" ]; then
3.38 case "${CT_SYSROOT_NAME}" in
3.39 @@ -624,7 +606,12 @@
3.40 CT_DoLog INFO "Finishing installation (may take a few seconds)..."
3.41 exec >/dev/null 2>&1
3.42
3.43 -[ "${CT_LOG_FILE_COMPRESS}" = y ] && bzip2 -9 "${CT_LOG_FILE}"
3.44 +if [ "${CT_LOG_TO_FILE}" = "y" ]; then
3.45 + cp "${tmp_log_file}" "${CT_PREFIX_DIR}/build.log"
3.46 + if [ "${CT_LOG_FILE_COMPRESS}" = y ]; then
3.47 + bzip2 -9 "${CT_PREFIX_DIR}/build.log"
3.48 + fi
3.49 +fi
3.50 [ "${CT_INSTALL_DIR_RO}" = "y" ] && chmod -R a-w "${CT_INSTALL_DIR}"
3.51 [ "${CT_TEST_SUITE}" = "y" ] && chmod -R u+w "${CT_TEST_SUITE_DIR}"
3.52
4.1 --- a/scripts/functions Thu Mar 17 22:08:33 2011 +0100
4.2 +++ b/scripts/functions Sun Mar 20 00:02:21 2011 +0100
4.3 @@ -15,7 +15,7 @@
4.4 for((depth=2; ${BASH_LINENO[$((${depth}-1))]}>0; depth++)); do
4.5 CT_DoLog ERROR " called from '${BASH_SOURCE[${depth}]}' at line # ${BASH_LINENO[${depth}-1]} in function '${FUNCNAME[${depth}]}'"
4.6 done
4.7 - [ "${CT_LOG_TO_FILE}" = "y" ] && CT_DoLog ERROR "Look at '${CT_LOG_FILE}' for more info on this error."
4.8 + [ "${CT_LOG_TO_FILE}" = "y" ] && CT_DoLog ERROR "Look at '${tmp_log_file}' for more info on this error."
4.9 CT_STEP_COUNT=1
4.10 CT_DoEnd ERROR
4.11 exit $ret
4.12 @@ -40,8 +40,9 @@
4.13 # Log policy:
4.14 # - first of all, save stdout so we can see the live logs: fd #6
4.15 exec 6>&1
4.16 -# - then point stdout to the log file (temporary for now)
4.17 -tmp_log_file="${CT_TOP_DIR}/log.$$"
4.18 +# - then point stdout to the log file
4.19 +tmp_log_file="${CT_TOP_DIR}/build.log"
4.20 +rm -f "${tmp_log_file}"
4.21 exec >>"${tmp_log_file}"
4.22
4.23 # The different log levels:
4.24 @@ -1024,15 +1025,13 @@
4.25 CT_DoTarballIfExists "${CT_CC_CORE_SHARED_PREFIX_DIR}" "${state_dir}/cc_core_shared_prefix_dir"
4.26 CT_DoTarballIfExists "${CT_PREFIX_DIR}" "${state_dir}/prefix_dir" --exclude '*.log'
4.27
4.28 - if [ "${CT_LOG_TO_FILE}" = "y" ]; then
4.29 - CT_DoLog STATE " Saving log file"
4.30 - exec >/dev/null
4.31 - case "${CT_DEBUG_CT_SAVE_STEPS_GZIP}" in
4.32 - y) gzip -3 -c "${CT_LOG_FILE}" >"${state_dir}/log.gz";;
4.33 - *) cat "${CT_LOG_FILE}" >"${state_dir}/log";;
4.34 - esac
4.35 - exec >>"${CT_LOG_FILE}"
4.36 - fi
4.37 + CT_DoLog STATE " Saving log file"
4.38 + exec >/dev/null
4.39 + case "${CT_DEBUG_CT_SAVE_STEPS_GZIP}" in
4.40 + y) gzip -3 -c "${tmp_log_file}" >"${state_dir}/log.gz";;
4.41 + *) cat "${tmp_log_file}" >"${state_dir}/log";;
4.42 + esac
4.43 + exec >>"${tmp_log_file}"
4.44 }
4.45
4.46 # This function restores a previously saved state
4.47 @@ -1072,15 +1071,13 @@
4.48 CT_STOP="${old_STOP}"
4.49 unset old_stop old_restart
4.50
4.51 - if [ "${CT_LOG_TO_FILE}" = "y" ]; then
4.52 - CT_DoLog STATE " Restoring log file"
4.53 - exec >/dev/null
4.54 - case "${CT_DEBUG_CT_SAVE_STEPS_GZIP}" in
4.55 - y) zcat "${state_dir}/log.gz" >"${CT_LOG_FILE}";;
4.56 - *) cat "${state_dir}/log" >"${CT_LOG_FILE}";;
4.57 - esac
4.58 - cat "${state_dir}/tail.log" >>"${CT_LOG_FILE}"
4.59 - exec >>"${CT_LOG_FILE}"
4.60 - rm -f "${state_dir}/tail.log"
4.61 - fi
4.62 + CT_DoLog STATE " Restoring log file"
4.63 + exec >/dev/null
4.64 + case "${CT_DEBUG_CT_SAVE_STEPS_GZIP}" in
4.65 + y) zcat "${state_dir}/log.gz" >"${tmp_log_file}";;
4.66 + *) cat "${state_dir}/log" >"${tmp_log_file}";;
4.67 + esac
4.68 + cat "${state_dir}/tail.log" >>"${tmp_log_file}"
4.69 + exec >>"${tmp_log_file}"
4.70 + rm -f "${state_dir}/tail.log"
4.71 }