From: dyamy-lee Date: Wed, 3 Apr 2024 08:49:17 +0000 (+0900) Subject: change background_volume_ratio type in migration script X-Git-Tag: accepted/tizen/8.0/unified/20241011.164854~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f50c9de2a1d883776d47c869aa0dc7f3547c560;p=platform%2Fcore%2Fuifw%2Ftts.git 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 --- diff --git a/script/migration/tts.sh b/script/migration/tts.sh index fec5c19a..1ff57e38 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