diff options
-rw-r--r-- | NativeLauncher/installer-plugin/prefer_nuget_cache_plugin.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/NativeLauncher/installer-plugin/prefer_nuget_cache_plugin.cc b/NativeLauncher/installer-plugin/prefer_nuget_cache_plugin.cc index 8d15f6b..f204e72 100644 --- a/NativeLauncher/installer-plugin/prefer_nuget_cache_plugin.cc +++ b/NativeLauncher/installer-plugin/prefer_nuget_cache_plugin.cc @@ -386,16 +386,16 @@ extern "C" int PKGMGR_MDPARSER_PLUGIN_UPGRADE(const char *pkgId, const char *app return 0; } + std::string sql = "SELECT * FROM TAC WHERE PKGID = '" + std::string(pkgId) + "';"; + updateTac = dbSelect(tac_db, TAC_APP_LIST_DB, sql); + if (tacDB.empty()) { - std::string sql = "DELETE FROM TAC WHERE PKGID = '" + std::string(pkgId) + "';"; + sql = "DELETE FROM TAC WHERE PKGID = '" + std::string(pkgId) + "';"; dbDelete(tac_db, TAC_APP_LIST_DB, sql); if (updateTacDB(tac_db) < 0) { return -1; } } else { - std::string sql = "SELECT * FROM TAC WHERE PKGID = '" + std::string(pkgId) + "';"; - updateTac = dbSelect(tac_db, TAC_APP_LIST_DB, sql); - for (auto& np : tacDB) { std::string tac_name = np.substr(0, np.find('/')); std::string tac_version = np.substr(np.rfind('/') + 1); |