From: dyamy-lee Date: Mon, 22 Apr 2024 05:41:26 +0000 (+0900) Subject: Modify OS upgrade script X-Git-Tag: accepted/tizen/8.0/unified/20241011.164854~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F72%2F310072%2F4;p=platform%2Fcore%2Fuifw%2Ftts.git Modify OS upgrade script add local prefix front of the variables add checking the exist of dst_path parent. move changing logic of authorization. Change-Id: Ic109c164633ea7e55905274cd673006f61e57dd6 --- diff --git a/script/migration/tts.sh b/script/migration/tts.sh index 3319b414..52787ef1 100644 --- a/script/migration/tts.sh +++ b/script/migration/tts.sh @@ -19,27 +19,27 @@ function tts_migration() { local SRC_PREV_ENGINE_PATH=$(get_old_rw_path)/usr/home/owner/share/.voice/tts/1.0/engine-info/ if [ -e $SRC_PREV_ENGINE_PATH ]; then - VERSON=$(get_old_platform_version) + local VERSON=$(get_old_platform_version) log I "Previous Version is $VERSION" log I "TTS Migration 7.0 only START" - SRC_PREV_CONF_PATH=$(get_old_rw_path)/usr/home/owner/share/.voice/tts-config.xml - DST_NEW_ENGINE_PATH=$(get_rw_path)/usr/data/.voice/tts/engine-info/ - - # each 7.0 and after 8.0 has different location about configuration. It needs new path. - if [ ! -e $(get_rw_path)/usr/data/.voice/tts/engine-info ]; then - log I "TTS Migration set destination path for only Tizen 7.0" - mkdir -p -m 0775 $(get_rw_path)/usr/data/.voice - chsmack -t $(get_rw_path)/usr/data/.voice - chsmack -a "User::App::Shared" $(get_rw_path)/usr/data/.voice - mkdir -p $(get_rw_path)/usr/data/.voice/tts/engine-info - chsmack -a "User::App::Shared" $(get_rw_path)/usr/data/.voice/tts - chsmack -t $(get_rw_path)/usr/data/.voice/tts/engine-info - chsmack -a "User::App::Shared" $(get_rw_path)/usr/data/.voice/tts/engine-info - chown -R ui_fw:users $(get_rw_path)/usr/data/.voice + local SRC_PREV_CONF_PATH=$(get_old_rw_path)/usr/home/owner/share/.voice/tts-config.xml + local DST_NEW_ENGINE_PATH=$(get_rw_path)/usr/data/.voice/tts/engine-info/ + + # DST_PATH is the same as DST_NEW_ENGINE_PATH parent path + local DST_PARENT_PATH=$(dirname $DST_PATH) + if [ ! -e $DST_PATH ]; then + mkdir -p -m 0775 $DST_PARENT_PATH + chsmack -t $DST_PARENT_PATH + chsmack -a "User::App::Shared" $DST_PARENT_PATH + mkdir -p $DST_PATH + chsmack -a "User::App::Shared" $DST_PATH fi mig_copy $SRC_PREV_ENGINE_PATH $DST_NEW_ENGINE_PATH || error_handle "default_data" $LINENO + chsmack -t $DST_NEW_ENGINE_PATH + chsmack -a "User::App::Shared" $DST_NEW_ENGINE_PATH + # The 'tts-config.xml' file may or may not exist, depending on the condition if [ -e $SRC_PREV_CONF_PATH ]; then ## change backgound_volume_ratio value type from float to integer in 8.0 @@ -55,7 +55,7 @@ function tts_migration() { sed -i "s/[^<]*<\/background-volume-ratio>/${integer_volume_ratio}\<\/background-volume-ratio>/" $SRC_PREV_CONF_PATH mig_copy $SRC_PREV_CONF_PATH $DST_CONF_PATH || error_handle "default_data" $LINENO - chmod 664 $(get_rw_path)/usr/data/.voice/tts-config.xml + chmod 664 $DST_CONF_PATH fi chown -R ui_fw:users $(get_rw_path)/usr/data/.voice @@ -69,6 +69,13 @@ function tts_migration() { return fi + local DST_PARENT_PATH=$(dirname $DST_PATH) + if [ ! -e $DST_PARENT_PATH ]; then + mkdir -p -m 0775 $DST_PARENT_PATH + chsmack -t $DST_PARENT_PATH + chsmack -a "User::App::Shared" $DST_PARENT_PATH + fi + mig_copy $SRC_PATH $DST_PATH || error_handle "default_data" $LINENO # The 'tts-config.xml' file may or may not exist, depending on the condition