apply new features : partial install/update/uninstall, force-clean 26/102026/5
authorjongmyeongko <jongmyeong.ko@samsung.com>
Sun, 4 Dec 2016 09:26:07 +0000 (18:26 +0900)
committerjongmyeongko <jongmyeong.ko@samsung.com>
Thu, 8 Dec 2016 13:00:59 +0000 (22:00 +0900)
Submit with:
https://review.tizen.org/gerrit/#/c/103359/
https://review.tizen.org/gerrit/#/c/103361/

Change-Id: I63a24f916d1e8b8a379d579962513ba1551904dc
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
src/hybrid/hybrid_installer.cc
src/wgt/wgt_installer.cc

index 8da9357..ccdd3f7 100644 (file)
@@ -47,6 +47,7 @@
 #include <common/step/mount/step_mount_unpacked.h>
 #include <common/step/mount/step_mount_recover.h>
 #include <common/step/mount/step_mount_update.h>
+#include <common/step/pkgmgr/step_check_force_clean.h>
 #include <common/step/pkgmgr/step_check_installable.h>
 #include <common/step/pkgmgr/step_check_removable.h>
 #include <common/step/pkgmgr/step_check_restriction.h>
@@ -195,6 +196,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
       AddStep<ci::pkgmgr::StepCheckRestriction>();
       AddStep<ci::pkgmgr::StepCheckRemovable>();
