Remove tep update API 17/64817/4
authorTomasz Iwanek <t.iwanek@samsung.com>
Tue, 5 Apr 2016 12:16:09 +0000 (14:16 +0200)
committerTomasz Iwanek <t.iwanek@samsung.com>
Tue, 19 Apr 2016 09:28:19 +0000 (11:28 +0200)
 - pkgmgr_parser_usr_update_tep
 - pkgmgr_parser_update_tep
needed for workaround in application installer are no longer used.

tep_name is inserted into database as part of manifest_x structure passed
to *_process_* APIs.

Requires:
  https://review.tizen.org/gerrit/64814

Change-Id: I77d57744669526151e94c02a0951ba50160f6342

parser/pkgmgr_parser.c
parser/pkgmgr_parser.h
parser/pkgmgr_parser_db.c

index 0919154..885ae8e 100644 (file)
@@ -2011,16 +2011,6 @@ DEPRECATED API manifest_x *pkgmgr_parser_usr_process_manifest_xml(const char *ma
        return mfx;
 }
 
-API int pkgmgr_parser_usr_update_tep(const char *pkgid, const char *tep_path, uid_t uid)
-{
-       return pkgmgr_parser_update_tep_info_in_usr_db(pkgid, tep_path, uid);
-}
-
-API int pkgmgr_parser_update_tep(const char *pkgid, const char *tep_path)
-{
-       return pkgmgr_parser_update_tep_info_in_db(pkgid, tep_path);
-}
-
 DEPRECATED API int pkgmgr_parser_parse_manifest_for_installation(const char *manifest, char *const tagv[])
 {
        retvm_if(manifest == NULL, PMINFO_R_ERROR, "argument supplied is NULL");
index c2d2ee4..4a5323f 100644 (file)
@@ -133,37 +133,6 @@ int pkgmgr_parser_process_manifest_x_for_installation(manifest_x* mfx, const cha
 int pkgmgr_parser_process_usr_manifest_x_for_installation(manifest_x* mfx, const char *manifest, uid_t uid);
 
 /**
- * @fn int pkgmgr_parser_update_tep(const char* pkgid, const char * tep_path)
- * @fn int pkgmgr_parser_usr_update_tep(const char* pkgid, const char* tep_path, uid_t uid)
- * @brief      This API updates tep path information stored in DB.
- *
- * @par                This API is for package-manager installer backends.
- * @par Sync (or) Async : Synchronous API
- *
- * @param[in]  pkgid   pointer to package ID
-  * @param[in]tep_path pointer to path of TEP file
- * @param[in]  uid     the addressee user id of the instruction
- * @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
- * @pre                None
- * @post               None
- * @code
-static int update_tep_info_for_upgrade(const char *pkgid, const char *tep_path)
-{
-       int ret = 0;
-       ret = pkgmgr_parser_update_tep(pkgid, tep_path);
-       if (ret)
-               return -1;
-       return 0;
-}
- * @endcode
- */
-int pkgmgr_parser_update_tep(const char* pkgid, const char* tep_path);
-int pkgmgr_parser_usr_update_tep(const char* pkgid, const char* tep_path, uid_t uid);
-
-/**
  * @fn int pkgmgr_parser_parse_usr_manifest_for_upgrade(const char *manifest,  uid_t uid, char *const tagv[])
  * @fn int pkgmgr_parser_parse_manifest_for_upgrade(const char *manifest, char *const tagv[])
  * @brief      This API parses the manifest file of the package after upgrade and stores the data in DB.
index 02c7243..8055368 100644 (file)
@@ -2712,86 +2712,6 @@ err:
        return ret;
 }
 
-API int pkgmgr_parser_update_tep_info_in_db(const char *pkgid, const char *tep_path)
-{
-       return pkgmgr_parser_update_tep_info_in_usr_db(pkgid, tep_path, _getuid());
-}
-
-API int pkgmgr_parser_update_tep_info_in_usr_db(const char *pkgid, const char *tep_path, uid_t uid)
-{
-       if (pkgid == NULL || tep_path == NULL) {
-               _LOGE("invalid parameter");
-               return -1;
-       }
-
-       int ret = -1;
-       char *query = NULL;
-
-       ret = pkgmgr_parser_check_and_create_db(uid);
-       if (ret == -1) {
-               _LOGD("Failed to open DB\n");
-               return ret;
-       }
-       ret = pkgmgr_parser_initialize_db(uid);
-       if (ret == -1)
-               goto err;
-
-       /*Begin transaction*/
-       ret = sqlite3_exec(pkgmgr_parser_db, "BEGIN EXCLUSIVE", NULL, NULL, NULL);
-       if (ret != SQLITE_OK) {
-               _LOGD("Failed to begin transaction\n");
-               ret = -1;
-               goto err;
-       }
-       _LOGD("Transaction Begin\n");
-
-
-       /* Updating TEP info in "package_info" table */
-       query = sqlite3_mprintf("UPDATE package_info "\
-                                               "SET package_tep_name = %Q "\
-                                               "WHERE package = %Q", tep_path, pkgid);
-
-       ret = __exec_query(query);
-       sqlite3_free(query);
-       if (ret != SQLITE_OK) {
-               ret = PM_PARSER_R_ERROR;
-               _LOGE("sqlite exec failed to insert entries into package_info!!");
-               goto err;
-       }
-
-       /* Updating TEP info in "package_app_info" table */
-       query = sqlite3_mprintf("UPDATE package_app_info "\
-                                               "SET app_tep_name = %Q "\
-                                               "WHERE package = %Q", tep_path, pkgid);
-
-       ret = __exec_query(query);
-       sqlite3_free(query);
-       if (ret != SQLITE_OK) {
-               ret = PM_PARSER_R_ERROR;
-               _LOGE("sqlite exec failed to insert entries into package_app_info!!");
-               goto err;
-       }
-
-       /*Commit transaction*/
-       ret = sqlite3_exec(pkgmgr_parser_db, "COMMIT", NULL, NULL, NULL);
-       if (ret != SQLITE_OK) {
-               _LOGE("Failed to commit transaction, Rollback now\n");
-               ret = sqlite3_exec(pkgmgr_parser_db, "ROLLBACK", NULL, NULL, NULL);
-               if (ret != SQLITE_OK)
-                       _LOGE("Failed to Rollback\n");
-
-               ret = PM_PARSER_R_ERROR;
-               goto err;
-       }
-       _LOGD("Transaction Commit and End\n");
-       ret =  PM_PARSER_R_OK;
-
-err:
-       pkgmgr_parser_close_db();
-       return ret;
-}
-
-
 API int pkgmgr_parser_update_manifest_info_in_usr_db(manifest_x *mfx, uid_t uid)
 {
        if (mfx == NULL) {