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;
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 {
dbDelete(tac_db, TAC_APP_LIST_DB, sql);
}
}
- if (updateTacDB(pkgId) < 0) {
+ if (updateTacDB(tac_db) < 0) {
return -1;
}
}
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;
* limitations under the License.
*/
-#include "log.h"
#include "utils.h"
-#include "db_manager.h"
#include "ni_common.h"
#include "tac_common.h"
#include <algorithm>
#include <cstdio>
#include <cstring>
-#include <fstream>
#include <vector>
-#include <pkgmgr-info.h>
-#include <pkgmgr_installer_info.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "DOTNET_INSTALLER_PLUGIN"
-
std::vector<std::string> getCmdArgs(char** begin, char** end)
{
std::vector<std::string> list;