Fix typo and read_consent
authorAndrey Kvochko <a.kvochko@samsung.com>
Thu, 26 Oct 2017 10:41:35 +0000 (13:41 +0300)
committerAndrey Kvochko/SRR-Compiler Lab/./삼성전자 <a.kvochko@samsung.com>
Thu, 26 Oct 2017 10:48:53 +0000 (13:48 +0300)
scripts/common.sh
scripts/prepare-device.sh

index a37688f..6b63156 100755 (executable)
@@ -50,9 +50,9 @@ read_dir() {
 read_consent() {
     local __prompt=$1
     local __result=$2
-    local __tmp=""
-    read_one_of "$__prompt" "Y n" __tmp
-    if [ "$tmp" == "Y" ]; then
+    local __consent=""
+    read_one_of "$__prompt" "Y n" __consent
+    if [ "$__consent" == "Y" ]; then
         export $__result=true
     else
         export $__result=false
@@ -60,7 +60,9 @@ read_consent() {
 }
 
 test_sdb_version() {
-    read_file "sdb was not found. Enter sdb path [] " SDB
+    if [ -z "$SDB" ]; then
+        read_file "sdb was not found. Enter sdb path [] " SDB
+    fi
     ver=( $($SDB version | sed -r 's/.*([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 \2 \3/g') )
     if [[ "${ver[0]}" < "2" ]] || [[ "${ver[1]}" < "3" ]]; then
         echo "Unsupported sdb version:  ${ver[0]}.${ver[1]}.${ver[2]}. Please update sdb to at least 2.3.0"
@@ -76,4 +78,4 @@ test_sdb_version() {
         echo "Error: only one device must be attached"
         exit 1
     fi
-}
\ No newline at end of file
+}
index 8db20f7..8be808d 100755 (executable)
@@ -22,7 +22,7 @@ echo " - /usr/share/dotnet-tizen -> /opt/usr/dotnet-tizen"
 echo " - /usr/lib/debug -> /opt/usr/lib/debug"
 echo " - /usr/src/debug -> /opt/usr/src/debug"
 echo "Symlinks to new locations will be created in old locations."
-5
+
 read_consent "Do you want to proceed?" consent
 if ! $consent; then
    echo "Can not proceed without preparing the device"