#define __XSTR(x) #x
#define __STR(x) __XSTR(x)
-static const char* __TAC_DIR = __STR(TAC_DIR);
+static const char* __DOTNET_DIR = __STR(DOTNET_DIR);
#undef __STR
#undef __XSTR
std::string execName;
std::string binPath;
static sqlite3 *tac_db = NULL;
+bool tacPluginInstalled = false;
+bool tacPluginFinished = false;
bool metadataCheck(GList *list)
{
_DBG("[===== PKGMGR_MDPARSER_PLUGIN_INSTALL =====]");
_INFO("PackageID : %s", pkgId);
+ // Can be multiple apps in one package
+ if (tacPluginInstalled) {
+ _INFO("TAC plugin already installed");
+ return 0;
+ }
+ tacPluginInstalled = true;
+
if (!appTypeCheck(std::string(pkgId))) {
_INFO("App type is not dotnet");
return 0;
_INFO("TAC name : %s", tac_name.c_str());
_INFO("TAC version : %s", tac_version.c_str());
- std::string tac_version_dir = concatPath(__TAC_DIR, np);
+ std::string tac_version_dir = concatPath(__DOTNET_DIR, np);
std::string sha256_info = concatPath(tac_version_dir, TAC_SHA_256_INFO);
if (!bf::exists(tac_version_dir)) {
_INFO("Create tac_version_dir [%s]", tac_version_dir.c_str());
return -1;
}
if (count == 0) {
- std::string tac_version_dir_prev = concatPath(__TAC_DIR, unp);
+ std::string tac_version_dir_prev = concatPath(__DOTNET_DIR, unp);
std::string tac_version_dir_backup = tac_version_dir_prev + ".bck";
if (!copyDir(tac_version_dir_prev, tac_version_dir_backup)) {
_ERR("Failed to copy of %s to %s", tac_version_dir_prev.c_str(), tac_version_dir_backup.c_str());
_DBG("[===== PKGMGR_MDPARSER_PLUGIN_UPGRADE =====]");
_INFO("PackageID : %s", pkgId);
+ // Can be multiple apps in one package
+ if (tacPluginInstalled) {
+ _INFO("TAC plugin already upgraded");
+ return 0;
+ }
+ tacPluginInstalled = true;
+
if (!appTypeCheck(std::string(pkgId))) {
_INFO("App type is not dotnet");
return 0;
_INFO("TAC name : %s", tac_name.c_str());
_INFO("TAC version : %s", tac_version.c_str());
- std::string tac_version_dir = concatPath(__TAC_DIR, np);
+ std::string tac_version_dir = concatPath(__DOTNET_DIR, np);
std::string sha256_info = concatPath(tac_version_dir, TAC_SHA_256_INFO);
if (!bf::exists(tac_version_dir)) {
_INFO("Create tac_version_dir [%s]", tac_version_dir.c_str());
_DBG("[===== PKGMGR_MDPARSER_PLUGIN_UNINSTALL =====]");
_INFO("PackageID : %s", pkgId);
+ // Can be multiple apps in one package
+ if (tacPluginInstalled) {
+ _INFO("TAC plugin already uninstalled");
+ return 0;
+ }
+ tacPluginInstalled = true;
+
status = "uninstall";
tac_db = dbOpen(TAC_APP_LIST_DB);
if (!tac_db) {
void cleanStep(std::string tac)
{
- std::string current_tac = concatPath(__TAC_DIR, tac.substr(0, tac.find('/')));
+ std::string current_tac = concatPath(__DOTNET_DIR, tac.substr(0, tac.find('/')));
try {
for (auto& bck : bf::recursive_directory_iterator(current_tac)) {
std::string bck_path = bck.path().string();
_DBG("[===== PKGMGR_MDPARSER_PLUGIN_CLEAN =====]");
_INFO("PackageID : %s", pkgId);
+ // Can be multiple apps in one package
+ if (tacPluginFinished) {
+ _INFO("TAC plugin already finished(CLEAN)");
+ return 0;
+ }
+ tacPluginFinished = true;
+
if (tac_db) {
dbClose(tac_db);
tac_db = NULL;
void undoStep(std::string tac)
{
- std::string current_tac = concatPath(__TAC_DIR, tac.substr(0, tac.find('/')));
+ std::string current_tac = concatPath(__DOTNET_DIR, tac.substr(0, tac.find('/')));
try {
for (auto& bck : bf::recursive_directory_iterator(current_tac)) {
std::string bck_path = bck.path().string();
_DBG("[===== PKGMGR_MDPARSER_PLUGIN_UNDO =====]");
_INFO("PackageID : %s", pkgId);
+ // Can be multiple apps in one package
+ if (tacPluginFinished) {
+ _INFO("TAC plugin already finished(UNDO)");
+ return 0;
+ }
+ tacPluginFinished = true;
+
if (tac_db) {
dbRollback(tac_db);
tac_db = NULL;