1.1 --- a/scripts/crosstool-NG.sh.in Mon Dec 20 00:07:29 2010 +0100
1.2 +++ b/scripts/crosstool-NG.sh.in Sun Mar 20 01:08:22 2011 +0100
1.3 @@ -222,8 +222,6 @@
1.4 # Don't eradicate directories if we need to restart
1.5 if [ -z "${CT_RESTART}" ]; then
1.6 # Get rid of pre-existing installed toolchain and previous build directories.
1.7 - # We need to do that _before_ we can safely log, because the log file will
1.8 - # most probably be in the toolchain directory.
1.9 if [ "${CT_FORCE_DOWNLOAD}" = "y" -a -d "${CT_TARBALLS_DIR}" ]; then
1.10 CT_DoForceRmdir "${CT_TARBALLS_DIR}"
1.11 fi
1.12 @@ -264,25 +262,9 @@
1.13 CT_DoExecLog DEBUG rm -f "${CT_PREFIX_DIR}/foo"
1.14
1.15 # Kludge: CT_INSTALL_DIR and CT_PREFIX_DIR might have grown read-only if
1.16 -# the previous build was successful. To be able to move the logfile there,
1.17 -# switch them back to read/write
1.18 +# the previous build was successful.
1.19 CT_DoExecLog ALL chmod -R u+w "${CT_INSTALL_DIR}" "${CT_PREFIX_DIR}"
1.20
1.21 -# Redirect log to the actual log file now we can
1.22 -# It's quite understandable that the log file will be installed in the install
1.23 -# directory, so we must first ensure it exists and is writeable (above) before
1.24 -# we can log there
1.25 -exec >/dev/null
1.26 -case "${CT_LOG_TO_FILE}" in
1.27 - y) CT_LOG_FILE="${CT_PREFIX_DIR}/build.log"
1.28 - cat "${tmp_log_file}" >>"${CT_LOG_FILE}"
1.29 - rm -f "${tmp_log_file}"
1.30 - exec >>"${CT_LOG_FILE}"
1.31 - ;;
1.32 - *) rm -f "${tmp_log_file}"
1.33 - ;;
1.34 -esac
1.35 -
1.36 # Setting up the rest of the environment only if not restarting
1.37 if [ -z "${CT_RESTART}" ]; then
1.38 case "${CT_SYSROOT_NAME}" in
1.39 @@ -624,7 +606,12 @@
1.40 CT_DoLog INFO "Finishing installation (may take a few seconds)..."
1.41 exec >/dev/null 2>&1
1.42
1.43 -[ "${CT_LOG_FILE_COMPRESS}" = y ] && bzip2 -9 "${CT_LOG_FILE}"
1.44 +if [ "${CT_LOG_TO_FILE}" = "y" ]; then
1.45 + cp "${tmp_log_file}" "${CT_PREFIX_DIR}/build.log"
1.46 + if [ "${CT_LOG_FILE_COMPRESS}" = y ]; then
1.47 + bzip2 -9 "${CT_PREFIX_DIR}/build.log"
1.48 + fi
1.49 +fi
1.50 [ "${CT_INSTALL_DIR_RO}" = "y" ] && chmod -R a-w "${CT_INSTALL_DIR}"
1.51 [ "${CT_TEST_SUITE}" = "y" ] && chmod -R u+w "${CT_TEST_SUITE_DIR}"
1.52