From 81aab64a91bfea63f6f3076fec774c747734ccf5 Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Wed, 9 Mar 2016 17:18:58 +0100 Subject: [PATCH] External installation This patch implements installation of package in external sd card storage. Tpk and wgt applications may declare preference of being installed on external storage. If so and space requirement is satisified then their resource directory is installed in sd card with use of app2sd API. Following patchsets should be submitted together: - https://review.tizen.org/gerrit/61678 - https://review.tizen.org/gerrit/61679 - https://review.tizen.org/gerrit/61680 Verify by: - running smoke tests, - running installation, update, deinstallation for package that prefers external installation (SD card must be inserted). Requires: - https://review.tizen.org/gerrit/#/c/64796/ Change-Id: I174c14ddfb48dc2bc1a5935c3b4799abd7f26332 --- src/hybrid/hybrid_backend_data.h | 2 +- src/hybrid/hybrid_installer.cc | 14 ++++++++++---- src/wgt/CMakeLists.txt | 1 - src/wgt/wgt_installer.cc | 16 ++++++++++++++-- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/hybrid/hybrid_backend_data.h b/src/hybrid/hybrid_backend_data.h index 7815a12..9cc98c9 100644 --- a/src/hybrid/hybrid_backend_data.h +++ b/src/hybrid/hybrid_backend_data.h @@ -19,7 +19,7 @@ namespace hybrid { class HybridBackendData : public wgt::WgtBackendData { public: - HybridBackendData() { } + HybridBackendData() : tpk_manifest_data(nullptr) { } ~HybridBackendData() override { if (tpk_manifest_data.get()) pkgmgr_parser_free_manifest_xml(tpk_manifest_data.get()); diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc index dd56988..6dc43ca 100644 --- a/src/hybrid/hybrid_installer.cc +++ b/src/hybrid/hybrid_installer.cc @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -22,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -61,7 +63,6 @@ #include "hybrid/step/configuration/step_stash_tpk_config.h" #include "hybrid/step/encryption/step_encrypt_resources.h" #include "wgt/step/configuration/step_parse.h" -#include "wgt/step/configuration/step_parse_recovery.h" #include "wgt/step/encryption/step_remove_encryption_data.h" #include "wgt/step/filesystem/step_copy_preview_icons.h" #include "wgt/step/filesystem/step_create_symbolic_link.h" @@ -100,6 +101,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -142,6 +144,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -168,6 +171,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep( ci::Plugin::ActionType::Uninstall); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -208,6 +212,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -229,19 +234,20 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep( ci::configuration::StepParseManifest::ManifestLocation::RECOVERY, ci::configuration::StepParseManifest::StoreLocation::NORMAL); - AddStep(); - AddStep(); - AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); break; case ci::RequestType::Clear: AddStep(pkgmgr_); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); AddStep(); break; case ci::RequestType::MountInstall: diff --git a/src/wgt/CMakeLists.txt b/src/wgt/CMakeLists.txt index c160de9..0b4c6d9 100644 --- a/src/wgt/CMakeLists.txt +++ b/src/wgt/CMakeLists.txt @@ -2,7 +2,6 @@ SET(SRCS step/common/privileges.cc step/configuration/step_parse.cc - step/configuration/step_parse_recovery.cc step/encryption/step_encrypt_resources.cc step/encryption/step_remove_encryption_data.cc step/filesystem/step_copy_preview_icons.cc diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index ffb2d59..f15ccf5 100644 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -59,7 +61,6 @@ #include #include "wgt/step/configuration/step_parse.h" -#include "wgt/step/configuration/step_parse_recovery.h" #include "wgt/step/encryption/step_encrypt_resources.h" #include "wgt/step/encryption/step_remove_encryption_data.h" #include "wgt/step/filesystem/step_copy_preview_icons.h" @@ -102,6 +103,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -139,6 +141,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -162,6 +165,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, ci::configuration::StepParseManifest::StoreLocation::NORMAL); AddStep(); + AddStep(); AddStep( ci::Plugin::ActionType::Uninstall); AddStep(); @@ -184,6 +188,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, ci::configuration::StepParseManifest::StoreLocation::BACKUP); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -215,6 +220,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -232,11 +238,14 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) case ci::RequestType::Recovery: { AddStep(pkgmgr_); AddStep(); - AddStep(); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::RECOVERY, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); AddStep(); AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -244,6 +253,9 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) } case ci::RequestType::Clear: { AddStep(pkgmgr_); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); AddStep(); break; } -- 2.7.4