Calculate size of preloaded package together 07/109607/1 accepted/tizen/3.0/common/20170116.122612 accepted/tizen/3.0/ivi/20170114.000330 accepted/tizen/3.0/mobile/20170114.000237 accepted/tizen/3.0/tv/20170114.000258 accepted/tizen/3.0/wearable/20170114.000313 accepted/tizen/common/20170112.174522 accepted/tizen/ivi/20170112.222546 accepted/tizen/mobile/20170112.222437 accepted/tizen/tv/20170112.222502 accepted/tizen/wearable/20170112.222525 submit/tizen/20170112.013301 submit/tizen_3.0/20170113.111925
authorSangyoon Jang <s89.jang@samsung.com>
Wed, 11 Jan 2017 02:01:56 +0000 (11:01 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Wed, 11 Jan 2017 02:01:56 +0000 (11:01 +0900)
Change-Id: Id0f18ab05ec96f7068ba6c7e842696a0f515235c
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
src/pkg_getsize.c

index 5ef76a3..acec5d9 100644 (file)
@@ -273,6 +273,11 @@ static int __calculate_pkg_size_info(STORAGE_TYPE type, const char *pkgid,
        if (type == STORAGE_TYPE_INTERNAL_GLOBAL_PATH) {
                snprintf(app_root_dir, sizeof(app_root_dir), "%s",
                        tzplatform_mkpath(TZ_SYS_RW_APP, pkgid));
+               if (access(app_root_dir, F_OK) != 0) {
+                       snprintf(app_root_dir, sizeof(app_root_dir), "%s",
+                                       tzplatform_mkpath(
+                                               TZ_SYS_RO_APP, pkgid));
+               }
        } else if (type == STORAGE_TYPE_INTERNAL_USER_PATH) {
                tzplatform_set_user(target_uid);
                snprintf(app_root_dir, sizeof(app_root_dir), "%s",