From: 최종헌/MDE Lab(SR)/삼성전자 Date: Wed, 28 May 2025 08:18:35 +0000 (+0900) Subject: Recreate TAC folder after deleting empty folder where assembly does not exist (#627) X-Git-Tag: accepted/tizen/unified/20250604.100251^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9e7dd5e96b7d32e5570eff942bc702b0ac6020af;p=platform%2Fcore%2Fdotnet%2Flauncher.git Recreate TAC folder after deleting empty folder where assembly does not exist (#627) Change-Id: I70c6235067c5eacc8672afd8c434b0d7e1be640f --- diff --git a/NativeLauncher/tool/tac_installer.cc b/NativeLauncher/tool/tac_installer.cc index 675269a..855ab5e 100644 --- a/NativeLauncher/tool/tac_installer.cc +++ b/NativeLauncher/tool/tac_installer.cc @@ -291,13 +291,33 @@ static int generateTAC(TACInfo& tacInfo, const std::string& pkgId, const std::st _INFO("TAC name : %s", tac_name.c_str()); _INFO("TAC version : %s", tac_version.c_str()); - bs::error_code error; std::string tac_version_dir = concatPath(tacInfo.tacLocation, np); std::string sha256_info = concatPath(tac_version_dir, TAC_SHA_256_INFO); bool isCreateTacDir = false; - if (!exist(tac_version_dir)) { + bool isTacExist = false; + if (exist(tac_version_dir)) { + try { + for (auto& file : bf::recursive_directory_iterator(tac_version_dir)) { + std::string filePath = file.path().string(); + if (isNativeImage(filePath)) { + continue; + } + if (isManagedAssembly(filePath)) { + isTacExist = true; + } + } + } catch (const bf::filesystem_error& error) { + _ERR("Failed to recursive directory: %s", error.what()); + isTacExist = true; + } + } + + if (!isTacExist) { _INFO("Create tac_version_dir [%s]", tac_version_dir.c_str()); + //Recreate TAC folder after deleting empty folder where assembly does not exist + removeAll(tac_version_dir); + if (!createDir(tac_version_dir)) { _ERR("Cannot create directory: %s", tac_version_dir.c_str()); tacInfo.tacState = TAC_STATE_RESTORE;