Enable ManifestDirectUpdate for ReadonlyUpdateInstalled pkg 32/156432/22
authorJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 18 Oct 2017 09:07:53 +0000 (18:07 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 5 Feb 2018 08:28:51 +0000 (08:28 +0000)
- User can update preload pkg by downloaded pkg
  and its installation procedure is called "ReadonlyUpdateInstall".
- ManifestDirectUpdate for these kind of packages should be enabled
  in case of db corruption.

Change-Id: I403d32f996616d88f96372df91123b35ff6af2a0
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/common/step/configuration/step_parse_preload.cc

index 9f333c2..80db897 100644 (file)
@@ -109,7 +109,9 @@ ci::Step::Status StepParsePreload::process() {
       (req_type == RequestType::Update ||
        req_type == RequestType::Delta ||
        req_type == RequestType::MountUpdate ||
-       req_type == RequestType::ReadonlyUpdateInstall))
+       req_type == RequestType::ReadonlyUpdateInstall ||
+       (req_type == RequestType::ManifestDirectUpdate &&
+           !context_->is_readonly_package.get())))
     manifest->update = strdup("true");
   else
     manifest->update = strdup("false");
@@ -138,6 +140,14 @@ ci::Step::Status StepParsePreload::process() {
   else
     manifest->system = strdup("false");
 
+  if (req_type == RequestType::ManifestDirectUpdate &&
+      pkg_query.IsPreloadPackage() &&
+      !context_->is_readonly_package.get()) {
+    if (manifest->preload)
+      free(manifest->preload);
+    manifest->preload = strdup("true");
+  }
+
   return Status::OK;
 }