Update upgrade script 74/320874/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Fri, 12 Apr 2024 08:19:57 +0000 (17:19 +0900)
committerSooyeon Kim <sooyeon.kim@samsung.com>
Mon, 25 Nov 2024 06:10:14 +0000 (06:10 +0000)
1. Check for the existence of the source directory
2. Remove the error message for existing destination directories
3. Exclude the 'skel' directory from migration

Change-Id: I7ffcf4cd1afa23c9ce551a7b9782b63e2287b502
(cherry picked from commit 461a25aa20ca64b3b6cc130fbd49264e1f108e4a)

script/migration/stt.sh

index 62e5241524f75606d0b820b1a7d46d028593538b..ccf4a343b5bab4f38fe89da70755aeaa695a9403 100644 (file)
@@ -17,8 +17,6 @@ function set_dst_path() {
         mkdir -p -m 0755 $1
         chsmack -t $1
         chsmack -a "User::App::Shared" $1
-    else
-        log W "Already exist path $1"
     fi
 
     if [ ! -e $1/stt ]; then
@@ -26,8 +24,6 @@ function set_dst_path() {
         mkdir -p -m 0755 $1/stt
         chsmack -t $1/stt
         chsmack -a "User::App::Shared" $1/stt
-    else
-        log W "Already exist path $1/stt"
     fi
 }
 
@@ -39,8 +35,6 @@ function stt_migration() {
     log I "SRC_OWNER_PATH : $SRC_OWNER_PATH"
     local SRC_GUEST_PATH=$(get_old_rw_path)/usr/home/guest/share/.voice/
     log I "SRC_GUEST_PATH : $SRC_GUEST_PATH"
-    local SRC_GLOBAL_PATH=$(get_old_rw_path)/etc/skel/share/.voice/
-    log I "SRC_GLOBAL_PATH : $SRC_GLOBAL_PATH"
     local SRC_CONF_FILE=$(get_old_rw_path)/usr/home/owner/share/.voice/stt-config.xml
     log I "SRC_CONF_FILE : $SRC_CONF_FILE"
 
@@ -48,24 +42,24 @@ function stt_migration() {
     log I "DST_OWNER_PATH : $DST_OWNER_PATH"
     local DST_GUEST_PATH=$(get_rw_path)/usr/home/guest/share/.voice/
     log I "DST_GUEST_PATH : $DST_GUEST_PATH"
-    local DST_GLOBAL_PATH=$(get_rw_path)/etc/skel/share/.voice/
-    log I "DST_GLOBAL_PATH : $DST_GLOBAL_PATH"
 
     set_dst_path $DST_OWNER_PATH
     log I "DST_OWNER_PATH creation completed"
     set_dst_path $DST_GUEST_PATH
     log I "DST_GUEST_PATH creation completed"
-    set_dst_path $DST_GLOBAL_PATH
-    log I "DST_GLOBAL_PATH creation completed"
 
-    mig_copy $SRC_OWNER_PATH/stt $DST_OWNER_PATH/stt || error_handle "default_data" $LINENO
-    log I "mig_copy $SRC_OWNER_PATH/stt $DST_OWNER_PATH/stt"
-    mig_copy $SRC_GUEST_PATH/stt $DST_GUEST_PATH/stt || error_handle "default_data" $LINENO
-    log I "mig_copy $SRC_GUEST_PATH/stt $DST_GUEST_PATH/stt"
-    mig_copy $SRC_GLOBAL_PATH/stt $DST_GLOBAL_PATH/stt || error_handle "default_data" $LINENO
-    log I "mig_copy $SRC_GLOBAL_PATH/stt $DST_GLOBAL_PATH/stt"
-    mig_copy $SRC_CONF_FILE $DST_OWNER_PATH || error_handle "default_data" $LINENO
-    log I "mig_copy $SRC_CONF_FILE $DST_OWNER_PATH "
+    if [ -e $SRC_OWNER_PATH/stt ]; then
+        mig_copy $SRC_OWNER_PATH/stt $DST_OWNER_PATH/stt || error_handle "default_data" $LINENO
+        log I "mig_copy $SRC_OWNER_PATH/stt $DST_OWNER_PATH/stt"
+    fi
+    if [ -e $SRC_GUEST_PATH/stt ]; then
+        mig_copy $SRC_GUEST_PATH/stt $DST_GUEST_PATH/stt || error_handle "default_data" $LINENO
+        log I "mig_copy $SRC_GUEST_PATH/stt $DST_GUEST_PATH/stt"
+    fi
+    if [ -e $SRC_CONF_FILE ]; then
+        mig_copy $SRC_CONF_FILE $DST_OWNER_PATH || error_handle "default_data" $LINENO
+        log I "mig_copy $SRC_CONF_FILE $DST_OWNER_PATH "
+    fi
 
 
     log I "STT Migration DONE"