apply new features 08/100908/3
authorjongmyeongko <jongmyeong.ko@samsung.com>
Mon, 28 Nov 2016 16:57:03 +0000 (01:57 +0900)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Wed, 30 Nov 2016 09:08:19 +0000 (01:08 -0800)
- force-clean
- partial install/update

Requires :
https://review.tizen.org/gerrit/#/c/100625/
https://review.tizen.org/gerrit/#/c/100323/
https://review.tizen.org/gerrit/#/c/100891/

Change-Id: Ia5961f7f8704e1cf45181a8848a0cbb0900093c7
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
src/tpk/tpk_installer.cc
src/tpk/tpk_installer.h
src/unit_tests/smoke_test.cc

index 3339865054fd2a4ac9b0af53b251b910c30bfa80..19aad6809dda2e10e34a0ce6ba0167b5a02de358 100644 (file)
@@ -46,6 +46,7 @@
 #include <common/step/mount/step_mount_install.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>
@@ -145,6 +146,9 @@ void TpkInstaller::Prepare() {
     case ci::RequestType::ManifestPartialUpdate:
       ManifestPartialUpdateSteps();
       break;
+    case ci::RequestType::PartialUninstall:
+      PartialUninstallSteps();
+      break;
     case ci::RequestType::Clear:
       ClearSteps();
       break;
@@ -241,6 +245,7 @@ void TpkInstaller::UninstallSteps() {
   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);
@@ -504,7 +509,7 @@ void TpkInstaller::ManifestDirectUpdateSteps() {
   AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
 }
 
-void TpkInstaller::ManifestDirectRWInstallSteps() {
+void TpkInstaller::ManifestPartialInstallSteps() {
   AddStep<ci::configuration::StepConfigure>(pkgmgr_);
   AddStep<ci::configuration::StepParseManifest>(
       ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
@@ -518,7 +523,7 @@ void TpkInstaller::ManifestDirectRWInstallSteps() {
   AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
 }
 
-void TpkInstaller::ManifestDirectRWUpdateSteps() {
+void TpkInstaller::ManifestPartialUpdateSteps() {
   AddStep<ci::configuration::StepConfigure>(pkgmgr_);
   AddStep<ci::configuration::StepParseManifest>(
       ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
@@ -531,6 +536,23 @@ void TpkInstaller::ManifestDirectRWUpdateSteps() {
   AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
 }
 
+void TpkInstaller::PartialUninstallSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  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<tpk::filesystem::StepRemoveExternalStorageDirectories>();
+  AddStep<ci::pkgmgr::StepUnregisterApplication>();
+  AddStep<ci::security::StepRevokeSecurity>();
+}
+
 void TpkInstaller::ClearSteps() {
   AddStep<ci::configuration::StepConfigure>(pkgmgr_);
   AddStep<ci::configuration::StepParseManifest>(
index 89fc60deb4fbd107796db92553d94a41f27b7e9d..0ebeec8b6ab3225be900d3e487160b7f42d7028c 100644 (file)
@@ -42,8 +42,9 @@ class TPK_BACKEND_EXPORT_API TpkInstaller
   void MountUpdateSteps();
   void ManifestDirectInstallSteps();
   void ManifestDirectUpdateSteps();
-  void ManifestDirectRWInstallSteps();
-  void ManifestDirectRWUpdateSteps();
+  void ManifestPartialInstallSteps();
+  void ManifestPartialUpdateSteps();
+  void PartialUninstallSteps();
   void ClearSteps();
 
   SCOPE_LOG_TAG(TpkInstaller)
index 4713aac49846031910544a97c7e55f839579b48a..bff6d31831794424bd8d4cdf3b1222c1ec9aee04 100644 (file)
@@ -518,9 +518,7 @@ TEST_F(SmokeTest, DisablePkg) {
   std::string appid = "smokeapp23.DisablePkg";
   ASSERT_EQ(Install(path), ci::AppInstaller::Result::OK);
   ASSERT_EQ(DisablePackage(pkgid), ci::AppInstaller::Result::OK);
-  ASSERT_FALSE(ci::QueryIsPackageInstalled(pkgid, ci::GetRequestMode(
-      kTestUserId),
-      kTestUserId));
+  ASSERT_TRUE(ci::QueryIsDisabledPackage(pkgid, kTestUserId));
   ValidatePackageFS(pkgid, {appid});
 }