summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2007-06-16 22:23:53 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2007-06-16 22:23:53 (GMT)
commit5e07f7cfc3292f4c185a570546e449b096056da7 (patch)
tree54db73ad95a7ceda786f66fea50de9301fbb7161 /scripts
parentd8bc11b1653185bc826680243cc32b87a6451df2 (diff)
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.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/crosstool.sh7
-rw-r--r--scripts/functions7
-rwxr-xr-xscripts/saveSample.sh3
3 files changed, 9 insertions, 8 deletions
diff --git a/scripts/crosstool.sh b/scripts/crosstool.sh
index 6c78d52..6a88211 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 e14cf35..d66fe22 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 3d58bd9..7a5b57c 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"