scripts: move backtrace marker to CT_WORK_DIR

Avoid error when commands in scripts/crosstool-NG.sh fail
before CT_BUILD_DIR is set.

So we need to remove the backtrace marker of a potential previous
build. Previously, it was implicitly removed because we did remove
the directory it was in, which is no longer the case.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
[yann.morin.1998@free.fr: remove backtrace marker on start of build]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <20121015094615.GA18673@sig21.net>
Patchwork-Id: 191498
This commit is contained in:
Johannes Stezenbach 2012-10-14 23:46:15 +00:00
parent 899981e4c4
commit df3be9eef3
2 changed files with 4 additions and 3 deletions

View File

@ -64,6 +64,7 @@ done
# Where will we work? # Where will we work?
CT_WORK_DIR="${CT_WORK_DIR:-${CT_TOP_DIR}/.build}" CT_WORK_DIR="${CT_WORK_DIR:-${CT_TOP_DIR}/.build}"
CT_DoExecLog ALL mkdir -p "${CT_WORK_DIR}" CT_DoExecLog ALL mkdir -p "${CT_WORK_DIR}"
CT_DoExecLog DEBUG rm -f "${CT_WORK_DIR}/backtrace"
# Check build file system case-sensitiveness # Check build file system case-sensitiveness
CT_DoExecLog DEBUG touch "${CT_WORK_DIR}/foo" CT_DoExecLog DEBUG touch "${CT_WORK_DIR}/foo"

View File

@ -11,8 +11,8 @@ CT_OnError() {
# To avoid printing the backtace for each sub-shell # To avoid printing the backtace for each sub-shell
# up to the top-level, just remember we've dumped it # up to the top-level, just remember we've dumped it
if [ ! -f "${CT_BUILD_DIR}/backtrace" ]; then if [ ! -f "${CT_WORK_DIR}/backtrace" ]; then
touch "${CT_BUILD_DIR}/backtrace" touch "${CT_WORK_DIR}/backtrace"
# Print steps backtrace # Print steps backtrace
step_depth=${CT_STEP_COUNT} step_depth=${CT_STEP_COUNT}
@ -50,7 +50,7 @@ CT_OnError() {
CT_DoLog ERROR "" CT_DoLog ERROR ""
CT_DoEnd ERROR CT_DoEnd ERROR
rm -f "${CT_BUILD_DIR}/backtrace" rm -f "${CT_WORK_DIR}/backtrace"
fi fi
exit $ret exit $ret
} }