From c5672702daa9f435e57fe3fb01cef35888486659 Mon Sep 17 00:00:00 2001 From: dyamy-lee Date: Wed, 3 Apr 2024 17:49:17 +0900 Subject: [PATCH] change background_volume_ratio type in migration script 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 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/script/migration/tts.sh b/script/migration/tts.sh index fec5c19..1ff57e3 100644 --- a/script/migration/tts.sh +++ b/script/migration/tts.sh @@ -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>/${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 -- 2.7.4