From: j-h.choi Date: Thu, 10 Oct 2019 05:40:43 +0000 (+0900) Subject: Code cleanup X-Git-Tag: accepted/tizen/unified/20191011.080132~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0009fc7f35998596dbb0e631d0075f19245bdbe6;p=platform%2Fcore%2Fdotnet%2Flauncher.git Code cleanup --- diff --git a/NativeLauncher/installer-plugin/prefer_nuget_cache_plugin.cc b/NativeLauncher/installer-plugin/prefer_nuget_cache_plugin.cc index 9e6c06b..8d15f6b 100644 --- a/NativeLauncher/installer-plugin/prefer_nuget_cache_plugin.cc +++ b/NativeLauncher/installer-plugin/prefer_nuget_cache_plugin.cc @@ -328,12 +328,12 @@ static int sqliteCb(void *count, int argc, char **argv, char **colName) { return 0; } -int updateTacDB(const char *pkgId) +int updateTacDB(sqlite3 *sqlite) { for (auto& unp : updateTac) { int count = -1; std::string sql = "SELECT COUNT(NUGET) FROM TAC WHERE NUGET = '" + unp + "';"; - int ret = sqlite3_exec(tac_db, sql.c_str(), sqliteCb, &count, NULL); + int ret = sqlite3_exec(sqlite, sql.c_str(), sqliteCb, &count, NULL); if (ret != SQLITE_OK) { _ERR("Sqlite select error"); return -1; @@ -389,7 +389,7 @@ extern "C" int PKGMGR_MDPARSER_PLUGIN_UPGRADE(const char *pkgId, const char *app if (tacDB.empty()) { std::string sql = "DELETE FROM TAC WHERE PKGID = '" + std::string(pkgId) + "';"; dbDelete(tac_db, TAC_APP_LIST_DB, sql); - if (updateTacDB(pkgId) < 0) { + if (updateTacDB(tac_db) < 0) { return -1; } } else { @@ -517,7 +517,7 @@ extern "C" int PKGMGR_MDPARSER_PLUGIN_UPGRADE(const char *pkgId, const char *app dbDelete(tac_db, TAC_APP_LIST_DB, sql); } } - if (updateTacDB(pkgId) < 0) { + if (updateTacDB(tac_db) < 0) { return -1; } } @@ -542,7 +542,7 @@ extern "C" int PKGMGR_MDPARSER_PLUGIN_UNINSTALL(const char *pkgId, const char *a sql = "DELETE FROM TAC WHERE PKGID = '" + std::string(pkgId) + "';"; dbDelete(tac_db, TAC_APP_LIST_DB, sql); - if (updateTacDB(pkgId) < 0) { + if (updateTacDB(tac_db) < 0) { return -1; } return 0; diff --git a/NativeLauncher/tool/dotnettool.cc b/NativeLauncher/tool/dotnettool.cc index 3699372..8f842d0 100644 --- a/NativeLauncher/tool/dotnettool.cc +++ b/NativeLauncher/tool/dotnettool.cc @@ -14,26 +14,15 @@ * limitations under the License. */ -#include "log.h" #include "utils.h" -#include "db_manager.h" #include "ni_common.h" #include "tac_common.h" #include #include #include -#include #include -#include -#include - -#ifdef LOG_TAG -#undef LOG_TAG -#endif -#define LOG_TAG "DOTNET_INSTALLER_PLUGIN" - std::vector getCmdArgs(char** begin, char** end) { std::vector list;