scripts/functions: fix debug-shell 1.17
author"Yann E. MORIN" <yann.morin.1998@free.fr>
Thu Nov 22 19:43:26 2012 +0100 (2012-11-22)
branch1.17
changeset 31308db540910974
parent 3129 b8e00eab8f81
scripts/functions: fix debug-shell

Properly catch resuming the build when continuing past the
failed command.

The 'case ;;&' construct is a bash4ism. Get rid of it.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
(transplanted from 2af20cfd210bac338ec18d774458c84fd585ef07)
scripts/functions
     1.1 --- a/scripts/functions	Tue Nov 20 16:59:17 2012 -0800
     1.2 +++ b/scripts/functions	Thu Nov 22 19:43:26 2012 +0100
     1.3 @@ -71,16 +71,15 @@
     1.4                                  printf "\nRe-trying last command.\n\n"
     1.5                                  break
     1.6                              fi
     1.7 -                            ;;&
     1.8 +                            ;;
     1.9                          3)  break;;
    1.10 -                        *)  printf "\nPlease exit with one of these values:\n"
    1.11 -                            printf "    1  fixed, continue with next build command\n"
    1.12 -                            if [ -n "${cur_cmd}" ]; then
    1.13 -                                printf "    2  repeat this build command\n"
    1.14 -                            fi
    1.15 -                            printf "    3  abort build\n"
    1.16 -                            ;;
    1.17                      esac
    1.18 +                    printf "\nPlease exit with one of these values:\n"
    1.19 +                    printf "    1  fixed, continue with next build command\n"
    1.20 +                    if [ -n "${cur_cmd}" ]; then
    1.21 +                        printf "    2  repeat this build command\n"
    1.22 +                    fi
    1.23 +                    printf "    3  abort build\n"
    1.24                  done
    1.25                  exit $result
    1.26              )
    1.27 @@ -88,7 +87,7 @@
    1.28              # Restore the trap handler
    1.29              eval "${old_trap}"
    1.30              case "${result}" in
    1.31 -                1)  rm -f "${CT_WORK_DIR}/backtrace"; return;;
    1.32 +                1)  rm -f "${CT_WORK_DIR}/backtrace"; touch "${CT_BUILD_DIR}/skip"; return;;
    1.33                  2)  rm -f "${CT_WORK_DIR}/backtrace"; touch "${CT_BUILD_DIR}/repeat"; return;;
    1.34                  # 3 is an abort, continue...
    1.35              esac
    1.36 @@ -258,7 +257,12 @@
    1.37          "${@}" 2>&1 |CT_DoLog "${level}"
    1.38          ret="${?}"
    1.39          if [ -f "${CT_BUILD_DIR}/repeat" ]; then
    1.40 +            rm -f "${CT_BUILD_DIR}/repeat"
    1.41              continue
    1.42 +        elif [ -f "${CT_BUILD_DIR}/skip" ]; then
    1.43 +            rm -f "${CT_BUILD_DIR}/skip"
    1.44 +            ret=0
    1.45 +            break
    1.46          else
    1.47              break
    1.48          fi