Patch reinstall/RDS according to SDK behaviour 32/91432/4 accepted/tizen/common/20161013.155640 accepted/tizen/ivi/20161014.074151 accepted/tizen/mobile/20161014.074046 accepted/tizen/tv/20161014.074110 accepted/tizen/wearable/20161014.074128 submit/tizen/20161012.122424
authorTomasz Iwanek <t.iwanek@samsung.com>
Fri, 7 Oct 2016 07:52:36 +0000 (09:52 +0200)
committerSangyoon Jang <s89.jang@samsung.com>
Wed, 12 Oct 2016 12:11:08 +0000 (05:11 -0700)
Commit changes reinstall request argument. Now pkgid
is expected instead of path to directory. What is more,
if package manifest is not in the directory supplied by
reinstall/RDS then it will be copied from install location.

Application installer expects that SDK will put files into:
 - local installation:
   /home/$USERNAME/apps_rw/tmp/$PKGID/
 - global installation:
   /opt/apps/tmp/$PKGID/

Requires:
 - https://review.tizen.org/gerrit/91412

Submit together:
 - https://review.tizen.org/gerrit/91430
 - https://review.tizen.org/gerrit/91431
 - https://review.tizen.org/gerrit/91432

Verification:
 - run smoke tests,
 - run reinstall from SDK,
 - run RDS from SDK.

Change-Id: I5194dd0a850a62b8712d75e62676c4ee9eebab9f

src/common/step/configuration/step_configure.cc
src/common/step/rds/step_rds_modify.cc
src/common/step/rds/step_rds_modify.h

index e42fec7..b736408 100644 (file)
@@ -64,8 +64,10 @@ Step::Status StepConfigure::process() {
       context_->file_path.set(kStrEmpty);
       break;
     case RequestType::Reinstall:
-      context_->unpacked_dir_path.set(pkgmgr_->GetRequestInfo());
-      context_->pkgid.set(kStrEmpty);
+      context_->unpacked_dir_path.set(
+          context_->root_application_path.get() / "tmp" /
+          pkgmgr_->GetRequestInfo());
+      context_->pkgid.set(pkgmgr_->GetRequestInfo());
       context_->file_path.set(kStrEmpty);
       break;
     case RequestType::Clear:
index 4bf1734..63e4e48 100644 (file)
@@ -50,7 +50,7 @@ Step::Status StepRDSModify::process() {
   }
   context_->pkg_path.set(
         context_->root_application_path.get() /context_->pkgid.get());
-  bf::path install_path = GetAppPath();
+  bf::path install_path = context_->pkg_path.get();
   bf::path unzip_path = context_->unpacked_dir_path.get();
   if (!AddFiles(unzip_path, install_path) ||
      !ModifyFiles(unzip_path, install_path) ||
@@ -159,7 +159,7 @@ bool StepRDSModify::PerformBackup(std::string relative_path,
   if (backup_temp_dir_.empty())
     return false;
   if (operation == Operation::DELETE || operation == Operation::MODIFY) {
-    bf::path app_path = GetAppPath();
+    bf::path app_path = context_->pkg_path.get();
     bf::path source_path = app_path  / relative_path;
     if (bf::is_directory(source_path)) {
       if (!CreateDir(backup_temp_dir_ / relative_path)) {
index 26e3581..62e01d9 100644 (file)
@@ -58,14 +58,6 @@ class StepRDSModify : public Step {
    */
   Status precheck() override;
 
- protected:
-  /**
-   * \brief Parse .rds_delta file
-   *
-   * \return std::string
-   */
-  virtual std::string GetAppPath() = 0;
-
  private:
   enum class Operation {
     ADD,
@@ -88,6 +80,8 @@ class StepRDSModify : public Step {
   std::vector<std::string> files_to_modify_;
   std::vector<std::string> files_to_add_;
   std::vector<std::string> files_to_delete_;
+
+  STEP_NAME(RDSModify)
 };
 
 }  // namespace rds