create error file if the installation of preloaded tpks is failed. 86/61686/5
authorjongmyeongko <jongmyeong.ko@samsung.com>
Thu, 10 Mar 2016 00:54:45 +0000 (09:54 +0900)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Mon, 21 Mar 2016 01:43:21 +0000 (18:43 -0700)
this works in offline mode only.
mic script will detect this error directory.

Change-Id: I77b65d85d55ecbeff8fbf8a7051c4aa4555f3314
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
src/common/app_installer.cc

index e5197a5..34fb6ea 100644 (file)
@@ -4,6 +4,7 @@
 // found in the LICENSE file.
 
 #include <cstdio>
+#include <fstream>
 
 #include "common/app_installer.h"
 #include "common/installer_context.h"
@@ -117,6 +118,16 @@ AppInstaller::Result AppInstaller::Run() {
                       context_->pkg_type.get(),
                       context_->pkgid.get());
   }
+
+  if (context_->installation_mode.get() == InstallationMode::OFFLINE &&
+      context_->is_preload_request.get() &&
+      process_status != Step::Status::OK) {
+    std::fstream info_file("/tmp/.preload_install_error",
+        std::ios::out | std::ios::app);
+    info_file << context_->pkgid.get() << std::endl;
+    info_file.close();
+  }
+
   return ret;
 }