settings: Handle return code correctly

"eval $(python3 script.py)" does not handle the return code correctly and would try to evaluate
the complete output of the Python traceback. Temporarily save the output in a variable and check
the return code. If the RC is unequal to zero, return the RC and leave the bash script.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
This commit is contained in:
Daniel Schultz 2021-03-19 17:11:52 +01:00
parent f562d6acfd
commit 969f1dd5ee
6 changed files with 36 additions and 6 deletions

View File

@ -33,4 +33,9 @@ export XRAY_ROI_GRID_Y2="51"
source $(dirname ${BASH_SOURCE[0]})/../utils/environment.sh
eval $(python3 ${XRAY_UTILS_DIR}/create_environment.py)
env=`python3 ${XRAY_UTILS_DIR}/create_environment.py`
ENV_RET=$?
if [[ $ENV_RET != 0 ]] ; then
return $ENV_RET
fi
eval $env

View File

@ -23,4 +23,9 @@ export XRAY_IOI3_TILES="RIOI3_X105Y9 LIOI3_X0Y9"
source $(dirname ${BASH_SOURCE[0]})/../utils/environment.sh
eval $(python3 ${XRAY_UTILS_DIR}/create_environment.py)
env=`python3 ${XRAY_UTILS_DIR}/create_environment.py`
ENV_RET=$?
if [[ $ENV_RET != 0 ]] ; then
return $ENV_RET
fi
eval $env

View File

@ -32,4 +32,9 @@ export XRAY_ROI_GRID_Y2="51"
source $(dirname ${BASH_SOURCE[0]})/../utils/environment.sh
eval $(python3 ${XRAY_UTILS_DIR}/create_environment.py)
env=`python3 ${XRAY_UTILS_DIR}/create_environment.py`
ENV_RET=$?
if [[ $ENV_RET != 0 ]] ; then
return $ENV_RET
fi
eval $env

View File

@ -27,4 +27,9 @@ export XRAY_ROI_GRID_Y2="156"
source $(dirname ${BASH_SOURCE[0]})/../utils/environment.sh
eval $(python3 ${XRAY_UTILS_DIR}/create_environment.py)
env=`python3 ${XRAY_UTILS_DIR}/create_environment.py`
ENV_RET=$?
if [[ $ENV_RET != 0 ]] ; then
return $ENV_RET
fi
eval $env

View File

@ -29,4 +29,9 @@ export XRAY_ROI_GRID_Y2="155"
source $(dirname ${BASH_SOURCE[0]})/../utils/environment.sh
eval $(python3 ${XRAY_UTILS_DIR}/create_environment.py)
env=`python3 ${XRAY_UTILS_DIR}/create_environment.py`
ENV_RET=$?
if [[ $ENV_RET != 0 ]] ; then
return $ENV_RET
fi
eval $env

View File

@ -29,4 +29,9 @@ export XRAY_ROI_GRID_Y2="51"
source $(dirname ${BASH_SOURCE[0]})/../utils/environment.sh
eval $(python3 ${XRAY_UTILS_DIR}/create_environment.py)
env=`python3 ${XRAY_UTILS_DIR}/create_environment.py`
ENV_RET=$?
if [[ $ENV_RET != 0 ]] ; then
return $ENV_RET
fi
eval $env