From 03439d9710749f14ffa8294787c654c221311d0b Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 2 Apr 2021 11:14:04 +0900 Subject: [PATCH] scripts: tizen: sd_fusing: Fix to check file existence The script can be executed with absent file. Fix to check file existence. Change-Id: I2409c73a5dcf4ca011e029b2e3fca9525cd6026a Signed-off-by: Seung-Woo Kim --- scripts/tizen/sd_fusing_rpi3.sh | 10 +++++++--- scripts/tizen/sd_fusing_xu4.sh | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/tizen/sd_fusing_rpi3.sh b/scripts/tizen/sd_fusing_rpi3.sh index bb218178ed..1116b9b664 100755 --- a/scripts/tizen/sd_fusing_rpi3.sh +++ b/scripts/tizen/sd_fusing_rpi3.sh @@ -370,7 +370,7 @@ function check_device () { function print_logo () { echo "" - echo "Raspberry Pi downloader, version 2.0.6" + echo "Raspberry Pi downloader, version 2.0.7" echo "" } @@ -380,9 +380,13 @@ function add_fusing_binary() { local declare binary_name=$1 if [ "$binary_name" != "" ]; then - FUSING_BINARY_ARRAY[$FUSING_BINARY_NUM]=$binary_name + if [ -f "$binary_name" ]; then + FUSING_BINARY_ARRAY[$FUSING_BINARY_NUM]=$binary_name - FUSING_BINARY_NUM=$((FUSING_BINARY_NUM + 1)) + FUSING_BINARY_NUM=$((FUSING_BINARY_NUM + 1)) + else + echo "No such file: $binary_name" + fi fi } diff --git a/scripts/tizen/sd_fusing_xu4.sh b/scripts/tizen/sd_fusing_xu4.sh index 26872ee6aa..e35ad2735f 100755 --- a/scripts/tizen/sd_fusing_xu4.sh +++ b/scripts/tizen/sd_fusing_xu4.sh @@ -396,7 +396,7 @@ function check_device () { function print_logo () { echo "" - echo "[Odroid-XU3/4 downloader version 1.4.4]" + echo "[Odroid-XU3/4 downloader version 1.4.5]" echo "This version also supports Tizen 4.0." echo "" } @@ -407,9 +407,13 @@ function add_fusing_binary() { local declare binary_name=$1 if [ "$binary_name" != "" ]; then - FUSING_BINARY_ARRAY[$FUSING_BINARY_NUM]=$binary_name + if [ -f "$binary_name" ]; then + FUSING_BINARY_ARRAY[$FUSING_BINARY_NUM]=$binary_name - FUSING_BINARY_NUM=$((FUSING_BINARY_NUM + 1)) + FUSING_BINARY_NUM=$((FUSING_BINARY_NUM + 1)) + else + echo "No such file: $binary_name" + fi fi } -- 2.34.1