scripts: move backtrace marker to CT_WORK_DIR
authorJohannes Stezenbach <js@sig21.net>
Sun Oct 14 23:46:15 2012 +0000 (2012-10-14)
changeset 308239ec9e913d79
parent 3081 697532ca24ee
child 3083 3a7b2eee9dcd
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
scripts/crosstool-NG.sh.in
scripts/functions
     1.1 --- a/scripts/crosstool-NG.sh.in	Wed Oct 17 21:52:59 2012 +0200
     1.2 +++ b/scripts/crosstool-NG.sh.in	Sun Oct 14 23:46:15 2012 +0000
     1.3 @@ -64,6 +64,7 @@
     1.4  # Where will we work?
     1.5  CT_WORK_DIR="${CT_WORK_DIR:-${CT_TOP_DIR}/.build}"
     1.6  CT_DoExecLog ALL mkdir -p "${CT_WORK_DIR}"
     1.7 +CT_DoExecLog DEBUG rm -f "${CT_WORK_DIR}/backtrace"
     1.8  
     1.9  # Check build file system case-sensitiveness
    1.10  CT_DoExecLog DEBUG touch "${CT_WORK_DIR}/foo"
     2.1 --- a/scripts/functions	Wed Oct 17 21:52:59 2012 +0200
     2.2 +++ b/scripts/functions	Sun Oct 14 23:46:15 2012 +0000
     2.3 @@ -11,8 +11,8 @@
     2.4  
     2.5      # To avoid printing the backtace for each sub-shell
     2.6      # up to the top-level, just remember we've dumped it
     2.7 -    if [ ! -f "${CT_BUILD_DIR}/backtrace" ]; then
     2.8 -        touch "${CT_BUILD_DIR}/backtrace"
     2.9 +    if [ ! -f "${CT_WORK_DIR}/backtrace" ]; then
    2.10 +        touch "${CT_WORK_DIR}/backtrace"
    2.11  
    2.12          # Print steps backtrace
    2.13          step_depth=${CT_STEP_COUNT}
    2.14 @@ -50,7 +50,7 @@
    2.15  
    2.16          CT_DoLog ERROR ""
    2.17          CT_DoEnd ERROR
    2.18 -        rm -f "${CT_BUILD_DIR}/backtrace"
    2.19 +        rm -f "${CT_WORK_DIR}/backtrace"
    2.20      fi
    2.21      exit $ret
    2.22  }