diff options
author | wanchao.xu <wanchao.xu@samsung.com> | 2024-10-14 13:24:09 +0800 |
---|---|---|
committer | wangbiao <biao716.wang@samsung.com> | 2024-10-16 19:15:28 +0900 |
commit | b644a1862f0d02632557be90c78ded7d18c5c48f (patch) | |
tree | 8040ef7add32a04491b234494e6e0fa62c3d3a86 | |
parent | e402da0d3399d7cda87077ab811910d781a10e0f (diff) | |
download | build-resfs/for/devel.tar.gz build-resfs/for/devel.tar.bz2 build-resfs/for/devel.zip |
Cleanup the build root as default action if build system is broken.resfs/for/devel
Change-Id: I0e4ddf8dcfc31e62c880fc35a3333678f85f30bb
Signed-off-by: wanchao.xu <wanchao.xu@samsung.com>
-rwxr-xr-x | init_buildsystem | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/init_buildsystem b/init_buildsystem index aa3a072..1bcbb15 100755 --- a/init_buildsystem +++ b/init_buildsystem @@ -649,19 +649,26 @@ if test -e "$BUILD_IS_RUNNING" ; then echo echo " rm -rf -- $BUILD_ROOT/*" echo + echo "ls /dev/tty*" + ls /dev/tty* echo "y - yes, cleanup the build root" echo "N - No, abort build (default on enter)" echo "c - Continue anyway with this build root" echo -n "[y/N/c] " - read ANSWER - case "$ANSWER" in - c|C) - rm -f $BUILD_IS_RUNNING "$BUILD_ROOT"/exit ;; - y|Y) - clean_build_root ;; - *) - cleanup_and_exit 1 ;; - esac + read ANSWER < /dev/console + if test "$?" -ne 0 ; then + echo "cleanup the build root as default action" + clean_build_root + else + case "$ANSWER" in + c|C) + rm -f $BUILD_IS_RUNNING "$BUILD_ROOT"/exit ;; + y|Y) + clean_build_root ;; + *) + cleanup_and_exit 1 ;; + esac + fi fi # check for surprises |