From: Sangyoon Jang Date: Mon, 22 Jun 2020 08:38:40 +0000 (+0900) Subject: Fix getting root path at extractor module X-Git-Tag: submit/tizen/20200630.041242~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ee765c567abf4393554894e23b243ccdcc0a87b;p=platform%2Fcore%2Fappfw%2Famd.git Fix getting root path at extractor module Use AMD_AIT_ROOT_PATH instead. Change-Id: I51ac08abce979d343975573caa8bddd71e0892e6 Signed-off-by: Sangyoon Jang --- diff --git a/modules/extractor/src/amd_extractor.c b/modules/extractor/src/amd_extractor.c index 8f576011..28c4373b 100644 --- a/modules/extractor/src/amd_extractor.c +++ b/modules/extractor/src/amd_extractor.c @@ -37,40 +37,16 @@ typedef char **(_extractor_mountable)(const amd_appinfo_h ai); static GHashTable *mount_point_hash; -static const char *__get_app_root_path(const amd_appinfo_h ai) -{ - const char *path_app_root; - const char *global; - const char *preload; - - preload = amd_appinfo_get_value(ai, AMD_AIT_PRELOAD); - global = amd_appinfo_get_value(ai, AMD_AIT_GLOBAL); - if (global && strcmp(global, "true") == 0) { - if (preload && strcmp(preload, "true") == 0) - path_app_root = PATH_GLOBAL_APP_RO_ROOT; - else - path_app_root = PATH_GLOBAL_APP_RW_ROOT; - } else { - path_app_root = PATH_APP_ROOT; - } - - return path_app_root; -} - static char **__extractor_mountable_get_tep_paths(const amd_appinfo_h ai) { char tep_path[PATH_MAX]; char **mnt_path; - const char *pkgid; const char *tep_name; + const char *root_path; if (ai == NULL) return NULL; - pkgid = amd_appinfo_get_value(ai, AMD_AIT_PKGID); - if (pkgid == NULL) - return NULL; - tep_name = amd_appinfo_get_value(ai, AMD_AIT_TEP); if (tep_name == NULL) return NULL; @@ -87,8 +63,9 @@ static char **__extractor_mountable_get_tep_paths(const amd_appinfo_h ai) free(mnt_path); return NULL; } - snprintf(tep_path, PATH_MAX, "%s/%s/tep/mount", - __get_app_root_path(ai), pkgid); + + root_path = amd_appinfo_get_value(ai, AMD_AIT_ROOT_PATH); + snprintf(tep_path, PATH_MAX, "%s/tep/mount", root_path); mnt_path[0] = strdup(tep_path); if (mnt_path[0] == NULL) { _E("Out of memory"); @@ -104,16 +81,12 @@ static char **__extractor_mountable_get_tpk_paths(const amd_appinfo_h ai) { char mount_point[PATH_MAX]; char **mnt_path; - const char *pkgid; const char *tpk; + const char *root_path; if (ai == NULL) return NULL; - pkgid = amd_appinfo_get_value(ai, AMD_AIT_PKGID); - if (pkgid == NULL) - return NULL; - tpk = amd_appinfo_get_value(ai, AMD_AIT_MOUNTABLE_PKG); if (tpk == NULL) return NULL; @@ -130,8 +103,8 @@ static char **__extractor_mountable_get_tpk_paths(const amd_appinfo_h ai) free(mnt_path); return NULL; } - snprintf(mount_point, PATH_MAX, "%s/%s/.pkg", - __get_app_root_path(ai), pkgid); + root_path = amd_appinfo_get_value(ai, AMD_AIT_ROOT_PATH); + snprintf(mount_point, PATH_MAX, "%s/.pkg", root_path); mnt_path[0] = strdup(mount_point); if (mnt_path[0] == NULL) { free(mnt_path[1]);