Merge "Fix coretpk upgrade" into tizen accepted/tizen_common accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable accepted/tizen/common/20150609.084418 accepted/tizen/mobile/20150121.045015 accepted/tizen/tv/20150121.044515 accepted/tizen/wearable/20150121.044748 submit/tizen/20150120.043506 submit/tizen/20150304.022845 submit/tizen_common/20150226.010729 submit/tizen_common/20150608.135929 submit/tizen_mobile/20150121.020049 submit/tizen_tv/20150121.020041 submit/tizen_wearable/20150121.020025
authorSuchang Woo <suchang.woo@samsung.com>
Wed, 14 Jan 2015 08:42:18 +0000 (00:42 -0800)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Wed, 14 Jan 2015 08:42:18 +0000 (00:42 -0800)
1  2 
backend/src/coretpk/coretpk-installer.c

@@@ -490,7 -490,7 +490,7 @@@ static int __check_updated_system_packa
        bool is_system = false;
        pkgmgrinfo_pkginfo_h pkghandle = NULL;
  
-       ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &pkghandle);
+       ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, getuid(), &pkghandle);
        retvm_if(ret < 0, -1, "pkgmgrinfo_pkginfo_get_pkginfo(%s) failed.", pkgid);
  
        ret = pkgmgrinfo_pkginfo_is_system(pkghandle, &is_system);
@@@ -1036,7 -1036,7 +1036,7 @@@ int _coretpk_installer_convert_manifest
        /*run script*/
        if (strstr(manifestfilepath, OPT_USR_APPS)) {
                snprintf(rwmanifest, BUF_SIZE, "%s/%s.xml", OPT_SHARE_PACKAGES, pkgid);
 -              const char *rw_xml_argv[] = { CORETPK_RW_XML_CONVERTER, manifestfilepath, rwmanifest, pkgid, clientid, NULL };
 +              const char *rw_xml_argv[] = { CORETPK_RW_XML_CONVERTER, manifestfilepath, rwmanifest, pkgid, OPT_USR_APPS, clientid, NULL };
                ret = _ri_xsystem(rw_xml_argv);
        } else {
                snprintf(rwmanifest, BUF_SIZE, "%s/%s.xml", USR_SHARE_PACKAGES, pkgid);
@@@ -2339,13 -2339,13 +2339,13 @@@ int _coretpk_installer_package_upgrade(
        _ri_broadcast_status_notification(pkgid, "coretpk", "start", "update");
  
        /*terminate running app*/
-       ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &pkghandle);
+       ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, getuid(), &pkghandle);
        if (ret < 0) {
                _LOGE("failed to get the pkginfo handle.");
                ret = RPM_INSTALLER_ERR_PKG_NOT_FOUND;
                goto err;
        }
-       pkgmgrinfo_appinfo_get_list(pkghandle, PMINFO_UI_APP, __ri_check_running_app, NULL);
+       pkgmgrinfo_appinfo_get_usr_list(pkghandle, PMINFO_UI_APP, __ri_check_running_app, NULL, getuid());
        pkgmgrinfo_pkginfo_destroy_pkginfo(pkghandle);
  
      /*remove dir for clean*/
        _ri_broadcast_status_notification(pkgid, "coretpk", "install_percent", "60");
  
        /*Parse the manifest to get install location and size. If fails, remove manifest info from DB.*/
-       ret = pkgmgr_parser_parse_manifest_for_upgrade(manifest, NULL);
+       ret = pkgmgr_parser_parse_usr_manifest_for_upgrade(manifest, getuid(), NULL);
        if (ret < 0) {
                _LOGE("@parsing manifest failed.");
                ret = RPM_INSTALLER_ERR_INTERNAL;
                        _LOGD("_coretpk_installer_verify_privilege_list(PRVMGR_PACKAGE_TYPE_CORE) is ok.");
                }
        }
  #if 0
        /*reload smack*/
        ret = _ri_smack_reload(pkgid, REQUEST_TYPE_UPGRADE);