From eef2a0d751f4d53fb7b475e69e229cb541f7af2c Mon Sep 17 00:00:00 2001 From: Vanou Ishii Date: Wed, 20 Jan 2021 14:15:57 +0900 Subject: [PATCH] Fix Early Use of die function in stack.sh This commit fixes use of die function before it's defined. die function can be used after sourcing $TOP_DIR/functions chain- sources $TOP_DIR/functions-common. Because fixed portion of stack.sh checks existence of $TOP_DIR/inc and sourcing $TOP_DIR/function chain source $TOP_DIR/inc, this commit uses echo & exit command instead of die function. Closes-Bug: #1913021 Change-Id: I5ec174cf7b02269525b1bfd0bfa94ea889d16fce --- stack.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/stack.sh b/stack.sh index 036afd7b00..c334159550 100755 --- a/stack.sh +++ b/stack.sh @@ -96,19 +96,25 @@ fi # templates and other useful files in the ``files`` subdirectory FILES=$TOP_DIR/files if [ ! -d $FILES ]; then - die $LINENO "missing devstack/files" + set +o xtrace + echo "missing devstack/files" + exit 1 fi # ``stack.sh`` keeps function libraries here # Make sure ``$TOP_DIR/inc`` directory is present if [ ! -d $TOP_DIR/inc ]; then - die $LINENO "missing devstack/inc" + set +o xtrace + echo "missing devstack/inc" + exit 1 fi # ``stack.sh`` keeps project libraries here # Make sure ``$TOP_DIR/lib`` directory is present if [ ! -d $TOP_DIR/lib ]; then - die $LINENO "missing devstack/lib" + set +o xtrace + echo "missing devstack/lib" + exit 1 fi # Check if run in POSIX shell