Change order of some steps 53/119053/3
authorBartlomiej <b.kunikowski@partner.samsung.com>
Wed, 15 Mar 2017 08:47:06 +0000 (09:47 +0100)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Mon, 15 May 2017 13:24:28 +0000 (13:24 +0000)
There is a case in recovery, when security manager need
information from pkgmgr database, so we need to ensure that
information about package are stored in pkgmgr database
before the security registration/update step.

Change-Id: I801edb4a6d40be8ae1e4d619409b1580a29795ec

src/tpk/tpk_installer.cc

index 49f608e..e4aa9f9 100644 (file)
@@ -196,10 +196,10 @@ void TpkInstaller::InstallSteps() {
   AddStep<tpk::filesystem::StepCreateSymbolicLink>();
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<ci::filesystem::StepCreateIcons>();
-  AddStep<ci::security::StepRegisterSecurity>();
   AddStep<tpk::pkgmgr::StepConvertXml>();
   AddStep<tpk::pkgmgr::StepManifestAdjustment>();
   AddStep<ci::pkgmgr::StepRegisterApplication>();
+  AddStep<ci::security::StepRegisterSecurity>();
   AddStep<ci::pkgmgr::StepRunParserPlugin>(
       ci::Plugin::ActionType::Install);
   AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>();
@@ -237,10 +237,10 @@ void TpkInstaller::UpdateSteps() {
   AddStep<tpk::filesystem::StepCreateSymbolicLink>();
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<ci::filesystem::StepCreateIcons>();
-  AddStep<ci::security::StepUpdateSecurity>();
   AddStep<tpk::pkgmgr::StepConvertXml>();
   AddStep<tpk::pkgmgr::StepManifestAdjustment>();
   AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepUpdateSecurity>();
   AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Upgrade);
   AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
   AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
@@ -301,10 +301,10 @@ void TpkInstaller::ReinstallSteps() {
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<ci::filesystem::StepCreateIcons>();
   AddStep<tpk::filesystem::StepUpdateExternalStorageDirectories>();
-  AddStep<ci::security::StepUpdateSecurity>();
   AddStep<tpk::pkgmgr::StepConvertXml>();
   AddStep<tpk::pkgmgr::StepManifestAdjustment>();
   AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepUpdateSecurity>();
   AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Upgrade);
   AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
   AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
@@ -343,10 +343,10 @@ void TpkInstaller::DeltaSteps() {
   AddStep<tpk::filesystem::StepCreateSymbolicLink>();
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<ci::filesystem::StepCreateIcons>();
-  AddStep<ci::security::StepUpdateSecurity>();
   AddStep<tpk::pkgmgr::StepConvertXml>();
   AddStep<tpk::pkgmgr::StepManifestAdjustment>();
   AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepUpdateSecurity>();
   AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Upgrade);
   AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
   AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
@@ -378,9 +378,9 @@ void TpkInstaller::RecoverySteps() {
   AddStep<ci::filesystem::StepRecoverFiles>();
   AddStep<ci::mount::StepMountRecover>();
   AddStep<tpk::security::StepTpkRecoverSignature>();
-  AddStep<ci::pkgmgr::StepRecoverApplication>();
   AddStep<ci::filesystem::StepRecoverChangeOwner>();
   AddStep<ci::security::StepRecoverSecurity>();
+  AddStep<ci::pkgmgr::StepRecoverApplication>();
 }
 
 void TpkInstaller::MountInstallSteps() {
@@ -408,10 +408,10 @@ void TpkInstaller::MountInstallSteps() {
   AddStep<tpk::filesystem::StepCreateSymbolicLink>();
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<ci::filesystem::StepCreateIcons>();
-  AddStep<ci::security::StepRegisterSecurity>();
   AddStep<tpk::pkgmgr::StepConvertXml>();
   AddStep<tpk::pkgmgr::StepManifestAdjustment>();
   AddStep<ci::pkgmgr::StepRegisterApplication>();
+  AddStep<ci::security::StepRegisterSecurity>();
   AddStep<ci::pkgmgr::StepRunParserPlugin>(
       ci::Plugin::ActionType::Install);
   AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>();
@@ -448,10 +448,10 @@ void TpkInstaller::MountUpdateSteps() {
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<tpk::filesystem::StepUpdateExternalStorageDirectories>();
   AddStep<ci::filesystem::StepCreateIcons>();
-  AddStep<ci::security::StepUpdateSecurity>();
   AddStep<tpk::pkgmgr::StepConvertXml>();
   AddStep<tpk::pkgmgr::StepManifestAdjustment>();
   AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepUpdateSecurity>();
   AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Upgrade);
   AddStep<ci::filesystem::StepChangeOwnershipAndPermission>(true);
   AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
@@ -477,8 +477,8 @@ void TpkInstaller::ManifestDirectInstallSteps() {
   AddStep<tpk::filesystem::StepCreateSymbolicLink>();
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<ci::security::StepRollbackInstallationSecurity>();
-  AddStep<ci::security::StepRegisterSecurity>();
   AddStep<ci::pkgmgr::StepRegisterApplication>();
+  AddStep<ci::security::StepRegisterSecurity>();
   AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Install);
   AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>();
   AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
@@ -504,8 +504,8 @@ void TpkInstaller::ManifestDirectUpdateSteps() {
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<ci::pkgmgr::StepKillApps>();
   AddStep<ci::security::StepRollbackInstallationSecurity>();
-  AddStep<ci::security::StepRegisterSecurity>();
   AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepRegisterSecurity>();
   AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Upgrade);
   AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
   AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
@@ -522,8 +522,8 @@ void TpkInstaller::ManifestPartialInstallSteps() {
   AddStep<ci::security::StepPrivilegeCompatibility>(
       ci::security::StepPrivilegeCompatibility::InternalPrivType::TPK);
   AddStep<tpk::security::StepCheckTpkBackgroundCategory>();
-  AddStep<ci::security::StepRegisterSecurity>();
   AddStep<ci::pkgmgr::StepRegisterApplication>();
+  AddStep<ci::security::StepRegisterSecurity>();
   AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Install);
   AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>();
   AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
@@ -541,8 +541,8 @@ void TpkInstaller::ManifestPartialUpdateSteps() {
       ci::security::StepPrivilegeCompatibility::InternalPrivType::TPK);
   AddStep<tpk::security::StepCheckTpkBackgroundCategory>();
   AddStep<ci::pkgmgr::StepKillApps>();
-  AddStep<ci::security::StepRegisterSecurity>();
   AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepRegisterSecurity>();
   AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Upgrade);
   AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
 }
@@ -591,10 +591,10 @@ void TpkInstaller::ReadonlyUpdateInstallSteps() {
   AddStep<tpk::filesystem::StepCreateExternalStorageDirectories>();
   AddStep<tpk::filesystem::StepCreateSymbolicLink>();
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
-  AddStep<ci::security::StepUpdateSecurity>();
   AddStep<tpk::pkgmgr::StepConvertXml>();
   AddStep<tpk::pkgmgr::StepManifestAdjustment>();
   AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepUpdateSecurity>();
   AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Upgrade);
   AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
   AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();