From: sooyeon Date: Wed, 21 Sep 2022 05:52:13 +0000 (+0900) Subject: Change engine-info directory and Change file mod X-Git-Tag: accepted/tizen/unified/20220922.062106~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a71596ee4666be5466159f22d12d44736bd326d;p=platform%2Fcore%2Fuifw%2Ftts.git Change engine-info directory and Change file mod Change-Id: Ie643075c6b2fd41044473ceab5f40e82b31e7446 Signed-off-by: sooyeon --- diff --git a/common/tts_config_parser.c b/common/tts_config_parser.c index 35494f6f..8d495b9b 100644 --- a/common/tts_config_parser.c +++ b/common/tts_config_parser.c @@ -559,7 +559,7 @@ int tts_parser_load_config(void) } while (0 != ret); /* Set mode */ - if (0 > chmod(TTS_CONFIG, 0600)) { + if (0 > chmod(TTS_CONFIG, 0644)) { SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to change file mode : %d", ret); } @@ -663,7 +663,7 @@ int tts_parser_copy_xml(const char* original, const char* destination) } /* Set mode */ - if (0 > chmod(destination, 0600)) { + if (0 > chmod(destination, 0644)) { SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to change file mode : %d", ret); } diff --git a/engine-parser/src/tts-engine-language-pack-parser.c b/engine-parser/src/tts-engine-language-pack-parser.c index 19507b73..2199bc3c 100644 --- a/engine-parser/src/tts-engine-language-pack-parser.c +++ b/engine-parser/src/tts-engine-language-pack-parser.c @@ -42,10 +42,9 @@ #define TTS_TAG_ENGINE_VOICE "voice" #define TTS_TAG_ENGINE_VOICE_TYPE "type" -#define TTS_CONFIG_BASE tzplatform_mkpath(TZ_USER_HOME, "share/.voice") -#define TTS_HOME tzplatform_mkpath(TZ_USER_HOME, "share/.voice/tts") -#define TTS_ENGINE_BASE tzplatform_mkpath(TZ_USER_HOME, "share/.voice/tts/1.0") -#define TTS_ENGINE_INFO tzplatform_mkpath(TZ_USER_SHARE, ".voice/tts/1.0/engine-info") +#define TTS_GLOBAL_CONFIG_BASE tzplatform_mkpath(tzplatform_getid("TZ_SYS_GLOBALUSER_DATA"), ".voice") +#define TTS_GLOBAL_HOME tzplatform_mkpath(tzplatform_getid("TZ_SYS_GLOBALUSER_DATA"), ".voice/tts") +#define TTS_GLOBAL_ENGINE_INFO tzplatform_mkpath(tzplatform_getid("TZ_SYS_GLOBALUSER_DATA"), ".voice/tts/engine-info") #define TTS_METADATA_LANGUAGE "http://tizen.org/metadata/tts-engine-language-pack/language" @@ -73,44 +72,35 @@ static int __save_engine_info_xml(const char *pkgid) LOGD("=== Save engine info doc"); /* Make directories */ - if (0 != access(TTS_CONFIG_BASE, F_OK)) { - if (0 != mkdir(TTS_CONFIG_BASE, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) { - LOGE("[ERROR] Fail to make directory : %s", TTS_CONFIG_BASE); + if (0 != access(TTS_GLOBAL_CONFIG_BASE, F_OK)) { + if (0 != mkdir(TTS_GLOBAL_CONFIG_BASE, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) { + LOGE("[ERROR] Fail to make directory : %s", TTS_GLOBAL_CONFIG_BASE); return -1; } else { - LOGD("Success to make directory : %s", TTS_CONFIG_BASE); + LOGD("Success to make directory : %s", TTS_GLOBAL_CONFIG_BASE); } } - if (0 != access(TTS_HOME, F_OK)) { - if (0 != mkdir(TTS_HOME, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) { - LOGE("[ERROR] Fail to make directory : %s", TTS_HOME); + if (0 != access(TTS_GLOBAL_HOME, F_OK)) { + if (0 != mkdir(TTS_GLOBAL_HOME, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) { + LOGE("[ERROR] Fail to make directory : %s", TTS_GLOBAL_HOME); return -1; } else { - LOGD("Success to make directory : %s", TTS_HOME); + LOGD("Success to make directory : %s", TTS_GLOBAL_HOME); } } - if (0 != access(TTS_ENGINE_BASE, F_OK)) { - if (0 != mkdir(TTS_ENGINE_BASE, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) { - LOGE("[ERROR] Fail to make directory : %s", TTS_ENGINE_BASE); + if (0 != access(TTS_GLOBAL_ENGINE_INFO, F_OK)) { + if (0 != mkdir(TTS_GLOBAL_ENGINE_INFO, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) { + LOGE("[ERROR] Fail to make directory : %s", TTS_GLOBAL_ENGINE_INFO); return -1; } else { - LOGD("Success to make directory : %s", TTS_ENGINE_BASE); - } - } - - if (0 != access(TTS_ENGINE_INFO, F_OK)) { - if (0 != mkdir(TTS_ENGINE_INFO, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) { - LOGE("[ERROR] Fail to make directory : %s", TTS_ENGINE_INFO); - return -1; - } else { - LOGD("Success to make directory : %s", TTS_ENGINE_INFO); + LOGD("Success to make directory : %s", TTS_GLOBAL_ENGINE_INFO); } } char path[256] = {'\0',}; - snprintf(path, 256, "%s/%s.xml", TTS_ENGINE_INFO, pkgid); + snprintf(path, 256, "%s/%s.xml", TTS_GLOBAL_ENGINE_INFO, pkgid); int ret = xmlSaveFormatFile(path, g_doc, 1); LOGD("xmlSaveFile (%d)", ret); LOGD("==="); @@ -121,7 +111,7 @@ static int __remove_engine_info_xml(const char *pkgid) { LOGD("=== Remove engine info doc"); char path[256] = {'\0',}; - snprintf(path, 256, "%s/%s.xml", TTS_ENGINE_INFO, pkgid); + snprintf(path, 256, "%s/%s.xml", TTS_GLOBAL_ENGINE_INFO, pkgid); if (0 == access(path, F_OK)) { LOGD("Remove engine info xml(%s)", path); remove(path);