Skip StepClearInstallLocation in the mic step 36/319536/1
authorIlho Kim <ilho159.kim@samsung.com>
Fri, 25 Oct 2024 06:35:58 +0000 (15:35 +0900)
committerIlho Kim <ilho159.kim@samsung.com>
Fri, 25 Oct 2024 06:35:58 +0000 (15:35 +0900)
In the mic step, some files may be created in the package's location in advance
before a package is installed

Change-Id: I1077bc42cb4707805d7d60c3a89bdf1eb02d594a
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/common/step/filesystem/step_clear_install_location.cc

index aaf33cecdda396cfca21527d7c744ccac93f672e..a073289c56c4b5be807a7844d5f91d1f5c9f76a5 100644 (file)
@@ -9,12 +9,22 @@
 #include "common/installer_context.h"
 #include "common/utils/file_util.h"
 
+namespace {
+
+constexpr const char kPathPreloadInstallOnPosttrans[] =
+    "/tmp/.preload_install_on_posttrans";
+
+}  // namespace
+
 namespace fs = std::filesystem;
 
 namespace common_installer {
 namespace filesystem {
 
 Step::Status StepClearInstallLocation::process() {
+  if (access(kPathPreloadInstallOnPosttrans, F_OK) == 0)
+    return Step::Status::OK;
+
   fs::path install_path;
   if (context_->storage.get() == Storage::EXTENDED) {
     install_path = fs::path(GetExtendedRootAppPath(context_->uid.get())) /