From 5e07f7cfc3292f4c185a570546e449b096056da7 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sat, 16 Jun 2007 22:23:53 +0000 Subject: [PATCH] scripts/functions is responsible for initiating the log file. Users of the log facility are in charge to use, move, delete this log file, now. --- scripts/crosstool.sh | 7 ------- scripts/functions | 7 +++++++ scripts/saveSample.sh | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/crosstool.sh b/scripts/crosstool.sh index 6c78d52d..6a882117 100755 --- a/scripts/crosstool.sh +++ b/scripts/crosstool.sh @@ -27,13 +27,6 @@ fi CT_STAR_DATE=`CT_DoDate +%s%N` CT_STAR_DATE_HUMAN=`CT_DoDate +%Y%m%d.%H%M%S` -# Log policy: -# - first of all, save stdout so we can see the live logs: fd #6 -exec 6>&1 -# - then point stdout to the log file (temporary for now) -tmp_log_file="${CT_TOP_DIR}/log.$$" -exec >>"${tmp_log_file}" - # Are we configured? We'll need that later... CT_TestOrAbort "Configuration file not found. Please create one." -f "${CT_TOP_DIR}/.config" diff --git a/scripts/functions b/scripts/functions index e14cf35c..d66fe22e 100644 --- a/scripts/functions +++ b/scripts/functions @@ -35,6 +35,13 @@ set -o pipefail # shared is not found set +o hashall +# Log policy: +# - first of all, save stdout so we can see the live logs: fd #6 +exec 6>&1 +# - then point stdout to the log file (temporary for now) +tmp_log_file="${CT_TOP_DIR}/log.$$" +exec >>"${tmp_log_file}" + # The different log levels: CT_LOG_LEVEL_ERROR=0 CT_LOG_LEVEL_WARN=1 diff --git a/scripts/saveSample.sh b/scripts/saveSample.sh index 3d58bd99..7a5b57cc 100755 --- a/scripts/saveSample.sh +++ b/scripts/saveSample.sh @@ -10,8 +10,9 @@ . "${CT_TOP_DIR}/scripts/functions" -exec 6>&1 +# Don't care about any log file exec >/dev/null +rm -f "${tmp_log_file}" # Parse the configuration file CT_TestOrAbort "Configuration file not found. Please create one." -f "${CT_TOP_DIR}/.config"