*/
int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
+
+/**
+ * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
+ * @brief This API gets the csc path of package
+ *
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] handle pointer to package info handle
+ * @param[out] path pointer to hold csc path of package
+ * @return 0 if success, error code(<0) if fail
+ * @retval PMINFO_R_OK success
+ * @retval PMINFO_R_EINVAL invalid argument
+ * @retval PMINFO_R_ERROR internal error
+ * @code
+static int get_csc_path(const char *pkgid)
+{
+ int ret = 0;
+ char *path = 0;
+ pkgmgrinfo_pkginfo_h handle;
+ ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+
+ ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ return -1;
+ }
+ printf("path : %s\n", path);
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
+
/**
* @fn int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
* @brief This API compare the cert information from given package id
Name: pkgmgr-info
Summary: Packager Manager infomation api for package
-Version: 0.0.114
+Version: 0.0.117
Release: 1
Group: Application Framework/Package Management
License: Apache-2.0
<xs:attribute name="version" use="required" type="xs:NMTOKEN"/>
<xs:attribute name="size" type="xs:NMTOKEN"/>
<xs:attribute name="root_path" type="xs:string"/>
+ <xs:attribute name="csc_path" type="xs:string"/>
<xs:attribute name="appsetting" type="xs:boolean"/>
<xs:attribute name="nodisplay-setting" type="xs:boolean"/>
<xs:attribute name="url" type="xs:string"/>
mfx->type = ASCII(xmlTextReaderGetAttribute(reader, XMLCHAR("type")));
if (xmlTextReaderGetAttribute(reader, XMLCHAR("root_path")))
mfx->root_path = ASCII(xmlTextReaderGetAttribute(reader, XMLCHAR("root_path")));
+ if (xmlTextReaderGetAttribute(reader, XMLCHAR("csc_path")))
+ mfx->csc_path = ASCII(xmlTextReaderGetAttribute(reader, XMLCHAR("csc_path")));
if (xmlTextReaderGetAttribute(reader, XMLCHAR("appsetting"))) {
mfx->appsetting = ASCII(xmlTextReaderGetAttribute(reader, XMLCHAR("appsetting")));
if (mfx->appsetting == NULL)
mfx->preload = strdup("False");
mfx->removable = strdup("True");
mfx->readonly = strdup("False");
+ mfx->update = strdup("False");
char buf[PKG_STRING_LEN_MAX] = {'\0'};
char *val = NULL;
time_t current_time;
#define DESKTOP_RW_PATH "/opt/share/applications/"
#define DESKTOP_RO_PATH "/usr/share/applications/"
+#define MANIFEST_RO_PREFIX "/usr/share/packages/"
static char* __convert_to_system_locale(const char *mlocale)
{
/* desktop shoud be generated automatically based on manifest */
/* Currently removable, taskmanage, etc fields are not considerd. it will be decided soon.*/
#define BUFMAX 1024*128
-static int __ps_make_nativeapp_desktop(manifest_x * mfx, bool is_update)
+static int __ps_make_nativeapp_desktop(manifest_x * mfx, const char *manifest, bool is_update)
{
FILE* file = NULL;
int fd = 0;
for(; mfx->uiapplication; mfx->uiapplication=mfx->uiapplication->next) {
+ if (manifest != NULL) {
+ /* skip making a deskfile and update ail, if preload app is updated */
+ if(strstr(manifest, MANIFEST_RO_PREFIX)) {
+ __ail_change_info(AIL_INSTALL, mfx->uiapplication->appid);
+ DBGE("preload app is update : skip and update ail : %s", manifest);
+ continue;
+ }
+ }
+
if(mfx->readonly && !strcasecmp(mfx->readonly, "True"))
- snprintf(filepath, sizeof(filepath),"%s%s.desktop", DESKTOP_RO_PATH, mfx->uiapplication->appid);
+ snprintf(filepath, sizeof(filepath),"%s%s.desktop", DESKTOP_RO_PATH, mfx->uiapplication->appid);
else
snprintf(filepath, sizeof(filepath),"%s%s.desktop", DESKTOP_RW_PATH, mfx->uiapplication->appid);
return ret;
}
-#define MANIFEST_RO_PREFIX "/usr/share/packages/"
#define PRELOAD_PACKAGE_LIST "/usr/etc/package-manager/preload/preload_list.txt"
static int __add_preload_info(manifest_x * mfx, const char *manifest)
{
uiapplication_x *uiapplication = mfx->uiapplication;
if(strstr(manifest, MANIFEST_RO_PREFIX)) {
-/* if preload app is updated, then remove previous desktop file on RW*/
+ /* if preload app is updated, then remove previous desktop file on RW*/
for(; uiapplication; uiapplication=uiapplication->next) {
snprintf(filepath, sizeof(filepath),"%s%s.desktop", DESKTOP_RW_PATH, uiapplication->appid);
ret = remove(filepath);
if (ret <0)
return -1;
}
-
- return 0;
+ } else {
+ /* if downloaded app is updated, then update tag set true*/
+ free((void *)mfx->update);
+ mfx->update = strdup("true");
}
+
+ return 0;
}
API void pkgmgr_parser_free_manifest_xml(manifest_x *mfx)
free((void *)mfx->root_path);
mfx->root_path = NULL;
}
+ if (mfx->csc_path) {
+ free((void *)mfx->csc_path);
+ mfx->csc_path = NULL;
+ }
if (mfx->appsetting) {
free((void *)mfx->appsetting);
mfx->appsetting = NULL;
__add_preload_info(mfx, manifest);
DBG("Added preload infomation\n");
- snprintf(roxml_check, PKG_STRING_LEN_MAX, MANIFEST_RO_DIRECTORY "/%s.xml", mfx->package);
- if (access(roxml_check, F_OK) == 0)
- mfx->update = strdup("true");
- else
- mfx->update = strdup("false");
-
__ps_process_tag(mfx, tagv);
ret = pkgmgr_parser_insert_manifest_info_in_db(mfx);
else
DBG("DB Insert Success\n");
- ret = __ps_make_nativeapp_desktop(mfx, 0);
+ ret = __ps_make_nativeapp_desktop(mfx, NULL, 0);
if (ret == -1)
DBG("Creating desktop file failed\n");
else
DBG("Manifest pointer is NULL\n");
return -1;
}
- ret = __ps_make_nativeapp_desktop(mfx, 0);
+ ret = __ps_make_nativeapp_desktop(mfx, NULL, 0);
if (ret == -1)
DBG("Creating desktop file failed\n");
else
mfx->preload = strdup("true");
}
- mfx->update = strdup("true");
ret = pkgmgr_parser_update_manifest_info_in_db(mfx);
if (ret == -1)
DBG("DB Update failed\n");
else
DBG("DB Update Success\n");
- ret = __ps_make_nativeapp_desktop(mfx, 1);
+ ret = __ps_make_nativeapp_desktop(mfx, manifest, 1);
if (ret == -1)
DBG("Creating desktop file failed\n");
else
const char *mainapp_id; /**< app id of main application*/
const char *package_url; /**< app id of main application*/
const char *root_path; /**< package root path*/
+ const char *csc_path; /**< package csc path*/
const char *nodisplay_setting; /**< package no display setting menu*/
struct icon_x *icon; /**< package icon*/
struct label_x *label; /**< package label*/
"storeclient_id text," \
"mainapp_id text," \
"package_url text," \
- "root_path text)"
+ "root_path text," \
+ "csc_path text)"
#define QUERY_CREATE_TABLE_PACKAGE_LOCALIZED_INFO "create table if not exists package_localized_info " \
"(package text not null, " \
}
snprintf(query, MAX_QUERY_LEN,
"insert into package_info(package, package_type, package_version, install_location, package_size, " \
- "package_removable, package_preload, package_readonly, package_update, package_appsetting, package_nodisplay, author_name, author_email, author_href, installed_time, installed_storage, storeclient_id, mainapp_id, package_url, root_path) " \
- "values('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",\
+ "package_removable, package_preload, package_readonly, package_update, package_appsetting, package_nodisplay, " \
+ "author_name, author_email, author_href, installed_time, installed_storage, storeclient_id, mainapp_id, package_url, root_path, csc_path) " \
+ "values('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",\
mfx->package, type, mfx->version, mfx->installlocation, mfx->package_size, mfx->removable, mfx->preload,
- mfx->readonly, mfx->update, mfx->appsetting, mfx->nodisplay_setting, auth_name, auth_email, auth_href, mfx->installed_time, mfx->installed_storage, mfx->storeclient_id, mfx->mainapp_id, mfx->package_url, path);
+ mfx->readonly, mfx->update, mfx->appsetting, mfx->nodisplay_setting,
+ auth_name, auth_email, auth_href, mfx->installed_time, mfx->installed_storage, mfx->storeclient_id, mfx->mainapp_id, mfx->package_url, path, mfx->csc_path);
ret = __exec_query(query);
if (ret == -1) {
DBG("Package Info DB Insert Failed\n");
info->manifest_info->root_path = strdup(coltxt[i]);
else
info->manifest_info->root_path = NULL;
+ } else if (strcmp(colname[i], "csc_path") == 0 ){
+ if (coltxt[i])
+ info->manifest_info->csc_path = strdup(coltxt[i]);
+ else
+ info->manifest_info->csc_path = NULL;
} else if (strcmp(colname[i], "privilege") == 0 ){
if (coltxt[i])
info->manifest_info->privileges->privilege->text = strdup(coltxt[i]);
return PMINFO_R_OK;
}
+API int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
+{
+ retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
+ retvm_if(path == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
+
+ pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
+ if (info->manifest_info->csc_path)
+ *path = (char *)info->manifest_info->csc_path;
+ else
+ *path = (char *)info->manifest_info->csc_path;
+
+ return PMINFO_R_OK;
+}
API int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
{
pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
ptr = info->manifest_info->privileges->privilege;
for (; ptr; ptr = ptr->next) {
- ret = privilege_func(ptr->text, user_data);
- if (ret < 0)
- break;
+ if (ptr->text){
+ ret = privilege_func(ptr->text, user_data);
+ if (ret < 0)
+ break;
+ }
}
return PMINFO_R_OK;
}