change background_volume_ratio type in migration script 87/308987/1
authordyamy-lee <dyamy.lee@samsung.com>
Wed, 3 Apr 2024 08:49:17 +0000 (17:49 +0900)
committerdyamy-lee <dyamy.lee@samsung.com>
Wed, 3 Apr 2024 08:50:35 +0000 (17:50 +0900)
In tizen_8.0, it uses interger value about background_volume_ratio.
So, when it upgrade from 7.0 to 8.0, it's data type also changes together.

Change-Id: I3f3d5c10cc1fb940a8da529898a0ffd0bcb087e5

script/migration/tts.sh

index fec5c19..1ff57e3 100644 (file)
@@ -40,6 +40,19 @@ function tts_migration() {
             return
         fi
 
+        ## change backgound_volume_ratio value type from float to integer in 8.0
+        background_volume_ratio=$(awk -F '<|>' '/background-volume-ratio/{print $3}' $SRC_PREV_CONF_PATH)
+        log I "bg volume = $background_volume_ratio"
+        if [[ "${background_volume_ratio}" =~ ^[0-9]+$ ]]; then
+            integer_volume_ratio=${background_volume_ratio}
+        else
+            integer_volume_ratio=$(echo $background_volume_ratio | awk '{printf "%.2f\n", $1}' | awk '{$1=$1*100; print $1}')
+        fi
+
+        log I "after change bg volume = $integer_volume_ratio"
+        sed -i "s/<background-volume-ratio>[^<]*<\/background-volume-ratio>/<background-volume-ratio>${integer_volume_ratio}\<\/background-volume-ratio>/" $SRC_PREV_CONF_PATH
+
+
         mig_copy $SRC_PREV_ENGINE_PATH $DST_NEW_ENGINE_PATH || error_handle "default_data" $LINENO
         mig_copy $SRC_PREV_CONF_PATH $DST_CONF_PATH || error_handle "default_data" $LINENO