+      AddStep<ci::pkgmgr::StepCheckForceClean>();
       AddStep<ci::configuration::StepParseManifest>(
           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
@@ -415,7 +417,6 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
       break;
     case ci::RequestType::ManifestDirectUpdate:
       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
-      AddStep<ci::filesystem::StepUnzip>();
       AddStep<ci::configuration::StepParseManifest>(
           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
@@ -444,6 +445,64 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
       AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
       break;
+    case ci::RequestType::ManifestPartialInstall: {
+      AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+      AddStep<ci::configuration::StepParseManifest>(
+          ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+          ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+      AddStep<hybrid::configuration::StepStashTpkConfig>();
+      AddStep<wgt::configuration::StepParse>(
+          wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
+      AddStep<hybrid::configuration::StepMergeTpkConfig>();
+      AddStep<ci::configuration::StepParsePreload>();
+      AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+      AddStep<ci::security::StepRegisterSecurity>();
+      AddStep<ci::pkgmgr::StepRegisterApplication>();
+      AddStep<ci::pkgmgr::StepRunParserPlugin>(
+          ci::Plugin::ActionType::Install);
+      AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>();
+      AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+      break;
+    }
+    case ci::RequestType::ManifestPartialUpdate: {
+      AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+      AddStep<ci::configuration::StepParseManifest>(
+          ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+          ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+      AddStep<hybrid::configuration::StepStashTpkConfig>();
+      AddStep<wgt::configuration::StepParse>(
+          wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
+      AddStep<hybrid::configuration::StepMergeTpkConfig>();
+      AddStep<ci::configuration::StepParsePreload>();
+      AddStep<ci::configuration::StepParseManifest>(
+          ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+          ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+      AddStep<ci::security::StepUpdateSecurity>();
+      AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+      AddStep<ci::pkgmgr::StepUpdateApplication>();
+      AddStep<ci::pkgmgr::StepRunParserPlugin>(
+          ci::Plugin::ActionType::Upgrade);
+      AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+      break;
+    }
+    case ci::RequestType::PartialUninstall: {
+      AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+      AddStep<ci::pkgmgr::StepCheckRestriction>();
+      AddStep<ci::pkgmgr::StepCheckRemovable>();
+      AddStep<ci::pkgmgr::StepCheckForceClean>();
+      AddStep<ci::configuration::StepParseManifest>(
+          ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+          ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+      AddStep<ci::pkgmgr::StepRunParserPlugin>(
+          ci::Plugin::ActionType::Uninstall);
+      AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+      AddStep<ci::filesystem::StepOptionalAcquireExternalStorage>();
+      AddStep<ci::filesystem::StepRemovePerUserStorageDirectories>();
+      AddStep<ci::pkgmgr::StepUnregisterApplication>();
+      AddStep<wgt::encryption::StepRemoveEncryptionData>();
+      AddStep<ci::security::StepRevokeSecurity>();
+      break;
+    }
     case ci::RequestType::EnablePkg:
       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
       AddStep<ci::configuration::StepParseManifest>(
index 7ca8306..e087ea7 100755 (executable)
@@ -51,6 +51,7 @@
 #include <common/step/mount/step_mount_recover.h>
 #include <common/step/mount/step_mount_unpacked.h>
 #include <common/step/mount/step_mount_update.h>
+#include <common/step/pkgmgr/step_check_force_clean.h>
 #include <common/step/pkgmgr/step_check_installable.h>
 #include <common/step/pkgmgr/step_check_removable.h>
 #include <common/step/pkgmgr/step_check_restriction.h>
@@ -198,6 +199,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
       AddStep<ci::pkgmgr::StepCheckRestriction>();
       AddStep<ci::pkgmgr::StepCheckRemovable>();
+      AddStep<ci::pkgmgr::StepCheckForceClean>();
       AddStep<ci::configuration::StepParseManifest>(
           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
@@ -418,6 +420,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
       AddStep<ci::security::StepRegisterSecurity>();
       AddStep<ci::pkgmgr::StepRegisterApplication>();
       AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Install);
+      AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>();
       AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
       break;
@@ -515,6 +518,57 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
       AddStep<ci::security::StepUpdateSecurity>();
       AddStep<ci::pkgmgr::StepRemoveManifest>();
       AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Upgrade);
+    case ci::RequestType::ManifestPartialInstall: {
+      AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+      AddStep<wgt::configuration::StepParse>(
+          wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
+      AddStep<ci::configuration::StepParsePreload>();
+      AddStep<ci::security::StepPrivilegeCompatibility>(
+          ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
+      AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+      AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+      AddStep<ci::security::StepRegisterSecurity>();
+      AddStep<ci::pkgmgr::StepRegisterApplication>();
+      AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Install);
+      AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>();
+      AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+      break;
+    }
+    case ci::RequestType::ManifestPartialUpdate: {
+      AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+      AddStep<wgt::configuration::StepParse>(
+          wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
+      AddStep<ci::configuration::StepParsePreload>();
+      AddStep<ci::configuration::StepParseManifest>(
+          ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+          ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+      AddStep<ci::security::StepPrivilegeCompatibility>(
+          ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
+      AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+      AddStep<ci::security::StepUpdateSecurity>();
+      AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+      AddStep<ci::pkgmgr::StepUpdateApplication>();
+      AddStep<ci::pkgmgr::StepRunParserPlugin>(
+          ci::Plugin::ActionType::Upgrade);
+      AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+      break;
+    }
+    case ci::RequestType::PartialUninstall: {
+      AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+      AddStep<ci::pkgmgr::StepCheckRestriction>();
+      AddStep<ci::pkgmgr::StepCheckRemovable>();
+      AddStep<ci::pkgmgr::StepCheckForceClean>();
+      AddStep<ci::configuration::StepParseManifest>(
+          ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+          ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+      AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+      AddStep<ci::filesystem::StepOptionalAcquireExternalStorage>();
+      AddStep<ci::pkgmgr::StepRunParserPlugin>(
+          ci::Plugin::ActionType::Uninstall);
+      AddStep<ci::filesystem::StepRemovePerUserStorageDirectories>();
+      AddStep<ci::pkgmgr::StepUnregisterApplication>();
+      AddStep<wgt::encryption::StepRemoveEncryptionData>();
+      AddStep<ci::security::StepRevokeSecurity>();
       break;
     }
     case ci::RequestType::Move: {