From ccf2c1dc2a33d638f75f320410146919d991b896 Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Fri, 11 Mar 2016 15:28:32 +0900 Subject: [PATCH 01/16] Check removable when uninstall package Requires: - https://review.tizen.org/gerrit/61899 Change-Id: I02ad18a259206b8923825590a16045b9fd489b12 Signed-off-by: Sangyoon Jang --- src/hybrid/hybrid_installer.cc | 2 ++ src/wgt/wgt_installer.cc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc index 8e60fc2..834db03 100644 --- a/src/hybrid/hybrid_installer.cc +++ b/src/hybrid/hybrid_installer.cc @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -136,6 +137,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) break; case ci::RequestType::Uninstall: AddStep(pkgmgr_); + AddStep(); AddStep( ci::parse::StepParseManifest::ManifestLocation::INSTALLED, ci::parse::StepParseManifest::StoreLocation::NORMAL); diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index c1c4e7f..fa66402 100644 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -130,6 +131,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) } case ci::RequestType::Uninstall: { AddStep(pkgmgr_); + AddStep(); AddStep( ci::parse::StepParseManifest::ManifestLocation::INSTALLED, ci::parse::StepParseManifest::StoreLocation::NORMAL); -- 2.7.4 From 636778918a662fcf965c32c68992883ea382df8c Mon Sep 17 00:00:00 2001 From: Arkadiusz Szulakiewicz Date: Mon, 7 Mar 2016 12:33:34 +0100 Subject: [PATCH 02/16] Add tests for Metadata and Setting element in config.xml Change-Id: Ie32b9d76151ea7ba119f5a742a38caa23cda9f37 --- src/unit_tests/manifest_test.cc | 75 ++++++++++++++++++++++ .../config.xml | 7 ++ .../config.xml | 5 ++ .../config.xml | 6 ++ .../ManifestTest.MetadataElement_Valid/config.xml | 6 ++ .../config.xml | 12 ++++ .../config.xml | 11 ++++ .../config.xml | 11 ++++ .../config.xml | 11 ++++ .../config.xml | 11 ++++ .../config.xml | 11 ++++ .../config.xml | 11 ++++ .../config.xml | 11 ++++ .../config.xml | 11 ++++ .../config.xml | 11 ++++ .../config.xml | 10 +++ .../config.xml | 10 +++ .../config.xml | 10 +++ .../config.xml | 10 +++ .../config.xml | 10 +++ .../config.xml | 10 +++ .../config.xml | 10 +++ .../ManifestTest.SettingElement_Valid/config.xml | 11 ++++ 23 files changed, 291 insertions(+) create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_DuplicateKey/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingKey/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingValue/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_Valid/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportDisabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportEnabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationDisabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationEnabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuDisabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuEnabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionDisabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionEnabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyDisabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyEnabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundSupport/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundVibration/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingContextMenu/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingEncryption/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingHwKeyEvent/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingInstallLocation/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingScreenOrientation/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_Valid/config.xml diff --git a/src/unit_tests/manifest_test.cc b/src/unit_tests/manifest_test.cc index 9eee758..183e0b4 100644 --- a/src/unit_tests/manifest_test.cc +++ b/src/unit_tests/manifest_test.cc @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -215,6 +216,7 @@ TEST_F(ManifestTest, PrivilegeElement_MissingName) { ASSERT_FALSE(runner.Run()); } + TEST_F(ManifestTest, AppControlElement_Valid) { StepParseRunner runner(GetMyName()); ASSERT_TRUE(runner.Run()); @@ -464,3 +466,76 @@ TEST_F(ManifestTest, SettingsElement_MissingScreenOrientation) { ASSERT_EQ(settings.screen_orientation(), wgt::parse::SettingInfo::ScreenOrientation::AUTO); } + +TEST_F(ManifestTest, MetadataElement_Valid) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + + std::map meta_data_map; + for (metadata_x* meta_data : GListRange(app->metadata)) { + if (meta_data->value) + meta_data_map[meta_data->key] = meta_data->value; + else + meta_data_map[meta_data->key] = std::string(); + } + ASSERT_EQ(meta_data_map.size(), 2); + ASSERT_CSTR_EQ(meta_data_map["key1"].c_str(), ""); + ASSERT_CSTR_EQ(meta_data_map["key2"].c_str(), "value2"); +} + +TEST_F(ManifestTest, MetadataElement_DuplicateKey) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + + std::map meta_data_map; + for (metadata_x* meta_data : GListRange(app->metadata)) { + meta_data_map[meta_data->key] = meta_data->value; + } + ASSERT_EQ(meta_data_map.size(), 2); + ASSERT_CSTR_EQ(meta_data_map["key1"].c_str(), "key1value"); + ASSERT_CSTR_EQ(meta_data_map["key2"].c_str(), "key2value"); +} + +TEST_F(ManifestTest, MetadataElement_MissingValue) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + + std::map meta_data_map; + for (metadata_x* meta_data : GListRange(app->metadata)) { + if (meta_data->value) + meta_data_map[meta_data->key] = meta_data->value; + else + meta_data_map[meta_data->key] = std::string(); + } + ASSERT_EQ(meta_data_map.size(), 2); + ASSERT_CSTR_EQ(meta_data_map["key1"].c_str(), ""); + ASSERT_CSTR_EQ(meta_data_map["key2"].c_str(), ""); +} + +TEST_F(ManifestTest, MetadataElement_MissingKey) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + + std::map meta_data_map; + for (metadata_x* meta_data : GListRange(app->metadata)) { + if (meta_data->key && meta_data->value) + meta_data_map[meta_data->key] = meta_data->value; + } + ASSERT_EQ(meta_data_map.size(), 0); +} diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_DuplicateKey/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_DuplicateKey/config.xml new file mode 100644 index 0000000..5cafe7e --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_DuplicateKey/config.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingKey/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingKey/config.xml new file mode 100644 index 0000000..66bbf64 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingKey/config.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingValue/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingValue/config.xml new file mode 100644 index 0000000..9f21ae3 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingValue/config.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_Valid/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_Valid/config.xml new file mode 100644 index 0000000..353cfc3 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_Valid/config.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportDisabled/config.xml new file mode 100644 index 0000000..ef25267 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportDisabled/config.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportEnabled/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportEnabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationDisabled/config.xml new file mode 100644 index 0000000..421c7b1 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationDisabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationEnabled/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationEnabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuDisabled/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuDisabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuEnabled/config.xml new file mode 100644 index 0000000..1f688a2 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuEnabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionDisabled/config.xml new file mode 100644 index 0000000..441d232 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionDisabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionEnabled/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionEnabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyDisabled/config.xml new file mode 100644 index 0000000..3b10bc5 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyDisabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyEnabled/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyEnabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundSupport/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundSupport/config.xml new file mode 100644 index 0000000..ed8fc2a --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundSupport/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundVibration/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundVibration/config.xml new file mode 100644 index 0000000..798ae31 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundVibration/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingContextMenu/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingContextMenu/config.xml new file mode 100644 index 0000000..bd72968 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingContextMenu/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingEncryption/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingEncryption/config.xml new file mode 100644 index 0000000..699bdcd --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingEncryption/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingHwKeyEvent/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingHwKeyEvent/config.xml new file mode 100644 index 0000000..5ec89c9 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingHwKeyEvent/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingInstallLocation/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingInstallLocation/config.xml new file mode 100644 index 0000000..523fde8 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingInstallLocation/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingScreenOrientation/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingScreenOrientation/config.xml new file mode 100644 index 0000000..b2b92f3 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingScreenOrientation/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_Valid/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_Valid/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_Valid/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + -- 2.7.4 From a7ce47d8b75b0a67e62a53eef99d97b7ff0890f9 Mon Sep 17 00:00:00 2001 From: Arkadiusz Szulakiewicz Date: Mon, 7 Mar 2016 16:07:55 +0100 Subject: [PATCH 03/16] Add tests for Category element in config.xml Change-Id: Icafa7a6120978d2368966438d1b70ed77e937738 --- src/unit_tests/manifest_test.cc | 54 ++++++++++++++++++++++ .../config.xml | 5 ++ .../config.xml | 7 +++ .../ManifestTest.CategoryElement_Valid/config.xml | 5 ++ 4 files changed, 71 insertions(+) create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MissingName/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MultipleElements/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_Valid/config.xml diff --git a/src/unit_tests/manifest_test.cc b/src/unit_tests/manifest_test.cc index 183e0b4..da14f60 100644 --- a/src/unit_tests/manifest_test.cc +++ b/src/unit_tests/manifest_test.cc @@ -539,3 +539,57 @@ TEST_F(ManifestTest, MetadataElement_MissingKey) { } ASSERT_EQ(meta_data_map.size(), 0); } + +TEST_F(ManifestTest, CategoryElement_Valid) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + + std::vector categories; + for (const char* category : GListRange(app->category)) { + categories.push_back(category); + } + ASSERT_EQ(categories.size(), 1); + ASSERT_CSTR_EQ(categories[0].c_str(), + "http://tizen.org/category/wearable_clock"); +} + +TEST_F(ManifestTest, CategoryElement_MissingName) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + + std::vector categories; + for (const char* category : GListRange(app->category)) { + categories.push_back(category); + } + ASSERT_TRUE(categories.empty()); +} + +TEST_F(ManifestTest, CategoryElement_MultipleElements) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + + std::vector categories; + for (const char* category : GListRange(app->category)) { + categories.push_back(category); + } + ASSERT_EQ(categories.size(), 3); + ASSERT_CSTR_EQ(categories[0].c_str(), + "http://tizen.org/category/category_0"); + ASSERT_CSTR_EQ(categories[1].c_str(), + "http://tizen.org/category/category_1"); + ASSERT_CSTR_EQ(categories[2].c_str(), + "http://tizen.org/category/category_2"); + +} diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MissingName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MissingName/config.xml new file mode 100644 index 0000000..698d3fd --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MissingName/config.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MultipleElements/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MultipleElements/config.xml new file mode 100644 index 0000000..5e2a900 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MultipleElements/config.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_Valid/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_Valid/config.xml new file mode 100644 index 0000000..55de5ee --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_Valid/config.xml @@ -0,0 +1,5 @@ + + + + + -- 2.7.4 From ab0a6e3c873903e38615d818faf041d855db397a Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Thu, 17 Mar 2016 14:58:06 +0100 Subject: [PATCH 04/16] Fix typo in StepGenerateXml Change-Id: Iebba5702b4ce032f35836e7ede12c93a57e2284e --- src/wgt/step/step_generate_xml.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wgt/step/step_generate_xml.cc b/src/wgt/step/step_generate_xml.cc index 176c908..a90b3bb 100644 --- a/src/wgt/step/step_generate_xml.cc +++ b/src/wgt/step/step_generate_xml.cc @@ -119,10 +119,10 @@ common_installer::Step::Status StepGenerateXml::GenerateApplicationCommonXml( // app-specific attributes switch (type) { case AppCompType::UIAPP: - WriteServiceApplicationAttributes(writer, app); + WriteUIApplicationAttributes(writer, app); break; case AppCompType::SVCAPP: - WriteUIApplicationAttributes(writer, app); + WriteServiceApplicationAttributes(writer, app); break; case AppCompType::WIDGETAPP: WriteWidgetApplicationAttributes(writer, app); -- 2.7.4 From c15c6a779b0c5bce5bf96cb2315b6b190438e7e6 Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Thu, 10 Mar 2016 14:14:03 +0100 Subject: [PATCH 05/16] Rework step/ directory structure Steps are moved to subdirectories according to their namespace. Submit together with: - https://review.tizen.org/gerrit/61795 - https://review.tizen.org/gerrit/61796 - https://review.tizen.org/gerrit/61797 Build to verify, no logic changes were made. Change-Id: Idb6548add52b29a92837d15ef7180587fe902d29 --- src/hybrid/CMakeLists.txt | 8 +- src/hybrid/hybrid_installer.cc | 180 ++++++++++----------- .../{ => configuration}/step_merge_tpk_config.cc | 6 +- .../{ => configuration}/step_merge_tpk_config.h | 10 +- src/hybrid/step/{ => configuration}/step_parse.cc | 6 +- src/hybrid/step/{ => configuration}/step_parse.h | 16 +- .../{ => configuration}/step_stash_tpk_config.cc | 6 +- .../{ => configuration}/step_stash_tpk_config.h | 10 +- .../{ => encryption}/step_encrypt_resources.cc | 6 +- .../step/{ => encryption}/step_encrypt_resources.h | 16 +- src/unit_tests/manifest_test.cc | 4 +- src/unit_tests/smoke_test.cc | 2 +- src/wgt/CMakeLists.txt | 28 ++-- src/wgt/step/{ => configuration}/step_parse.cc | 89 +++++----- src/wgt/step/{ => configuration}/step_parse.h | 12 +- .../{ => configuration}/step_parse_recovery.cc | 6 +- .../step/{ => configuration}/step_parse_recovery.h | 12 +- .../{ => encryption}/step_encrypt_resources.cc | 6 +- .../step/{ => encryption}/step_encrypt_resources.h | 10 +- .../step_remove_encryption_data.cc | 6 +- .../{ => encryption}/step_remove_encryption_data.h | 10 +- .../{ => filesystem}/step_create_symbolic_link.cc | 2 +- .../{ => filesystem}/step_create_symbolic_link.h | 6 +- .../step/{ => filesystem}/step_wgt_patch_icons.cc | 2 +- .../step/{ => filesystem}/step_wgt_patch_icons.h | 6 +- .../step_wgt_patch_storage_directories.cc | 2 +- .../step_wgt_patch_storage_directories.h | 6 +- .../step_wgt_resource_directory.cc | 2 +- .../{ => filesystem}/step_wgt_resource_directory.h | 6 +- src/wgt/step/{ => pkgmgr}/step_generate_xml.cc | 2 +- src/wgt/step/{ => pkgmgr}/step_generate_xml.h | 6 +- src/wgt/step/{ => rds}/step_rds_modify.cc | 2 +- src/wgt/step/{ => rds}/step_rds_modify.h | 7 +- src/wgt/step/{ => rds}/step_rds_parse.cc | 2 +- src/wgt/step/{ => rds}/step_rds_parse.h | 8 +- .../{ => security}/step_add_default_privileges.cc | 2 +- .../{ => security}/step_add_default_privileges.h | 6 +- .../{ => security}/step_check_settings_level.cc | 2 +- .../{ => security}/step_check_settings_level.h | 6 +- .../step_check_wgt_background_category.cc | 2 +- .../step_check_wgt_background_category.h | 8 +- src/wgt/wgt_installer.cc | 161 +++++++++--------- 42 files changed, 351 insertions(+), 344 deletions(-) rename src/hybrid/step/{ => configuration}/step_merge_tpk_config.cc (87%) rename src/hybrid/step/{ => configuration}/step_merge_tpk_config.h (76%) rename src/hybrid/step/{ => configuration}/step_parse.cc (78%) rename src/hybrid/step/{ => configuration}/step_parse.h (59%) rename src/hybrid/step/{ => configuration}/step_stash_tpk_config.cc (82%) rename src/hybrid/step/{ => configuration}/step_stash_tpk_config.h (75%) rename src/hybrid/step/{ => encryption}/step_encrypt_resources.cc (75%) rename src/hybrid/step/{ => encryption}/step_encrypt_resources.h (53%) rename src/wgt/step/{ => configuration}/step_parse.cc (87%) rename src/wgt/step/{ => configuration}/step_parse.h (88%) rename src/wgt/step/{ => configuration}/step_parse_recovery.cc (92%) rename src/wgt/step/{ => configuration}/step_parse_recovery.h (82%) rename src/wgt/step/{ => encryption}/step_encrypt_resources.cc (98%) rename src/wgt/step/{ => encryption}/step_encrypt_resources.h (87%) rename src/wgt/step/{ => encryption}/step_remove_encryption_data.cc (93%) rename src/wgt/step/{ => encryption}/step_remove_encryption_data.h (78%) rename src/wgt/step/{ => filesystem}/step_create_symbolic_link.cc (97%) rename src/wgt/step/{ => filesystem}/step_create_symbolic_link.h (86%) rename src/wgt/step/{ => filesystem}/step_wgt_patch_icons.cc (96%) rename src/wgt/step/{ => filesystem}/step_wgt_patch_icons.h (83%) rename src/wgt/step/{ => filesystem}/step_wgt_patch_storage_directories.cc (97%) rename src/wgt/step/{ => filesystem}/step_wgt_patch_storage_directories.h (82%) rename src/wgt/step/{ => filesystem}/step_wgt_resource_directory.cc (95%) rename src/wgt/step/{ => filesystem}/step_wgt_resource_directory.h (88%) rename src/wgt/step/{ => pkgmgr}/step_generate_xml.cc (99%) rename src/wgt/step/{ => pkgmgr}/step_generate_xml.h (88%) rename src/wgt/step/{ => rds}/step_rds_modify.cc (99%) rename src/wgt/step/{ => rds}/step_rds_modify.h (94%) rename src/wgt/step/{ => rds}/step_rds_parse.cc (97%) rename src/wgt/step/{ => rds}/step_rds_parse.h (90%) rename src/wgt/step/{ => security}/step_add_default_privileges.cc (93%) rename src/wgt/step/{ => security}/step_add_default_privileges.h (86%) rename src/wgt/step/{ => security}/step_check_settings_level.cc (96%) rename src/wgt/step/{ => security}/step_check_settings_level.h (87%) rename src/wgt/step/{ => security}/step_check_wgt_background_category.cc (92%) rename src/wgt/step/{ => security}/step_check_wgt_background_category.h (74%) diff --git a/src/hybrid/CMakeLists.txt b/src/hybrid/CMakeLists.txt index 040d9fc..0e2418f 100644 --- a/src/hybrid/CMakeLists.txt +++ b/src/hybrid/CMakeLists.txt @@ -1,8 +1,8 @@ SET(SRCS - step/step_encrypt_resources.cc - step/step_merge_tpk_config.cc - step/step_parse.cc - step/step_stash_tpk_config.cc + step/configuration/step_merge_tpk_config.cc + step/configuration/step_parse.cc + step/configuration/step_stash_tpk_config.cc + step/encryption/step_encrypt_resources.cc hybrid_installer.cc ) ADD_LIBRARY(${TARGET_LIBNAME_HYBRID} STATIC ${SRCS}) diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc index 834db03..b12354d 100644 --- a/src/hybrid/hybrid_installer.cc +++ b/src/hybrid/hybrid_installer.cc @@ -4,62 +4,62 @@ #include "hybrid/hybrid_installer.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include +#include +#include #include "hybrid/hybrid_backend_data.h" -#include "hybrid/step/step_encrypt_resources.h" -#include "hybrid/step/step_merge_tpk_config.h" -#include "hybrid/step/step_stash_tpk_config.h" -#include "hybrid/step/step_parse.h" -#include "wgt/step/step_check_settings_level.h" -#include "wgt/step/step_check_wgt_background_category.h" -#include "wgt/step/step_create_symbolic_link.h" -#include "wgt/step/step_generate_xml.h" -#include "wgt/step/step_parse_recovery.h" -#include "wgt/step/step_remove_encryption_data.h" -#include "wgt/step/step_wgt_patch_icons.h" -#include "wgt/step/step_wgt_patch_storage_directories.h" +#include "hybrid/step/configuration/step_merge_tpk_config.h" +#include "hybrid/step/configuration/step_parse.h" +#include "hybrid/step/configuration/step_stash_tpk_config.h" +#include "hybrid/step/encryption/step_encrypt_resources.h" +#include "wgt/step/configuration/step_parse_recovery.h" +#include "wgt/step/encryption/step_remove_encryption_data.h" +#include "wgt/step/filesystem/step_create_symbolic_link.h" +#include "wgt/step/filesystem/step_wgt_patch_icons.h" +#include "wgt/step/filesystem/step_wgt_patch_storage_directories.h" +#include "wgt/step/pkgmgr/step_generate_xml.h" +#include "wgt/step/security/step_check_settings_level.h" +#include "wgt/step/security/step_check_wgt_background_category.h" namespace ci = common_installer; @@ -73,17 +73,17 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) case ci::RequestType::Install: AddStep(pkgmgr_); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::PACKAGE, - ci::parse::StepParseManifest::StoreLocation::NORMAL); - AddStep(); - AddStep(true); - AddStep(); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::PACKAGE, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); + AddStep(); + AddStep(true); + AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -103,21 +103,21 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) case ci::RequestType::Update: AddStep(pkgmgr_); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::PACKAGE, - ci::parse::StepParseManifest::StoreLocation::NORMAL); - AddStep(); - AddStep(true); - AddStep(); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::PACKAGE, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); + AddStep(); + AddStep(true); + AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::INSTALLED, - ci::parse::StepParseManifest::StoreLocation::BACKUP); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::BACKUP); AddStep(); AddStep(); AddStep(); @@ -138,9 +138,9 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) case ci::RequestType::Uninstall: AddStep(pkgmgr_); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::INSTALLED, - ci::parse::StepParseManifest::StoreLocation::NORMAL); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); AddStep( ci::Plugin::ActionType::Uninstall); AddStep(); @@ -149,7 +149,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(); AddStep(); break; @@ -160,22 +160,22 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) case ci::RequestType::Delta: AddStep(pkgmgr_); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::PACKAGE, - ci::parse::StepParseManifest::StoreLocation::NORMAL); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::PACKAGE, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); AddStep(); - AddStep(); - AddStep(true); - AddStep(); + AddStep(); + AddStep(true); + AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::INSTALLED, - ci::parse::StepParseManifest::StoreLocation::BACKUP); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::BACKUP); AddStep(); AddStep(); AddStep(); @@ -196,12 +196,12 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) case ci::RequestType::Recovery: AddStep(pkgmgr_); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::RECOVERY, - ci::parse::StepParseManifest::StoreLocation::NORMAL); - AddStep(); - AddStep(); - AddStep(); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::RECOVERY, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); + AddStep(); + AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); diff --git a/src/hybrid/step/step_merge_tpk_config.cc b/src/hybrid/step/configuration/step_merge_tpk_config.cc similarity index 87% rename from src/hybrid/step/step_merge_tpk_config.cc rename to src/hybrid/step/configuration/step_merge_tpk_config.cc index 77f8407..913ad98 100644 --- a/src/hybrid/step/step_merge_tpk_config.cc +++ b/src/hybrid/step/configuration/step_merge_tpk_config.cc @@ -2,14 +2,14 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#include "hybrid/step/step_merge_tpk_config.h" +#include "hybrid/step/configuration/step_merge_tpk_config.h" #include #include "hybrid/hybrid_backend_data.h" namespace hybrid { -namespace parse { +namespace configuration { common_installer::Step::Status StepMergeTpkConfig::process() { HybridBackendData* data = @@ -28,5 +28,5 @@ common_installer::Step::Status StepMergeTpkConfig::process() { return Status::OK; } -} // namespace parse +} // namespace configuration } // namespace hybrid diff --git a/src/hybrid/step/step_merge_tpk_config.h b/src/hybrid/step/configuration/step_merge_tpk_config.h similarity index 76% rename from src/hybrid/step/step_merge_tpk_config.h rename to src/hybrid/step/configuration/step_merge_tpk_config.h index e8476ef..0414abe 100644 --- a/src/hybrid/step/step_merge_tpk_config.h +++ b/src/hybrid/step/configuration/step_merge_tpk_config.h @@ -2,14 +2,14 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#ifndef HYBRID_STEP_STEP_MERGE_TPK_CONFIG_H_ -#define HYBRID_STEP_STEP_MERGE_TPK_CONFIG_H_ +#ifndef HYBRID_STEP_CONFIGURATION_STEP_MERGE_TPK_CONFIG_H_ +#define HYBRID_STEP_CONFIGURATION_STEP_MERGE_TPK_CONFIG_H_ #include #include namespace hybrid { -namespace parse { +namespace configuration { /** * \brief MergeTpkConfig @@ -28,7 +28,7 @@ class StepMergeTpkConfig : public common_installer::Step { SCOPE_LOG_TAG(MergeTpkConfig) }; -} // namespace parse +} // namespace configuration } // namespace hybrid -#endif // HYBRID_STEP_STEP_MERGE_TPK_CONFIG_H_ +#endif // HYBRID_STEP_CONFIGURATION_STEP_MERGE_TPK_CONFIG_H_ diff --git a/src/hybrid/step/step_parse.cc b/src/hybrid/step/configuration/step_parse.cc similarity index 78% rename from src/hybrid/step/step_parse.cc rename to src/hybrid/step/configuration/step_parse.cc index c15fa2a..1e25fbe 100644 --- a/src/hybrid/step/step_parse.cc +++ b/src/hybrid/step/configuration/step_parse.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#include "hybrid/step/step_parse.h" +#include "hybrid/step/configuration/step_parse.h" namespace { @@ -11,12 +11,12 @@ const char kResWgtPath[] = "res/wgt"; } namespace hybrid { -namespace parse { +namespace configuration { bool StepParse::LocateConfigFile() { return Check(context_->unpacked_dir_path.get() / kResWgtPath); } -} // namespace parse +} // namespace configuration } // namespace hybrid diff --git a/src/hybrid/step/step_parse.h b/src/hybrid/step/configuration/step_parse.h similarity index 59% rename from src/hybrid/step/step_parse.h rename to src/hybrid/step/configuration/step_parse.h index aff8a71..4c5b339 100644 --- a/src/hybrid/step/step_parse.h +++ b/src/hybrid/step/configuration/step_parse.h @@ -2,15 +2,15 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#ifndef HYBRID_STEP_STEP_PARSE_H_ -#define HYBRID_STEP_STEP_PARSE_H_ +#ifndef HYBRID_STEP_CONFIGURATION_STEP_PARSE_H_ +#define HYBRID_STEP_CONFIGURATION_STEP_PARSE_H_ #include -#include "wgt/step/step_parse.h" +#include "wgt/step/configuration/step_parse.h" namespace hybrid { -namespace parse { +namespace configuration { /** * \brief This step parse config.xml configuration file of widget @@ -18,16 +18,16 @@ namespace parse { * This subclass overrides location of file and it is used when hybrid package * is installed. */ -class StepParse : public wgt::parse::StepParse { +class StepParse : public wgt::configuration::StepParse { public: - using wgt::parse::StepParse::StepParse; + using wgt::configuration::StepParse::StepParse; bool LocateConfigFile() override; SCOPE_LOG_TAG(Parse) }; -} // namespace parse +} // namespace configuration } // namespace hybrid -#endif // HYBRID_STEP_STEP_PARSE_H_ +#endif // HYBRID_STEP_CONFIGURATION_STEP_PARSE_H_ diff --git a/src/hybrid/step/step_stash_tpk_config.cc b/src/hybrid/step/configuration/step_stash_tpk_config.cc similarity index 82% rename from src/hybrid/step/step_stash_tpk_config.cc rename to src/hybrid/step/configuration/step_stash_tpk_config.cc index c409a44..2ec91e7 100644 --- a/src/hybrid/step/step_stash_tpk_config.cc +++ b/src/hybrid/step/configuration/step_stash_tpk_config.cc @@ -2,12 +2,12 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#include "hybrid/step/step_stash_tpk_config.h" +#include "hybrid/step/configuration/step_stash_tpk_config.h" #include "hybrid/hybrid_backend_data.h" namespace hybrid { -namespace parse { +namespace configuration { common_installer::Step::Status StepStashTpkConfig::process() { HybridBackendData* data = @@ -18,5 +18,5 @@ common_installer::Step::Status StepStashTpkConfig::process() { return Status::OK; } -} // namespace parse +} // namespace configuration } // namespace hybrid diff --git a/src/hybrid/step/step_stash_tpk_config.h b/src/hybrid/step/configuration/step_stash_tpk_config.h similarity index 75% rename from src/hybrid/step/step_stash_tpk_config.h rename to src/hybrid/step/configuration/step_stash_tpk_config.h index 7db654c..7cc889c 100644 --- a/src/hybrid/step/step_stash_tpk_config.h +++ b/src/hybrid/step/configuration/step_stash_tpk_config.h @@ -2,14 +2,14 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#ifndef HYBRID_STEP_STEP_STASH_TPK_CONFIG_H_ -#define HYBRID_STEP_STEP_STASH_TPK_CONFIG_H_ +#ifndef HYBRID_STEP_CONFIGURATION_STEP_STASH_TPK_CONFIG_H_ +#define HYBRID_STEP_CONFIGURATION_STEP_STASH_TPK_CONFIG_H_ #include #include namespace hybrid { -namespace parse { +namespace configuration { /** * \brief StepCheckHybrid @@ -28,7 +28,7 @@ class StepStashTpkConfig : public common_installer::Step { SCOPE_LOG_TAG(StashTpkConfig) }; -} // namespace parse +} // namespace configuration } // namespace hybrid -#endif // HYBRID_STEP_STEP_STASH_TPK_CONFIG_H_ +#endif // HYBRID_STEP_CONFIGURATION_STEP_STASH_TPK_CONFIG_H_ diff --git a/src/hybrid/step/step_encrypt_resources.cc b/src/hybrid/step/encryption/step_encrypt_resources.cc similarity index 75% rename from src/hybrid/step/step_encrypt_resources.cc rename to src/hybrid/step/encryption/step_encrypt_resources.cc index a4411b6..2265a35 100644 --- a/src/hybrid/step/step_encrypt_resources.cc +++ b/src/hybrid/step/encryption/step_encrypt_resources.cc @@ -2,15 +2,15 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#include "hybrid/step/step_encrypt_resources.h" +#include "hybrid/step/encryption/step_encrypt_resources.h" namespace hybrid { -namespace encrypt { +namespace encryption { void StepEncryptResources::SetEncryptionRoot() { input_ = context_->unpacked_dir_path.get() / "res/wgt"; } -} // namespace encrypt +} // namespace encryption } // namespace hybrid diff --git a/src/hybrid/step/step_encrypt_resources.h b/src/hybrid/step/encryption/step_encrypt_resources.h similarity index 53% rename from src/hybrid/step/step_encrypt_resources.h rename to src/hybrid/step/encryption/step_encrypt_resources.h index c86e510..ec66852 100644 --- a/src/hybrid/step/step_encrypt_resources.h +++ b/src/hybrid/step/encryption/step_encrypt_resources.h @@ -2,24 +2,24 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#ifndef HYBRID_STEP_STEP_ENCRYPT_RESOURCES_H_ -#define HYBRID_STEP_STEP_ENCRYPT_RESOURCES_H_ +#ifndef HYBRID_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_ +#define HYBRID_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_ #include -#include "wgt/step/step_encrypt_resources.h" +#include "wgt/step/encryption/step_encrypt_resources.h" namespace hybrid { -namespace encrypt { +namespace encryption { /** * \brief Step that encrypt application resources files if flagged to do so * * This is variant for hybrid package */ -class StepEncryptResources : public wgt::encrypt::StepEncryptResources { +class StepEncryptResources : public wgt::encryption::StepEncryptResources { public: - using wgt::encrypt::StepEncryptResources::StepEncryptResources; + using wgt::encryption::StepEncryptResources::StepEncryptResources; private: void SetEncryptionRoot() override; @@ -27,7 +27,7 @@ class StepEncryptResources : public wgt::encrypt::StepEncryptResources { SCOPE_LOG_TAG(EncryptResources) }; -} // namespace encrypt +} // namespace encryption } // namespace hybrid -#endif // HYBRID_STEP_STEP_ENCRYPT_RESOURCES_H_ +#endif // HYBRID_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_ diff --git a/src/unit_tests/manifest_test.cc b/src/unit_tests/manifest_test.cc index da14f60..46d2f8b 100644 --- a/src/unit_tests/manifest_test.cc +++ b/src/unit_tests/manifest_test.cc @@ -18,7 +18,7 @@ #include #include -#include "wgt/step/step_parse.h" +#include "wgt/step/configuration/step_parse.h" #include "wgt/wgt_backend_data.h" #define ASSERT_CSTR_EQ(STR1, STR2) \ @@ -48,7 +48,7 @@ class StepParseRunner { bool Run() { PrepareContext(); - wgt::parse::StepParse step(context_.get(), !ignore_start_files_); + wgt::configuration::StepParse step(context_.get(), !ignore_start_files_); return step.process() == ci::Step::Status::OK; } diff --git a/src/unit_tests/smoke_test.cc b/src/unit_tests/smoke_test.cc index 5f3c772..00bc484 100644 --- a/src/unit_tests/smoke_test.cc +++ b/src/unit_tests/smoke_test.cc @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/wgt/CMakeLists.txt b/src/wgt/CMakeLists.txt index 6cb1e7a..6dbb9c9 100644 --- a/src/wgt/CMakeLists.txt +++ b/src/wgt/CMakeLists.txt @@ -1,20 +1,20 @@ # Target - sources SET(SRCS rds_parser.cc - step/step_check_settings_level.cc - step/step_check_wgt_background_category.cc - step/step_create_symbolic_link.cc - step/step_encrypt_resources.cc - step/step_generate_xml.cc - step/step_parse.cc - step/step_remove_encryption_data.cc - step/step_parse_recovery.cc - step/step_rds_parse.cc - step/step_rds_modify.cc - step/step_wgt_patch_icons.cc - step/step_wgt_patch_storage_directories.cc - step/step_wgt_resource_directory.cc - step/step_add_default_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_create_symbolic_link.cc + step/filesystem/step_wgt_patch_icons.cc + step/filesystem/step_wgt_patch_storage_directories.cc + step/filesystem/step_wgt_resource_directory.cc + step/pkgmgr/step_generate_xml.cc + step/rds/step_rds_modify.cc + step/rds/step_rds_parse.cc + step/security/step_add_default_privileges.cc + step/security/step_check_settings_level.cc + step/security/step_check_wgt_background_category.cc wgt_app_query_interface.cc wgt_installer.cc ) diff --git a/src/wgt/step/step_parse.cc b/src/wgt/step/configuration/step_parse.cc similarity index 87% rename from src/wgt/step/step_parse.cc rename to src/wgt/step/configuration/step_parse.cc index 935b303..35e248e 100644 --- a/src/wgt/step/step_parse.cc +++ b/src/wgt/step/configuration/step_parse.cc @@ -3,7 +3,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_parse.h" +#include "wgt/step/configuration/step_parse.h" #include @@ -83,7 +83,7 @@ void SetApplicationXDefaults(application_x* application) { } // namespace namespace wgt { -namespace parse { +namespace configuration { namespace app_keys = wgt::application_widget_keys; namespace sc = std::chrono; @@ -95,7 +95,7 @@ StepParse::StepParse(common_installer::InstallerContext* context, } std::set StepParse::ExtractPrivileges( - std::shared_ptr perm_info) const { + std::shared_ptr perm_info) const { return perm_info->GetAPIPermissions(); } @@ -129,15 +129,15 @@ bool StepParse::FillInstallationInfo(manifest_x* manifest) { } bool StepParse::FillIconPaths(manifest_x* manifest) { - std::shared_ptr app_info = - std::static_pointer_cast( + std::shared_ptr app_info = + std::static_pointer_cast( parser_->GetManifestData(app_keys::kTizenApplicationKey)); if (!app_info) { LOG(ERROR) << "Application info manifest data has not been found."; return false; } - std::shared_ptr icons_info = - std::static_pointer_cast( + std::shared_ptr icons_info = + std::static_pointer_cast( parser_->GetManifestData(app_keys::kIconsKey)); if (icons_info.get()) { for (auto& application_icon : icons_info->icons()) { @@ -153,9 +153,9 @@ bool StepParse::FillIconPaths(manifest_x* manifest) { } bool StepParse::FillWidgetInfo(manifest_x* manifest) { - std::shared_ptr wgt_info = - std::static_pointer_cast(parser_->GetManifestData( - app_keys::kWidgetKey)); + std::shared_ptr wgt_info = + std::static_pointer_cast( + parser_->GetManifestData(app_keys::kWidgetKey)); if (!wgt_info.get()) { LOG(ERROR) << "Widget info manifest data has not been found."; return false; @@ -211,8 +211,8 @@ bool StepParse::FillWidgetInfo(manifest_x* manifest) { author->lang = strdup(DEFAULT_LOCALE); manifest->author = g_list_append(manifest->author, author); - std::shared_ptr settings_info = - std::static_pointer_cast( + std::shared_ptr settings_info = + std::static_pointer_cast( parser_->GetManifestData( wgt::application_widget_keys::kTizenSettingKey)); if (settings_info) { @@ -238,17 +238,17 @@ bool StepParse::FillWidgetInfo(manifest_x* manifest) { } bool StepParse::FillMainApplicationInfo(manifest_x* manifest) { - std::shared_ptr app_info = - std::static_pointer_cast( + std::shared_ptr app_info = + std::static_pointer_cast( parser_->GetManifestData(app_keys::kTizenApplicationKey)); if (!app_info) { LOG(ERROR) << "Application info manifest data has not been found."; return false; } bool has_watch_catergory = false; - std::shared_ptr category_info = - std::static_pointer_cast(parser_->GetManifestData( - app_keys::kTizenCategoryKey)); + std::shared_ptr category_info = + std::static_pointer_cast( + parser_->GetManifestData(app_keys::kTizenCategoryKey)); if (category_info) { has_watch_catergory = std::find_if(category_info->categories.begin(), category_info->categories.end(), @@ -298,8 +298,8 @@ bool StepParse::FillMainApplicationInfo(manifest_x* manifest) { } bool StepParse::FillServiceApplicationInfo(manifest_x* manifest) { - std::shared_ptr service_list = - std::static_pointer_cast( + std::shared_ptr service_list = + std::static_pointer_cast( parser_->GetManifestData(app_keys::kTizenServiceKey)); if (!service_list) return true; @@ -363,8 +363,9 @@ bool StepParse::FillServiceApplicationInfo(manifest_x* manifest) { bool StepParse::FillBackgroundCategoryInfo(manifest_x* manifest) { auto manifest_data = parser_->GetManifestData( app_keys::kTizenBackgroundCategoryKey); - std::shared_ptr bc_list = - std::static_pointer_cast(manifest_data); + std::shared_ptr bc_list = + std::static_pointer_cast( + manifest_data); if (!bc_list) return true; @@ -381,8 +382,8 @@ bool StepParse::FillBackgroundCategoryInfo(manifest_x* manifest) { } bool StepParse::FillAppControl(manifest_x* manifest) { - std::shared_ptr app_info_list = - std::static_pointer_cast( + std::shared_ptr app_info_list = + std::static_pointer_cast( parser_->GetManifestData(app_keys::kTizenApplicationAppControlsKey)); application_x* app = @@ -401,9 +402,9 @@ bool StepParse::FillAppControl(manifest_x* manifest) { } bool StepParse::FillPrivileges(manifest_x* manifest) { - std::shared_ptr perm_info = - std::static_pointer_cast(parser_->GetManifestData( - app_keys::kTizenPermissionsKey)); + std::shared_ptr perm_info = + std::static_pointer_cast( + parser_->GetManifestData(app_keys::kTizenPermissionsKey)); std::set privileges; if (perm_info) privileges = ExtractPrivileges(perm_info); @@ -416,9 +417,9 @@ bool StepParse::FillPrivileges(manifest_x* manifest) { } bool StepParse::FillCategories(manifest_x* manifest) { - std::shared_ptr category_info = - std::static_pointer_cast(parser_->GetManifestData( - app_keys::kTizenCategoryKey)); + std::shared_ptr category_info = + std::static_pointer_cast( + parser_->GetManifestData(app_keys::kTizenCategoryKey)); if (!category_info) return true; @@ -432,9 +433,9 @@ bool StepParse::FillCategories(manifest_x* manifest) { } bool StepParse::FillMetadata(manifest_x* manifest) { - std::shared_ptr meta_info = - std::static_pointer_cast(parser_->GetManifestData( - app_keys::kTizenMetaDataKey)); + std::shared_ptr meta_info = + std::static_pointer_cast( + parser_->GetManifestData(app_keys::kTizenMetaDataKey)); if (!meta_info) return true; @@ -445,9 +446,9 @@ bool StepParse::FillMetadata(manifest_x* manifest) { } bool StepParse::FillAccounts(manifest_x* manifest) { - std::shared_ptr account_info = - std::static_pointer_cast(parser_->GetManifestData( - app_keys::kAccountKey)); + std::shared_ptr account_info = + std::static_pointer_cast( + parser_->GetManifestData(app_keys::kAccountKey)); if (!account_info) return true; common_installer::AccountInfo info; @@ -534,12 +535,12 @@ common_installer::Step::Status StepParse::process() { } // Copy data from ManifestData to InstallerContext - std::shared_ptr info = - std::static_pointer_cast( + std::shared_ptr info = + std::static_pointer_cast( parser_->GetManifestData( wgt::application_widget_keys::kTizenApplicationKey)); - std::shared_ptr wgt_info = - std::static_pointer_cast( + std::shared_ptr wgt_info = + std::static_pointer_cast( parser_->GetManifestData( wgt::application_widget_keys::kTizenWidgetKey)); @@ -570,8 +571,8 @@ common_installer::Step::Status StepParse::process() { context_->recovery_info.get().recovery_file->WriteAndCommitFileContent(); } - std::shared_ptr perm_info = - std::static_pointer_cast( + std::shared_ptr perm_info = + std::static_pointer_cast( parser_->GetManifestData( wgt::application_widget_keys::kTizenPermissionsKey)); parser::PermissionSet permissions; @@ -581,8 +582,8 @@ common_installer::Step::Status StepParse::process() { WgtBackendData* backend_data = static_cast(context_->backend_data.get()); - std::shared_ptr settings_info = - std::static_pointer_cast( + std::shared_ptr settings_info = + std::static_pointer_cast( parser_->GetManifestData( wgt::application_widget_keys::kTizenSettingKey)); if (settings_info) @@ -624,5 +625,5 @@ bool StepParse::Check(const boost::filesystem::path& widget_path) { return true; } -} // namespace parse +} // namespace configuration } // namespace wgt diff --git a/src/wgt/step/step_parse.h b/src/wgt/step/configuration/step_parse.h similarity index 88% rename from src/wgt/step/step_parse.h rename to src/wgt/step/configuration/step_parse.h index dc723cb..17a7ed6 100644 --- a/src/wgt/step/step_parse.h +++ b/src/wgt/step/configuration/step_parse.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_PARSE_H_ -#define WGT_STEP_STEP_PARSE_H_ +#ifndef WGT_STEP_CONFIGURATION_STEP_PARSE_H_ +#define WGT_STEP_CONFIGURATION_STEP_PARSE_H_ #include @@ -20,7 +20,7 @@ #include namespace wgt { -namespace parse { +namespace configuration { /** * \brief This step parse config.xml configuration file of widget @@ -43,7 +43,7 @@ class StepParse : public common_installer::Step { private: std::set ExtractPrivileges( - std::shared_ptr perm_info) const; + std::shared_ptr perm_info) const; std::string GetPackageVersion(const std::string& manifest_version); @@ -67,7 +67,7 @@ class StepParse : public common_installer::Step { SCOPE_LOG_TAG(Parse) }; -} // namespace parse +} // namespace configuration } // namespace wgt -#endif // WGT_STEP_STEP_PARSE_H_ +#endif // WGT_STEP_CONFIGURATION_STEP_PARSE_H_ diff --git a/src/wgt/step/step_parse_recovery.cc b/src/wgt/step/configuration/step_parse_recovery.cc similarity index 92% rename from src/wgt/step/step_parse_recovery.cc rename to src/wgt/step/configuration/step_parse_recovery.cc index 218c2d5..0d8f3dc 100644 --- a/src/wgt/step/step_parse_recovery.cc +++ b/src/wgt/step/configuration/step_parse_recovery.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_parse_recovery.h" +#include "wgt/step/configuration/step_parse_recovery.h" #include #include @@ -14,7 +14,7 @@ const char kResWgtPath[] = "res/wgt"; } namespace wgt { -namespace parse { +namespace configuration { StepParseRecovery::StepParseRecovery( common_installer::InstallerContext* context) @@ -52,5 +52,5 @@ bool StepParseRecovery::LocateConfigFile() { return false; } -} // namespace parse +} // namespace configuration } // namespace wgt diff --git a/src/wgt/step/step_parse_recovery.h b/src/wgt/step/configuration/step_parse_recovery.h similarity index 82% rename from src/wgt/step/step_parse_recovery.h rename to src/wgt/step/configuration/step_parse_recovery.h index b5ed147..ad3015d 100644 --- a/src/wgt/step/step_parse_recovery.h +++ b/src/wgt/step/configuration/step_parse_recovery.h @@ -2,15 +2,15 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_PARSE_RECOVERY_H_ -#define WGT_STEP_STEP_PARSE_RECOVERY_H_ +#ifndef WGT_STEP_CONFIGURATION_STEP_PARSE_RECOVERY_H_ +#define WGT_STEP_CONFIGURATION_STEP_PARSE_RECOVERY_H_ #include -#include "wgt/step/step_parse.h" +#include "wgt/step/configuration/step_parse.h" namespace wgt { -namespace parse { +namespace configuration { /** * \brief The StepParseRecovery class * Retrievies package information from config.xml during RECOVERY. @@ -57,7 +57,7 @@ class StepParseRecovery : public StepParse { SCOPE_LOG_TAG(ParseRecovery) }; -} // namespace parse +} // namespace configuration } // namespace wgt -#endif // WGT_STEP_STEP_PARSE_RECOVERY_H_ +#endif // WGT_STEP_CONFIGURATION_STEP_PARSE_RECOVERY_H_ diff --git a/src/wgt/step/step_encrypt_resources.cc b/src/wgt/step/encryption/step_encrypt_resources.cc similarity index 98% rename from src/wgt/step/step_encrypt_resources.cc rename to src/wgt/step/encryption/step_encrypt_resources.cc index 51c1aec..8528ca9 100644 --- a/src/wgt/step/step_encrypt_resources.cc +++ b/src/wgt/step/encryption/step_encrypt_resources.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_encrypt_resources.h" +#include "wgt/step/encryption/step_encrypt_resources.h" #include @@ -27,7 +27,7 @@ const std::set encryptSet { ".html", ".htm", ".css", ".js"}; namespace wgt { -namespace encrypt { +namespace encryption { namespace bf = boost::filesystem; namespace bs = boost::system; @@ -214,5 +214,5 @@ bool StepEncryptResources::ToBeEncrypted(const bf::path &file) { return false; } -} // namespace encrypt +} // namespace encryption } // namespace wgt diff --git a/src/wgt/step/step_encrypt_resources.h b/src/wgt/step/encryption/step_encrypt_resources.h similarity index 87% rename from src/wgt/step/step_encrypt_resources.h rename to src/wgt/step/encryption/step_encrypt_resources.h index d6a8b19..628b0e9 100644 --- a/src/wgt/step/step_encrypt_resources.h +++ b/src/wgt/step/encryption/step_encrypt_resources.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_ENCRYPT_RESOURCES_H_ -#define WGT_STEP_STEP_ENCRYPT_RESOURCES_H_ +#ifndef WGT_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_ +#define WGT_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_ #include @@ -13,7 +13,7 @@ #include "wgt/wgt_backend_data.h" namespace wgt { -namespace encrypt { +namespace encryption { /** * \brief Step that encrypt application resources files if flagged to do so @@ -66,7 +66,7 @@ class StepEncryptResources : public common_installer::Step { SCOPE_LOG_TAG(EncryptResources) }; -} // namespace encrypt +} // namespace encryption } // namespace wgt -#endif // WGT_STEP_STEP_ENCRYPT_RESOURCES_H_ +#endif // WGT_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_ diff --git a/src/wgt/step/step_remove_encryption_data.cc b/src/wgt/step/encryption/step_remove_encryption_data.cc similarity index 93% rename from src/wgt/step/step_remove_encryption_data.cc rename to src/wgt/step/encryption/step_remove_encryption_data.cc index 0c601d3..4baa502 100644 --- a/src/wgt/step/step_remove_encryption_data.cc +++ b/src/wgt/step/encryption/step_remove_encryption_data.cc @@ -2,14 +2,14 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_remove_encryption_data.h" +#include "wgt/step/encryption/step_remove_encryption_data.h" #include #include namespace wgt { -namespace encrypt { +namespace encryption { common_installer::Step::Status StepRemoveEncryptionData::process() { wae_app_type_e enc_type = @@ -50,5 +50,5 @@ common_installer::Step::Status StepRemoveEncryptionData::process() { return common_installer::Step::Status::ERROR; } -} // namespace encrypt +} // namespace encryption } // namespace wgt diff --git a/src/wgt/step/step_remove_encryption_data.h b/src/wgt/step/encryption/step_remove_encryption_data.h similarity index 78% rename from src/wgt/step/step_remove_encryption_data.h rename to src/wgt/step/encryption/step_remove_encryption_data.h index 6156e99..f372e39 100644 --- a/src/wgt/step/step_remove_encryption_data.h +++ b/src/wgt/step/encryption/step_remove_encryption_data.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_REMOVE_ENCRYPTION_DATA_H_ -#define WGT_STEP_STEP_REMOVE_ENCRYPTION_DATA_H_ +#ifndef WGT_STEP_ENCRYPTION_STEP_REMOVE_ENCRYPTION_DATA_H_ +#define WGT_STEP_ENCRYPTION_STEP_REMOVE_ENCRYPTION_DATA_H_ #include #include namespace wgt { -namespace encrypt { +namespace encryption { /** * This step remove encryption keys used for encryption during installation @@ -33,7 +33,7 @@ class StepRemoveEncryptionData : public common_installer::Step { SCOPE_LOG_TAG(RemoveEncryptionData) }; -} // namespace encrypt +} // namespace encryption } // namespace wgt -#endif // WGT_STEP_STEP_REMOVE_ENCRYPTION_DATA_H_ +#endif // WGT_STEP_ENCRYPTION_STEP_REMOVE_ENCRYPTION_DATA_H_ diff --git a/src/wgt/step/step_create_symbolic_link.cc b/src/wgt/step/filesystem/step_create_symbolic_link.cc similarity index 97% rename from src/wgt/step/step_create_symbolic_link.cc rename to src/wgt/step/filesystem/step_create_symbolic_link.cc index d8a18e7..bd3cc03 100644 --- a/src/wgt/step/step_create_symbolic_link.cc +++ b/src/wgt/step/filesystem/step_create_symbolic_link.cc @@ -3,7 +3,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_create_symbolic_link.h" +#include "wgt/step/filesystem/step_create_symbolic_link.h" #include #include diff --git a/src/wgt/step/step_create_symbolic_link.h b/src/wgt/step/filesystem/step_create_symbolic_link.h similarity index 86% rename from src/wgt/step/step_create_symbolic_link.h rename to src/wgt/step/filesystem/step_create_symbolic_link.h index df51fde..0efa491 100644 --- a/src/wgt/step/step_create_symbolic_link.h +++ b/src/wgt/step/filesystem/step_create_symbolic_link.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_CREATE_SYMBOLIC_LINK_H_ -#define WGT_STEP_STEP_CREATE_SYMBOLIC_LINK_H_ +#ifndef WGT_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_ +#define WGT_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_ #include @@ -58,4 +58,4 @@ class StepCreateSymbolicLink : public common_installer::Step { } // namespace filesystem } // namespace wgt -#endif // WGT_STEP_STEP_CREATE_SYMBOLIC_LINK_H_ +#endif // WGT_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_ diff --git a/src/wgt/step/step_wgt_patch_icons.cc b/src/wgt/step/filesystem/step_wgt_patch_icons.cc similarity index 96% rename from src/wgt/step/step_wgt_patch_icons.cc rename to src/wgt/step/filesystem/step_wgt_patch_icons.cc index 45da3de..d9a1827 100644 --- a/src/wgt/step/step_wgt_patch_icons.cc +++ b/src/wgt/step/filesystem/step_wgt_patch_icons.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_wgt_patch_icons.h" +#include "wgt/step/filesystem/step_wgt_patch_icons.h" #include diff --git a/src/wgt/step/step_wgt_patch_icons.h b/src/wgt/step/filesystem/step_wgt_patch_icons.h similarity index 83% rename from src/wgt/step/step_wgt_patch_icons.h rename to src/wgt/step/filesystem/step_wgt_patch_icons.h index c5eabaa..d4ff8fb 100644 --- a/src/wgt/step/step_wgt_patch_icons.h +++ b/src/wgt/step/filesystem/step_wgt_patch_icons.h @@ -2,8 +2,8 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_WGT_PATCH_ICONS_H_ -#define WGT_STEP_STEP_WGT_PATCH_ICONS_H_ +#ifndef WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_ICONS_H_ +#define WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_ICONS_H_ #include @@ -34,4 +34,4 @@ class StepWgtPatchIcons : public common_installer::Step { } // namespace filesystem } // namespace wgt -#endif // WGT_STEP_STEP_WGT_PATCH_ICONS_H_ +#endif // WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_ICONS_H_ diff --git a/src/wgt/step/step_wgt_patch_storage_directories.cc b/src/wgt/step/filesystem/step_wgt_patch_storage_directories.cc similarity index 97% rename from src/wgt/step/step_wgt_patch_storage_directories.cc rename to src/wgt/step/filesystem/step_wgt_patch_storage_directories.cc index e6f976e..3c5d9e9 100644 --- a/src/wgt/step/step_wgt_patch_storage_directories.cc +++ b/src/wgt/step/filesystem/step_wgt_patch_storage_directories.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by an apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_wgt_patch_storage_directories.h" +#include "wgt/step/filesystem/step_wgt_patch_storage_directories.h" #include #include diff --git a/src/wgt/step/step_wgt_patch_storage_directories.h b/src/wgt/step/filesystem/step_wgt_patch_storage_directories.h similarity index 82% rename from src/wgt/step/step_wgt_patch_storage_directories.h rename to src/wgt/step/filesystem/step_wgt_patch_storage_directories.h index 89992df..c3a61e9 100644 --- a/src/wgt/step/step_wgt_patch_storage_directories.h +++ b/src/wgt/step/filesystem/step_wgt_patch_storage_directories.h @@ -2,8 +2,8 @@ // Use of this source code is governed by an apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_WGT_PATCH_STORAGE_DIRECTORIES_H_ -#define WGT_STEP_STEP_WGT_PATCH_STORAGE_DIRECTORIES_H_ +#ifndef WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_STORAGE_DIRECTORIES_H_ +#define WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_STORAGE_DIRECTORIES_H_ #include #include @@ -36,4 +36,4 @@ class StepWgtPatchStorageDirectories : } // namespace filesystem } // namespace wgt -#endif // WGT_STEP_STEP_WGT_PATCH_STORAGE_DIRECTORIES_H_ +#endif // WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_STORAGE_DIRECTORIES_H_ diff --git a/src/wgt/step/step_wgt_resource_directory.cc b/src/wgt/step/filesystem/step_wgt_resource_directory.cc similarity index 95% rename from src/wgt/step/step_wgt_resource_directory.cc rename to src/wgt/step/filesystem/step_wgt_resource_directory.cc index 33671e7..cf2e57f 100644 --- a/src/wgt/step/step_wgt_resource_directory.cc +++ b/src/wgt/step/filesystem/step_wgt_resource_directory.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_wgt_resource_directory.h" +#include "wgt/step/filesystem/step_wgt_resource_directory.h" #include diff --git a/src/wgt/step/step_wgt_resource_directory.h b/src/wgt/step/filesystem/step_wgt_resource_directory.h similarity index 88% rename from src/wgt/step/step_wgt_resource_directory.h rename to src/wgt/step/filesystem/step_wgt_resource_directory.h index 60717ec..7fa9a4c 100644 --- a/src/wgt/step/step_wgt_resource_directory.h +++ b/src/wgt/step/filesystem/step_wgt_resource_directory.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_WGT_RESOURCE_DIRECTORY_H_ -#define WGT_STEP_STEP_WGT_RESOURCE_DIRECTORY_H_ +#ifndef WGT_STEP_FILESYSTEM_STEP_WGT_RESOURCE_DIRECTORY_H_ +#define WGT_STEP_FILESYSTEM_STEP_WGT_RESOURCE_DIRECTORY_H_ #include @@ -59,4 +59,4 @@ class StepWgtResourceDirectory : public common_installer::Step { } // namespace filesystem } // namespace wgt -#endif // WGT_STEP_STEP_WGT_RESOURCE_DIRECTORY_H_ +#endif // WGT_STEP_FILESYSTEM_STEP_WGT_RESOURCE_DIRECTORY_H_ diff --git a/src/wgt/step/step_generate_xml.cc b/src/wgt/step/pkgmgr/step_generate_xml.cc similarity index 99% rename from src/wgt/step/step_generate_xml.cc rename to src/wgt/step/pkgmgr/step_generate_xml.cc index a90b3bb..0b21b3c 100644 --- a/src/wgt/step/step_generate_xml.cc +++ b/src/wgt/step/pkgmgr/step_generate_xml.cc @@ -3,7 +3,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_generate_xml.h" +#include "wgt/step/pkgmgr/step_generate_xml.h" #include #include diff --git a/src/wgt/step/step_generate_xml.h b/src/wgt/step/pkgmgr/step_generate_xml.h similarity index 88% rename from src/wgt/step/step_generate_xml.h rename to src/wgt/step/pkgmgr/step_generate_xml.h index 0f62498..00b82e6 100644 --- a/src/wgt/step/step_generate_xml.h +++ b/src/wgt/step/pkgmgr/step_generate_xml.h @@ -3,8 +3,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_GENERATE_XML_H_ -#define WGT_STEP_STEP_GENERATE_XML_H_ +#ifndef WGT_STEP_PKGMGR_STEP_GENERATE_XML_H_ +#define WGT_STEP_PKGMGR_STEP_GENERATE_XML_H_ #include @@ -43,4 +43,4 @@ class StepGenerateXml : public common_installer::Step { } // namespace pkgmgr } // namespace wgt -#endif // WGT_STEP_STEP_GENERATE_XML_H_ +#endif // WGT_STEP_PKGMGR_STEP_GENERATE_XML_H_ diff --git a/src/wgt/step/step_rds_modify.cc b/src/wgt/step/rds/step_rds_modify.cc similarity index 99% rename from src/wgt/step/step_rds_modify.cc rename to src/wgt/step/rds/step_rds_modify.cc index 95fab9f..83937cf 100644 --- a/src/wgt/step/step_rds_modify.cc +++ b/src/wgt/step/rds/step_rds_modify.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_rds_modify.h" +#include "wgt/step/rds/step_rds_modify.h" #include diff --git a/src/wgt/step/step_rds_modify.h b/src/wgt/step/rds/step_rds_modify.h similarity index 94% rename from src/wgt/step/step_rds_modify.h rename to src/wgt/step/rds/step_rds_modify.h index 4f0a289..31d4c3b 100644 --- a/src/wgt/step/step_rds_modify.h +++ b/src/wgt/step/rds/step_rds_modify.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_RDS_MODIFY_H_ -#define WGT_STEP_STEP_RDS_MODIFY_H_ +#ifndef WGT_STEP_RDS_STEP_RDS_MODIFY_H_ +#define WGT_STEP_RDS_STEP_RDS_MODIFY_H_ #include #include @@ -84,4 +84,5 @@ class StepRDSModify : public common_installer::Step { }; } // namespace rds } // namespace wgt -#endif // WGT_STEP_STEP_RDS_MODIFY_H_ + +#endif // WGT_STEP_RDS_STEP_RDS_MODIFY_H_ diff --git a/src/wgt/step/step_rds_parse.cc b/src/wgt/step/rds/step_rds_parse.cc similarity index 97% rename from src/wgt/step/step_rds_parse.cc rename to src/wgt/step/rds/step_rds_parse.cc index 2a459a0..31ce2b4 100644 --- a/src/wgt/step/step_rds_parse.cc +++ b/src/wgt/step/rds/step_rds_parse.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_rds_parse.h" +#include "wgt/step/rds/step_rds_parse.h" #include diff --git a/src/wgt/step/step_rds_parse.h b/src/wgt/step/rds/step_rds_parse.h similarity index 90% rename from src/wgt/step/step_rds_parse.h rename to src/wgt/step/rds/step_rds_parse.h index 5aea60e..649df10 100644 --- a/src/wgt/step/step_rds_parse.h +++ b/src/wgt/step/rds/step_rds_parse.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_RDS_PARSE_H_ -#define WGT_STEP_STEP_RDS_PARSE_H_ +#ifndef WGT_STEP_RDS_STEP_RDS_PARSE_H_ +#define WGT_STEP_RDS_STEP_RDS_PARSE_H_ #include @@ -56,6 +56,8 @@ class StepRDSParse : public common_installer::Step { private: boost::filesystem::path rds_file_path_; }; + } // namespace rds } // namespace wgt -#endif // WGT_STEP_STEP_RDS_PARSE_H_ + +#endif // WGT_STEP_RDS_STEP_RDS_PARSE_H_ diff --git a/src/wgt/step/step_add_default_privileges.cc b/src/wgt/step/security/step_add_default_privileges.cc similarity index 93% rename from src/wgt/step/step_add_default_privileges.cc rename to src/wgt/step/security/step_add_default_privileges.cc index 18eb902..3cbbe1f 100644 --- a/src/wgt/step/step_add_default_privileges.cc +++ b/src/wgt/step/security/step_add_default_privileges.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_add_default_privileges.h" +#include "wgt/step/security/step_add_default_privileges.h" #include diff --git a/src/wgt/step/step_add_default_privileges.h b/src/wgt/step/security/step_add_default_privileges.h similarity index 86% rename from src/wgt/step/step_add_default_privileges.h rename to src/wgt/step/security/step_add_default_privileges.h index 928ab84..b7759a9 100644 --- a/src/wgt/step/step_add_default_privileges.h +++ b/src/wgt/step/security/step_add_default_privileges.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_ADD_DEFAULT_PRIVILEGES_H_ -#define WGT_STEP_STEP_ADD_DEFAULT_PRIVILEGES_H_ +#ifndef WGT_STEP_SECURITY_STEP_ADD_DEFAULT_PRIVILEGES_H_ +#define WGT_STEP_SECURITY_STEP_ADD_DEFAULT_PRIVILEGES_H_ #include @@ -56,4 +56,4 @@ class StepAddDefaultPrivileges : public common_installer::Step { } // namespace security } // namespace wgt -#endif // WGT_STEP_STEP_ADD_DEFAULT_PRIVILEGES_H_ +#endif // WGT_STEP_SECURITY_STEP_ADD_DEFAULT_PRIVILEGES_H_ diff --git a/src/wgt/step/step_check_settings_level.cc b/src/wgt/step/security/step_check_settings_level.cc similarity index 96% rename from src/wgt/step/step_check_settings_level.cc rename to src/wgt/step/security/step_check_settings_level.cc index 9df2b19..270eb04 100644 --- a/src/wgt/step/step_check_settings_level.cc +++ b/src/wgt/step/security/step_check_settings_level.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_check_settings_level.h" +#include "wgt/step/security/step_check_settings_level.h" #include #include diff --git a/src/wgt/step/step_check_settings_level.h b/src/wgt/step/security/step_check_settings_level.h similarity index 87% rename from src/wgt/step/step_check_settings_level.h rename to src/wgt/step/security/step_check_settings_level.h index bac5bf2..3dfd8ac 100644 --- a/src/wgt/step/step_check_settings_level.h +++ b/src/wgt/step/security/step_check_settings_level.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_CHECK_SETTINGS_LEVEL_H_ -#define WGT_STEP_STEP_CHECK_SETTINGS_LEVEL_H_ +#ifndef WGT_STEP_SECURITY_STEP_CHECK_SETTINGS_LEVEL_H_ +#define WGT_STEP_SECURITY_STEP_CHECK_SETTINGS_LEVEL_H_ #include @@ -56,4 +56,4 @@ class StepCheckSettingsLevel : public common_installer::Step { } // namespace security } // namespace wgt -#endif // WGT_STEP_STEP_CHECK_SETTINGS_LEVEL_H_ +#endif // WGT_STEP_SECURITY_STEP_CHECK_SETTINGS_LEVEL_H_ diff --git a/src/wgt/step/step_check_wgt_background_category.cc b/src/wgt/step/security/step_check_wgt_background_category.cc similarity index 92% rename from src/wgt/step/step_check_wgt_background_category.cc rename to src/wgt/step/security/step_check_wgt_background_category.cc index 087b37b..cd59ef6 100644 --- a/src/wgt/step/step_check_wgt_background_category.cc +++ b/src/wgt/step/security/step_check_wgt_background_category.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_check_wgt_background_category.h" +#include "wgt/step/security/step_check_wgt_background_category.h" #include #include diff --git a/src/wgt/step/step_check_wgt_background_category.h b/src/wgt/step/security/step_check_wgt_background_category.h similarity index 74% rename from src/wgt/step/step_check_wgt_background_category.h rename to src/wgt/step/security/step_check_wgt_background_category.h index 33b5b23..dd21574 100644 --- a/src/wgt/step/step_check_wgt_background_category.h +++ b/src/wgt/step/security/step_check_wgt_background_category.h @@ -2,10 +2,10 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_CHECK_WGT_BACKGROUND_CATEGORY_H_ -#define WGT_STEP_STEP_CHECK_WGT_BACKGROUND_CATEGORY_H_ +#ifndef WGT_STEP_SECURITY_STEP_CHECK_WGT_BACKGROUND_CATEGORY_H_ +#define WGT_STEP_SECURITY_STEP_CHECK_WGT_BACKGROUND_CATEGORY_H_ -#include +#include #include namespace wgt { @@ -28,4 +28,4 @@ class StepCheckWgtBackgroundCategory : } // namespace security } // namespace wgt -#endif // WGT_STEP_STEP_CHECK_WGT_BACKGROUND_CATEGORY_H_ +#endif // WGT_STEP_SECURITY_STEP_CHECK_WGT_BACKGROUND_CATEGORY_H_ diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index fa66402..d332c57 100644 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -5,63 +5,65 @@ #include "wgt/wgt_installer.h" #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include "wgt/step/step_add_default_privileges.h" -#include "wgt/step/step_check_settings_level.h" -#include "wgt/step/step_check_wgt_background_category.h" -#include "wgt/step/step_create_symbolic_link.h" -#include "wgt/step/step_encrypt_resources.h" -#include "wgt/step/step_generate_xml.h" -#include "wgt/step/step_parse.h" -#include "wgt/step/step_parse_recovery.h" -#include "wgt/step/step_rds_modify.h" -#include "wgt/step/step_rds_parse.h" -#include "wgt/step/step_remove_encryption_data.h" -#include "wgt/step/step_wgt_patch_icons.h" -#include "wgt/step/step_wgt_patch_storage_directories.h" -#include "wgt/step/step_wgt_resource_directory.h" + +#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_create_symbolic_link.h" +#include "wgt/step/filesystem/step_wgt_patch_icons.h" +#include "wgt/step/filesystem/step_wgt_patch_storage_directories.h" +#include "wgt/step/filesystem/step_wgt_resource_directory.h" +#include "wgt/step/pkgmgr/step_generate_xml.h" +#include "wgt/step/rds/step_rds_modify.h" +#include "wgt/step/rds/step_rds_parse.h" +#include "wgt/step/security/step_add_default_privileges.h" +#include "wgt/step/security/step_check_settings_level.h" +#include "wgt/step/security/step_check_wgt_background_category.h" namespace ci = common_installer; @@ -76,13 +78,13 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) case ci::RequestType::Install : { AddStep(pkgmgr_); AddStep(); - AddStep(true); - AddStep(); + AddStep(true); + AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -102,17 +104,17 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) case ci::RequestType::Update: { AddStep(pkgmgr_); AddStep(); - AddStep(true); - AddStep(); + AddStep(true); + AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::INSTALLED, - ci::parse::StepParseManifest::StoreLocation::BACKUP); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::BACKUP); AddStep(); AddStep(); AddStep(); @@ -132,9 +134,9 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) case ci::RequestType::Uninstall: { AddStep(pkgmgr_); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::INSTALLED, - ci::parse::StepParseManifest::StoreLocation::NORMAL); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); AddStep(); AddStep( ci::Plugin::ActionType::Uninstall); @@ -143,19 +145,19 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(); AddStep(); break; } case ci::RequestType::Reinstall: { AddStep(pkgmgr_); - AddStep(false); + AddStep(false); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::INSTALLED, - ci::parse::StepParseManifest::StoreLocation::BACKUP); - AddStep(); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::BACKUP); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -165,19 +167,20 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(pkgmgr_); AddStep(); // TODO(t.iwanek): manifest is parsed twice... - AddStep(false); // start file may not have changed + AddStep(false); + // start file may not have changed AddStep("res/wgt/"); - AddStep(true); - AddStep(); + AddStep(true); + AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::INSTALLED, - ci::parse::StepParseManifest::StoreLocation::BACKUP); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::BACKUP); AddStep(); AddStep(); AddStep(); @@ -197,7 +200,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) case ci::RequestType::Recovery: { AddStep(pkgmgr_); AddStep(); - AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); -- 2.7.4 From ffe3ee9014033ca87189450935a5d07e99a52eeb Mon Sep 17 00:00:00 2001 From: JongHeon Choi Date: Fri, 18 Mar 2016 11:03:18 +0900 Subject: [PATCH 06/16] Modify symlink for watchapp Change-Id: I209698d952602b90bd72dd0c3b445d743d1c26ad --- src/wgt/step/filesystem/step_create_symbolic_link.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wgt/step/filesystem/step_create_symbolic_link.cc b/src/wgt/step/filesystem/step_create_symbolic_link.cc index bd3cc03..397c7d8 100644 --- a/src/wgt/step/filesystem/step_create_symbolic_link.cc +++ b/src/wgt/step/filesystem/step_create_symbolic_link.cc @@ -44,6 +44,8 @@ common_installer::Step::Status StepCreateSymbolicLink::process() { if (strcmp(app->component_type, "uiapp") == 0) { bf::create_symlink(bf::path(WRT_LAUNCHER), exec_path, error); + } else if (strcmp(app->component_type, "watchapp") == 0) { + bf::create_symlink(bf::path(WRT_LAUNCHER), exec_path, error); } else { bf::create_symlink(kWrtServiceBinaryPath, exec_path, error); } -- 2.7.4 From bf079f38d5dfdb0ac0ec1c12b29d0ffd3d6338d6 Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Thu, 24 Mar 2016 10:06:29 +0100 Subject: [PATCH 07/16] Typo Change-Id: Ia956bce9cfb391d7540f3632a98ad64e74e1334a --- src/unit_tests/smoke_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unit_tests/smoke_test.cc b/src/unit_tests/smoke_test.cc index 00bc484..7086e91 100644 --- a/src/unit_tests/smoke_test.cc +++ b/src/unit_tests/smoke_test.cc @@ -303,7 +303,7 @@ ci::AppInstaller::Result Reinstall(const bf::path& path, ci::AppInstaller::Result DeltaInstall(const bf::path& path, const bf::path& delta_package, PackageType type) { if (Install(path, type) != ci::AppInstaller::Result::OK) { - LOG(ERROR) << "Failed to install application. Cannot perform RDS"; + LOG(ERROR) << "Failed to install application. Cannot perform delta update"; return ci::AppInstaller::Result::UNKNOWN; } return Install(delta_package, type); -- 2.7.4 From 6c6807c018afaa6189cf53ed60a5c2a224cde01d Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Fri, 25 Mar 2016 11:32:25 +0100 Subject: [PATCH 08/16] Implement coping TEP in wgt and hybrid backend To verify, run install|update for wgt package and hybrid package, check if tep_package was copied (use any file as tep package) wgt-backend -i ${wgt_or_hybrid_package} -e ${your tep zip} Given tep file should be copied into res/ directory in package files. Change-Id: I87e38d76f582646ed01a1b74b7ec7580ca1fe4bb --- src/hybrid/hybrid_installer.cc | 6 ++++++ src/wgt/wgt_installer.cc | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc index b12354d..9d5675f 100644 --- a/src/hybrid/hybrid_installer.cc +++ b/src/hybrid/hybrid_installer.cc @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -86,6 +88,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -122,6 +125,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -134,6 +138,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); + // TODO(t.iwanek): this step is supposed to be removed as it is quickfix + AddStep(); break; case ci::RequestType::Uninstall: AddStep(pkgmgr_); diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index d332c57..b0a5dea 100644 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -37,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -88,6 +90,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -119,6 +122,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -129,6 +133,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep( ci::Plugin::ActionType::Upgrade); AddStep(); + // TODO(t.iwanek): this step is supposed to be removed as it is quickfix + AddStep(); break; } case ci::RequestType::Uninstall: { -- 2.7.4 From 730251e509028a658d3aa48a76cbc813af074855 Mon Sep 17 00:00:00 2001 From: jongmyeong ko Date: Fri, 1 Apr 2016 04:26:29 -0700 Subject: [PATCH 09/16] Revert "Implement coping TEP in wgt and hybrid backend" This reverts commit 6c6807c018afaa6189cf53ed60a5c2a224cde01d. Change-Id: I9ee651776b024abcacc5fd47f44a0d4dbb6e2d1f --- src/hybrid/hybrid_installer.cc | 6 ------ src/wgt/wgt_installer.cc | 6 ------ 2 files changed, 12 deletions(-) diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc index 9d5675f..b12354d 100644 --- a/src/hybrid/hybrid_installer.cc +++ b/src/hybrid/hybrid_installer.cc @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -35,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -88,7 +86,6 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); - AddStep(); AddStep(); AddStep(); AddStep(); @@ -125,7 +122,6 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); - AddStep(); AddStep(); AddStep(); AddStep(); @@ -138,8 +134,6 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); - // TODO(t.iwanek): this step is supposed to be removed as it is quickfix - AddStep(); break; case ci::RequestType::Uninstall: AddStep(pkgmgr_); diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index b0a5dea..d332c57 100644 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -38,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -90,7 +88,6 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); AddStep(); AddStep(); AddStep(); @@ -122,7 +119,6 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); AddStep(); AddStep(); AddStep(); @@ -133,8 +129,6 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep( ci::Plugin::ActionType::Upgrade); AddStep(); - // TODO(t.iwanek): this step is supposed to be removed as it is quickfix - AddStep(); break; } case ci::RequestType::Uninstall: { -- 2.7.4 From d50ee2455b526ce6a62c41aa9a17c9d7d52f469f Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Tue, 5 Apr 2016 09:53:22 +0200 Subject: [PATCH 10/16] Revert "Revert "Implement coping TEP in wgt and hybrid backend"" This reverts commit 730251e509028a658d3aa48a76cbc813af074855. Change-Id: I8e975ae43077cb8cef3887be9c19624d5951d8ef --- src/hybrid/hybrid_installer.cc | 6 ++++++ src/wgt/wgt_installer.cc | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc index b12354d..9d5675f 100644 --- a/src/hybrid/hybrid_installer.cc +++ b/src/hybrid/hybrid_installer.cc @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -86,6 +88,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -122,6 +125,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -134,6 +138,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); + // TODO(t.iwanek): this step is supposed to be removed as it is quickfix + AddStep(); break; case ci::RequestType::Uninstall: AddStep(pkgmgr_); diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index d332c57..b0a5dea 100644 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -37,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -88,6 +90,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -119,6 +122,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -129,6 +133,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep( ci::Plugin::ActionType::Upgrade); AddStep(); + // TODO(t.iwanek): this step is supposed to be removed as it is quickfix + AddStep(); break; } case ci::RequestType::Uninstall: { -- 2.7.4 From 3ee79bc5a2c74149f02c6fbd37531fb22f9a0713 Mon Sep 17 00:00:00 2001 From: Arkadiusz Szulakiewicz Date: Mon, 4 Apr 2016 14:40:06 +0200 Subject: [PATCH 11/16] Introduce StepWgtRDSModify for wgt-backend Requires: https://review.tizen.org/gerrit/#/c/64662/ Change-Id: I76525d6c908586315c9546513d3378a89f278ba6 --- src/wgt/CMakeLists.txt | 4 +- src/wgt/rds_parser.cc | 61 --------- src/wgt/rds_parser.h | 63 --------- src/wgt/step/rds/step_rds_modify.cc | 226 -------------------------------- src/wgt/step/rds/step_rds_modify.h | 88 ------------- src/wgt/step/rds/step_rds_parse.cc | 50 ------- src/wgt/step/rds/step_rds_parse.h | 63 --------- src/wgt/step/rds/step_wgt_rds_modify.cc | 23 ++++ src/wgt/step/rds/step_wgt_rds_modify.h | 39 ++++++ src/wgt/wgt_backend_data.h | 15 --- src/wgt/wgt_installer.cc | 9 +- 11 files changed, 68 insertions(+), 573 deletions(-) delete mode 100644 src/wgt/rds_parser.cc delete mode 100644 src/wgt/rds_parser.h delete mode 100644 src/wgt/step/rds/step_rds_modify.cc delete mode 100644 src/wgt/step/rds/step_rds_modify.h delete mode 100644 src/wgt/step/rds/step_rds_parse.cc delete mode 100644 src/wgt/step/rds/step_rds_parse.h create mode 100644 src/wgt/step/rds/step_wgt_rds_modify.cc create mode 100644 src/wgt/step/rds/step_wgt_rds_modify.h diff --git a/src/wgt/CMakeLists.txt b/src/wgt/CMakeLists.txt index 6dbb9c9..1b515f7 100644 --- a/src/wgt/CMakeLists.txt +++ b/src/wgt/CMakeLists.txt @@ -1,6 +1,5 @@ # Target - sources SET(SRCS - rds_parser.cc step/configuration/step_parse.cc step/configuration/step_parse_recovery.cc step/encryption/step_encrypt_resources.cc @@ -10,8 +9,7 @@ SET(SRCS step/filesystem/step_wgt_patch_storage_directories.cc step/filesystem/step_wgt_resource_directory.cc step/pkgmgr/step_generate_xml.cc - step/rds/step_rds_modify.cc - step/rds/step_rds_parse.cc + step/rds/step_wgt_rds_modify.cc step/security/step_add_default_privileges.cc step/security/step_check_settings_level.cc step/security/step_check_wgt_background_category.cc diff --git a/src/wgt/rds_parser.cc b/src/wgt/rds_parser.cc deleted file mode 100644 index 9f2fbb7..0000000 --- a/src/wgt/rds_parser.cc +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved -// Use of this source code is governed by a apache 2.0 license that can be -// found in the LICENSE file. - -#include "wgt/rds_parser.h" - -#include - -namespace { -const char kAdd[] = "#add"; -const char kModify[] = "#modify"; -const char kDelete[] = "#delete"; -} - -namespace wgt { -namespace rds_parser { - -RDSParser::RDSParser(const std::string& path_to_delta) - : path_to_delta_(path_to_delta) {} - -bool RDSParser::Parse() { - std::vector* current_container = nullptr; - std::string line; - - std::ifstream file_to_parse(path_to_delta_); - if (!file_to_parse.is_open()) - return false; - while (getline(file_to_parse, line)) { - if (line.compare(kDelete) == 0) { - current_container = &files_to_delete_; - continue; - } - if (line.compare(kAdd) == 0) { - current_container = &files_to_add_; - continue; - } - if (line.compare(kModify) == 0) { - current_container = &files_to_modify_; - continue; - } - if (current_container) - current_container->push_back(line); - } - file_to_parse.close(); - return true; -} - -const std::vector& RDSParser::files_to_modify() const { - return files_to_modify_; -} - -const std::vector& RDSParser::files_to_add() const { - return files_to_add_; -} - -const std::vector& RDSParser::files_to_delete() const { - return files_to_delete_; -} - -} // namespace rds_parser -} // namespace wgt diff --git a/src/wgt/rds_parser.h b/src/wgt/rds_parser.h deleted file mode 100644 index 7c412d1..0000000 --- a/src/wgt/rds_parser.h +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved -// Use of this source code is governed by a apache 2.0 license that can be -// found in the LICENSE file. - -#ifndef WGT_RDS_PARSER_H_ -#define WGT_RDS_PARSER_H_ - -#include -#include -namespace wgt { -namespace rds_parser { - -/** - * \brief Parse RDS config file - */ -class RDSParser { - public: - /** - * \brief Explicit constructor - * - * \param path_to_delta path to directory - */ - explicit RDSParser(const std::string& path_to_delta); - - /** - * \brief Parse package xml - * - * \return true if parsing was successful - */ - bool Parse(); - - /** - * \brief Accessor to vector of files to modify - * - * \return files to modify - */ - const std::vector& files_to_modify() const; - - /** - * \brief Accessor to vector of files to add - * - * \return files to add - */ - const std::vector& files_to_add() const; - - /** - * \brief Accessor to vector of files to delete - * - * \return files to delete - */ - const std::vector& files_to_delete() const; - - private: - std::string path_to_delta_; - std::vector files_to_modify_; - std::vector files_to_add_; - std::vector files_to_delete_; -}; - -} // namespace rds_parser -} // namespace wgt - -#endif // WGT_RDS_PARSER_H_ diff --git a/src/wgt/step/rds/step_rds_modify.cc b/src/wgt/step/rds/step_rds_modify.cc deleted file mode 100644 index 83937cf..0000000 --- a/src/wgt/step/rds/step_rds_modify.cc +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved -// Use of this source code is governed by a apache 2.0 license that can be -// found in the LICENSE file. - -#include "wgt/step/rds/step_rds_modify.h" - -#include - -#include - -#include - -namespace wgt { -namespace rds { - -namespace bf = boost::filesystem; -namespace bs = boost::system; -namespace cu = common_installer; - -StepRDSModify::StepRDSModify(common_installer::InstallerContext* context) - : Step(context), - backend_data_(nullptr) {} - -common_installer::Step::Status StepRDSModify::precheck() { - if (context_->unpacked_dir_path.get().empty()) { - LOG(ERROR) << "unpacked dir path is not set"; - return common_installer::Step::Status::INVALID_VALUE; - } - if (!bf::exists(context_->unpacked_dir_path.get())) { - LOG(ERROR) << "unpacked_dir_path (" - << context_->unpacked_dir_path.get() - << ") path does not exist"; - return common_installer::Step::Status::INVALID_VALUE; - } - if (context_->pkgid.get().empty()) { - LOG(ERROR) << "pkgid is not set"; - return common_installer::Step::Status::PACKAGE_NOT_FOUND; - } - if (!context_->manifest_data.get()) { - LOG(ERROR) << "no manifest info available"; - return common_installer::Step::Status::INVALID_VALUE; - } - // TODO(w.kosowicz): check if config of installed app was encrypted - backend_data_ = static_cast(context_->backend_data.get()); - if (!backend_data_) { - LOG(ERROR) << "no backend data"; - return common_installer::Step::Status::ERROR; - } - return common_installer::Step::Status::OK; -} - -common_installer::Step::Status StepRDSModify::process() { - LOG(INFO) << "entered process of step modify"; - if (!SetUpTempBackupDir()) { - LOG(ERROR) << "unable to setup temp directory"; - return common_installer::Step::Status::ERROR; - } - context_->pkg_path.set( - context_->root_application_path.get() /context_->pkgid.get()); - bf::path install_path = context_->pkg_path.get() / "res" / "wgt"; - bf::path unzip_path = context_->unpacked_dir_path.get(); - if (!AddFiles(unzip_path, install_path) || - !ModifyFiles(unzip_path, install_path) || - !DeleteFiles(install_path)) { - LOG(ERROR) << "error during file operation"; - return common_installer::Step::Status::ERROR; - } - return common_installer::Step::Status::OK; -} - -common_installer::Step::Status StepRDSModify::undo() { - RestoreFiles(); - return common_installer::Step::Status::OK; -} - -common_installer::Step::Status StepRDSModify::clean() { - if (bf::exists(backup_temp_dir_)) - bf::remove_all(backup_temp_dir_); - return common_installer::Step::Status::OK; -} - -bool StepRDSModify::AddFiles(bf::path unzip_path, bf::path install_path) { - LOG(INFO) << "about to add files"; - bs::error_code error; - for (const auto& file : backend_data_->files_to_add.get()) { - if (!PerformBackup(file, Operation::ADD)) { - LOG(ERROR) << "unable to perform backup of added file"; - return false; - } - bf::path temp_install_path(install_path / file); - if (bf::is_directory(temp_install_path)) { - if (!bf::exists(temp_install_path) && - (!cu::CreateDir(temp_install_path))) { - LOG(ERROR) << "unable to create dir for temp backup data"; - return false; - } - } else { - if (!bf::exists(temp_install_path.parent_path()) && - !cu::CreateDir(temp_install_path.parent_path())) { - LOG(ERROR) << "unable to create dir for temp backup data"; - return false; - } - bf::path temp_unzip_path(unzip_path / file); - bf::copy_file(temp_unzip_path, temp_install_path, error); - if (error) { - LOG(ERROR) << "unable to add file " << error.message(); - return false; - } - } - } - return true; -} - -bool StepRDSModify::ModifyFiles(bf::path unzip_path, bf::path install_path) { - LOG(INFO) << "about to modify files"; - bs::error_code error; - for (const auto& file : backend_data_->files_to_modify.get()) { - bf::path temp_install_path(install_path / file); - bf::path temp_unzip_path(unzip_path / file); - if (!PerformBackup(file, Operation::MODIFY)) { - LOG(ERROR) << "unable to perform backup of to be modified file"; - return false; - } - bf::copy_file(temp_unzip_path, temp_install_path, - bf::copy_option::overwrite_if_exists, error); - if (error) { - LOG(ERROR) << "unable to modify file " << error.message(); - return false; - } - } - return true; -} - -bool StepRDSModify::DeleteFiles(bf::path install_path) { - LOG(INFO) << "about to delete files"; - bs::error_code error; - for (const auto& file : backend_data_->files_to_delete.get()) { - if (!PerformBackup(file, Operation::DELETE)) { - LOG(ERROR) << "unable to perform backup of to be deleted file"; - return false; - } - bf::remove(install_path / file, error); - if (error) { - LOG(ERROR) <<"unable to delete files " << error.message(); - return false; - } - } - return true; -} - -bool StepRDSModify::SetUpTempBackupDir() { - LOG(INFO) << "about to setup tmp backup dir"; - bs::error_code error; - backup_temp_dir_ = "/tmp/" / - bf::unique_path("%%%%-%%%%-%%%%-%%%%", error); - if (error || !cu::CreateDir(backup_temp_dir_)) { - LOG(ERROR) << "unable to create backup data temp dir"; - return false; - } - - return true; -} - -bool StepRDSModify::PerformBackup(std::string relative_path, - Operation operation) { - if (backup_temp_dir_.empty()) - return false; - if (operation == Operation::DELETE || operation == Operation::MODIFY) { - bf::path app_path = context_->pkg_path.get() / "res" / "wgt"; - bf::path source_path = app_path / relative_path; - if (bf::is_directory(source_path)) { - if (!cu::CreateDir(backup_temp_dir_ / relative_path)) { - LOG(ERROR) << "unable to create dir for temp backup data"; - return false; - } - } else { - bs::error_code error; - bf::path tmp_dest_path = backup_temp_dir_ / relative_path; - if (!bf::exists((tmp_dest_path).parent_path()) && - (!cu::CreateDir((tmp_dest_path).parent_path()))) { - LOG(ERROR) << "unable to create dir for temp backup data"; - return false; - } - bf::copy_file(source_path, tmp_dest_path, error); - if (error) { - LOG(ERROR) << "unable to backup file: " - << source_path << " : " << error.message(); - return false; - } - } - } - success_modifications_.push_back(std::make_pair(relative_path, operation)); - return true; -} - -void StepRDSModify::RestoreFiles() { - LOG(ERROR) << "error occured about to restore files"; - bf::path app_path(context_->pkg_path.get()); - for (std::pair& modification : - success_modifications_) { - bf::path source_path(backup_temp_dir_ / modification.first); - bf::path destination_path(app_path / modification.first); - if (modification.second == Operation::ADD) { - if (bf::is_directory(source_path)) { - bf::remove_all(destination_path); - } else { - bf::remove(destination_path); - } - } else if (modification.second == Operation::MODIFY) { - bf::copy_file(source_path, destination_path, - bf::copy_option::overwrite_if_exists); - } else { - if (bf::is_directory(source_path)) { - cu::CreateDir(destination_path); - } else { - bf::copy_file(source_path, destination_path, - bf::copy_option::overwrite_if_exists); - } - } - } - // after files are restore delete temporary location - bf::remove_all(backup_temp_dir_); -} - -} // namespace rds -} // namespace wgt diff --git a/src/wgt/step/rds/step_rds_modify.h b/src/wgt/step/rds/step_rds_modify.h deleted file mode 100644 index 31d4c3b..0000000 --- a/src/wgt/step/rds/step_rds_modify.h +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved -// Use of this source code is governed by a apache 2.0 license that can be -// found in the LICENSE file. - -#ifndef WGT_STEP_RDS_STEP_RDS_MODIFY_H_ -#define WGT_STEP_RDS_STEP_RDS_MODIFY_H_ - -#include -#include -#include -#include -#include - -#include "wgt/wgt_backend_data.h" - -namespace wgt { -namespace rds { - -/** - * \brief Step that apply RDS modification during reinstallation process - */ -class StepRDSModify : public common_installer::Step { - public: - /** - * \brief Explicit constructor - * - * \param context Installer context - */ - explicit StepRDSModify(common_installer::InstallerContext* context); - - /** - * \brief - * - * \return - */ - Status process() override; - - /** - * \brief Remove files from temporary location - * - * \return Status::OK - */ - Status clean() override; - - /** - * \brief Restore files to the state from before RDS installation - * - * \return Status::OK - */ - Status undo() override; - - /** - * \brief - * - * \return Status::ERROR when manifest is missing, pkgid is missing, - * or when path to the unpacked directory is missing or not exist, - * Status::OK otherwise - */ - Status precheck() override; - - private: - enum class Operation { - ADD, - MODIFY, - DELETE - }; - - bool AddFiles(boost::filesystem::path unzip_path, - boost::filesystem::path install_path); - bool ModifyFiles(boost::filesystem::path unzip_path, - boost::filesystem::path install_path); - bool DeleteFiles(boost::filesystem::path install_path); - bool SetUpTempBackupDir(); - void DeleteTempBackupDir(); - bool PerformBackup(std::string relative_path, Operation operation); - void RestoreFiles(); - - WgtBackendData* backend_data_; - std::vector> success_modifications_; - boost::filesystem::path backup_temp_dir_; - std::vector files_to_modify_; - std::vector files_to_add_; - std::vector files_to_delete_; -}; -} // namespace rds -} // namespace wgt - -#endif // WGT_STEP_RDS_STEP_RDS_MODIFY_H_ diff --git a/src/wgt/step/rds/step_rds_parse.cc b/src/wgt/step/rds/step_rds_parse.cc deleted file mode 100644 index 31ce2b4..0000000 --- a/src/wgt/step/rds/step_rds_parse.cc +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved -// Use of this source code is governed by a apache 2.0 license that can be -// found in the LICENSE file. - -#include "wgt/step/rds/step_rds_parse.h" - -#include - -#include - -#include "wgt/rds_parser.h" -#include "wgt/wgt_backend_data.h" - - -namespace wgt { -namespace rds { - -namespace bf = boost::filesystem; - -common_installer::Step::Status StepRDSParse::precheck() { - bf::path rdsPath(context_->unpacked_dir_path.get() / ".rds_delta"); - if (!bf::exists(rdsPath)) { - LOG(ERROR) << "no rds_delta file"; - return common_installer::Step::Status::INVALID_VALUE; - } - rds_file_path_ = rdsPath; - return common_installer::Step::Status::OK; -} - -common_installer::Step::Status StepRDSParse::process() { - wgt::rds_parser::RDSParser parser(rds_file_path_.native()); - if (!parser.Parse()) { - LOG(ERROR) << "parsing of rds delta failed"; - return common_installer::Step::Status::PARSE_ERROR; - } - - WgtBackendData* backend_data = - static_cast(context_->backend_data.get()); - if (!backend_data) { - LOG(ERROR) << "no wgt backend data available"; - return common_installer::Step::Status::PARSE_ERROR; - } - backend_data->files_to_modify.set(parser.files_to_modify()); - backend_data->files_to_add.set(parser.files_to_add()); - backend_data->files_to_delete.set(parser.files_to_delete()); - return common_installer::Step::Status::OK; -} - -} // namespace rds -} // namespace wgt diff --git a/src/wgt/step/rds/step_rds_parse.h b/src/wgt/step/rds/step_rds_parse.h deleted file mode 100644 index 649df10..0000000 --- a/src/wgt/step/rds/step_rds_parse.h +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved -// Use of this source code is governed by a apache 2.0 license that can be -// found in the LICENSE file. - -#ifndef WGT_STEP_RDS_STEP_RDS_PARSE_H_ -#define WGT_STEP_RDS_STEP_RDS_PARSE_H_ - -#include - -#include -#include -#include - -namespace wgt { -namespace rds { - -/** - * \brief This step parse .rds_delta file - * - * This is to prepare RDS installation process - */ -class StepRDSParse : public common_installer::Step { - public: - using Step::Step; - - /** - * \brief Parse .rds_delta file - * - * \return Status::ERROR when wgt backend data are missing, - * Status::OK otherwise - */ - Status process() override; - - /** - * \brief Empty method - * - * \return Status::OK - */ - Status clean() override { return Status::OK; } - - /** - * \brief Empty method - * - * \return Status::OK - */ - Status undo() override { return Status::OK; } - - /** - * \brief Validate if .rds_delta file exist - * - * \return Status::Error if file not exist, - * Status::OK otherwise - */ - Status precheck() override; - - private: - boost::filesystem::path rds_file_path_; -}; - -} // namespace rds -} // namespace wgt - -#endif // WGT_STEP_RDS_STEP_RDS_PARSE_H_ diff --git a/src/wgt/step/rds/step_wgt_rds_modify.cc b/src/wgt/step/rds/step_wgt_rds_modify.cc new file mode 100644 index 0000000..aa293e9 --- /dev/null +++ b/src/wgt/step/rds/step_wgt_rds_modify.cc @@ -0,0 +1,23 @@ +// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +// Use of this source code is governed by a apache 2.0 license that can be +// found in the LICENSE file. + +#include "wgt/step/rds/step_wgt_rds_modify.h" + +#include +#include + +#include +#include +#include + +namespace wgt { +namespace rds { + +std::string StepWgtRDSModify::GetAppPath() { + boost::filesystem::path p = context_->pkg_path.get() / "res" / "wgt"; + return p.string(); +} + +} // namespace rds +} // namespace wgt diff --git a/src/wgt/step/rds/step_wgt_rds_modify.h b/src/wgt/step/rds/step_wgt_rds_modify.h new file mode 100644 index 0000000..f09347d --- /dev/null +++ b/src/wgt/step/rds/step_wgt_rds_modify.h @@ -0,0 +1,39 @@ +// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +// Use of this source code is governed by a apache 2.0 license that can be +// found in the LICENSE file. + +#ifndef WGT_STEP_RDS_STEP_WGT_RDS_MODIFY_H_ +#define WGT_STEP_RDS_STEP_WGT_RDS_MODIFY_H_ + +#include +#include +#include + +#include +#include +#include + +#include "common/installer_context.h" + +namespace wgt { +namespace rds { + +/** + * \brief Step that apply RDS modification during reinstallation process + */ +class StepWgtRDSModify : public common_installer::rds::StepRDSModify { + public: + using StepRDSModify::StepRDSModify; + + /** + * \brief return app path + * + * \return std::string + */ + std::string GetAppPath() override; +}; + +} // rds +} // wgt + +#endif // WGT_STEP_RDS_STEP_WGT_RDS_MODIFY_H_ diff --git a/src/wgt/wgt_backend_data.h b/src/wgt/wgt_backend_data.h index 15daa7e..8fdf4a4 100644 --- a/src/wgt/wgt_backend_data.h +++ b/src/wgt/wgt_backend_data.h @@ -22,21 +22,6 @@ namespace wgt { class WgtBackendData : public common_installer::BackendData { public: /** - * \brief Property of vector of files to add - */ - Property> files_to_add; - - /** - * \brief Property of vector of files to modify - */ - Property> files_to_modify; - - /** - * \brief Property of vector of files to delete - */ - Property> files_to_delete; - - /** * \brief Property of SettingInfo */ Property settings; diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index b0a5dea..00624b8 100644 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -51,6 +51,8 @@ #include #include +#include +#include #include "wgt/step/configuration/step_parse.h" #include "wgt/step/configuration/step_parse_recovery.h" @@ -61,8 +63,7 @@ #include "wgt/step/filesystem/step_wgt_patch_storage_directories.h" #include "wgt/step/filesystem/step_wgt_resource_directory.h" #include "wgt/step/pkgmgr/step_generate_xml.h" -#include "wgt/step/rds/step_rds_modify.h" -#include "wgt/step/rds/step_rds_parse.h" +#include "wgt/step/rds/step_wgt_rds_modify.h" #include "wgt/step/security/step_add_default_privileges.h" #include "wgt/step/security/step_check_settings_level.h" #include "wgt/step/security/step_check_wgt_background_category.h" @@ -164,8 +165,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, ci::configuration::StepParseManifest::StoreLocation::BACKUP); AddStep(); - AddStep(); - AddStep(); + AddStep(); + AddStep(); AddStep(); break; } -- 2.7.4 From 1d452447286a53f996c4dcf40b52210c394126fd Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Thu, 10 Mar 2016 11:34:44 +0100 Subject: [PATCH 12/16] Clear data smoke test Change-Id: Ibf74ce0f88d79fd4918f5ae0e744269c74164a4c --- src/unit_tests/smoke_test.cc | 49 +++++++++++++++++++++++- src/unit_tests/test_samples/smoke/ClearMode.wgt | Bin 0 -> 33311 bytes 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 src/unit_tests/test_samples/smoke/ClearMode.wgt diff --git a/src/unit_tests/smoke_test.cc b/src/unit_tests/smoke_test.cc index 7086e91..5bd6d95 100644 --- a/src/unit_tests/smoke_test.cc +++ b/src/unit_tests/smoke_test.cc @@ -71,6 +71,14 @@ enum class PackageType { HYBRID }; +bool TouchFile(const bf::path& path) { + FILE* f = fopen(path.c_str(), "w+"); + if (!f) + return false; + fclose(f); + return true; +} + void RemoveAllRecoveryFiles() { bf::path root_path = ci::GetRootAppPath(false); if (!bf::exists(root_path)) @@ -142,7 +150,8 @@ void ValidatePackageFS(const std::string& pkgid, for (auto& appid : appids) { bf::path binary_path = package_path / "bin" / appid; ASSERT_TRUE(bf::exists(binary_path)); - bf::path icon_path = bf::path(getIconPath(getuid(), false)) / (appid + ".png"); + bf::path icon_path = + bf::path(getIconPath(getuid(), false)) / (appid + ".png"); ASSERT_TRUE(bf::exists(icon_path)); bf::path icon_backup = ci::GetBackupPathForIconFile(icon_path); ASSERT_FALSE(bf::exists(icon_backup)); @@ -174,7 +183,8 @@ void PackageCheckCleanup(const std::string& pkgid, ASSERT_FALSE(bf::exists(manifest_path)); for (auto& appid : appids) { - bf::path icon_path = bf::path(getIconPath(getuid(), false)) / (appid + ".png"); + bf::path icon_path = + bf::path(getIconPath(getuid(), false)) / (appid + ".png"); ASSERT_FALSE(bf::exists(icon_path)); bf::path icon_backup = ci::GetBackupPathForIconFile(icon_path); ASSERT_FALSE(bf::exists(icon_backup)); @@ -309,6 +319,23 @@ ci::AppInstaller::Result DeltaInstall(const bf::path& path, return Install(delta_package, type); } +ci::AppInstaller::Result Clear(const std::string& pkgid, + PackageType type, + RequestResult mode = RequestResult::NORMAL) { + const char* argv[] = {"", "-c", pkgid.c_str()}; + TestPkgmgrInstaller pkgmgr_installer; + std::unique_ptr query_interface = + CreateQueryInterface(); + auto pkgmgr = + ci::PkgMgrInterface::Create(SIZEOFARRAY(argv), const_cast(argv), + &pkgmgr_installer, query_interface.get()); + if (!pkgmgr) { + LOG(ERROR) << "Failed to initialize pkgmgr interface"; + return ci::AppInstaller::Result::UNKNOWN; + } + return RunInstallerWithPkgrmgr(pkgmgr, type, mode); +} + ci::AppInstaller::Result Recover(const bf::path& recovery_file, PackageType type, RequestResult mode = RequestResult::NORMAL) { @@ -418,6 +445,24 @@ TEST_F(SmokeTest, RDSMode) { ValidateFileContentInPackage(pkgid, "res/wgt/MODIFIED", "2\n"); } +TEST_F(SmokeTest, ClearMode) { + bf::path path = kSmokePackagesDirectory / "ClearMode.wgt"; + std::string pkgid = "smokeapp20"; + std::string appid = "smokeapp20.ClearMode"; + ASSERT_EQ(Install(path, PackageType::WGT), + ci::AppInstaller::Result::OK); + bf::path root_path = ci::GetRootAppPath(false); + bs::error_code error; + bf::create_directory(root_path / pkgid / "data" / "dir", error); + ASSERT_FALSE(error); + ASSERT_TRUE(TouchFile(root_path / pkgid / "data" / "dir" / "file")); + ASSERT_TRUE(TouchFile(root_path / pkgid / "data" / "file")); + ASSERT_EQ(Clear(pkgid, PackageType::WGT), ci::AppInstaller::Result::OK); + ValidatePackage(pkgid, {appid}); + ASSERT_FALSE(bf::exists(root_path / pkgid / "data" / "dir" / "file")); + ASSERT_FALSE(bf::exists(root_path / pkgid / "res" / "file")); +} + TEST_F(SmokeTest, DeltaMode) { bf::path path = kSmokePackagesDirectory / "DeltaMode.wgt"; bf::path delta_package = kSmokePackagesDirectory / "DeltaMode.delta"; diff --git a/src/unit_tests/test_samples/smoke/ClearMode.wgt b/src/unit_tests/test_samples/smoke/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?L__+A zgY<7A%DUOS7y;-I6{!AmC2I#Wb5ABKS9`k#71wJIlnA76>LWCxlXZLbfhrXdv?6lE z{m>xd7&rt57zXHB@o-@O&{;%1ge1~HWG5&P-vt?TmH%B#U0j%5T)phfnLxk&+w|X0 zp8t<&Kj?!0{T%v#Tm5s^f4{STC~f~Kd9wd6o8})QBFO*S%l|LI4d=gXKy82p1P+0W z{wLiH`v211{zY~BcPIW$@%m3EFy#Ly;p^Xa|D5;Vo&Sd*^q+zP{J(Uee_Q;UF7zJ@ zHju^t4|(X{7x>5EznlDLCj6(Q`~O#0|84N^dGQ~E4v@irW{I*q^gmQ2FnG|00BYeA JbQBEi{{VHEsFnZ# literal 0 HcmV?d00001 -- 2.7.4 From fd48c6a2195db0976ccd8e6f95e09a88948d76a5 Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Tue, 5 Apr 2016 13:59:59 +0200 Subject: [PATCH 13/16] Reorder StepUpdateTep tep_name is passed directly in manifest_x structure during package registration in pkgmgr_parser database. Verify that after package update pkgmgr_parser database still contains correct value of tep_name (database .pkgmgr_parser.db, table: package_info, column: package_tep_name). Change-Id: Iddb5d5244e3a9850e2d07e24576afc2c5356a68d --- src/hybrid/hybrid_installer.cc | 3 +-- src/wgt/wgt_installer.cc | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc index 9d5675f..9727c54 100644 --- a/src/hybrid/hybrid_installer.cc +++ b/src/hybrid/hybrid_installer.cc @@ -126,6 +126,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -138,8 +139,6 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); - // TODO(t.iwanek): this step is supposed to be removed as it is quickfix - AddStep(); break; case ci::RequestType::Uninstall: AddStep(pkgmgr_); diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index 00624b8..2476a32 100644 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -124,6 +124,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -134,8 +135,6 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep( ci::Plugin::ActionType::Upgrade); AddStep(); - // TODO(t.iwanek): this step is supposed to be removed as it is quickfix - AddStep(); break; } case ci::RequestType::Uninstall: { -- 2.7.4 From 6e11d4d9bb83e1c048120a81b77644ab7e011627 Mon Sep 17 00:00:00 2001 From: Kamil Rojewski Date: Fri, 22 Apr 2016 13:27:59 +0200 Subject: [PATCH 14/16] switched raw ptrs to shared_ptrs to avoid leaks Must be submitted with: - https://review.tizen.org/gerrit/67906 Change-Id: I5305bec45ff0484d00378a65269f3304dada449c --- src/wgt/wgt_app_query_interface.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wgt/wgt_app_query_interface.cc b/src/wgt/wgt_app_query_interface.cc index b45389c..68da917 100644 --- a/src/wgt/wgt_app_query_interface.cc +++ b/src/wgt/wgt_app_query_interface.cc @@ -64,9 +64,9 @@ std::string GetPkgIdFromPath(const std::string& path) { return {}; } bf::path config_path = tmp_path / "config.xml"; - std::vector handlers = { - new wgt::parse::WidgetHandler(), - new wgt::parse::TizenApplicationHandler() + std::vector> handlers = { + std::make_shared(), + std::make_shared() }; std::unique_ptr registry( new parser::ManifestHandlerRegistry(handlers)); -- 2.7.4 From f7439fa8f82ac6e18dc21eb2e1aa067a05477e22 Mon Sep 17 00:00:00 2001 From: Kamil Rojewski Date: Mon, 25 Apr 2016 12:52:29 +0200 Subject: [PATCH 15/16] verifying notification category privilege Change-Id: I4850ccc6a91bb2c2bb18a91032d75da1305db02d --- src/wgt/CMakeLists.txt | 1 + .../step_check_wgt_notification_category.cc | 41 ++++++++++++++++++++++ .../step_check_wgt_notification_category.h | 31 ++++++++++++++++ src/wgt/wgt_installer.cc | 4 +++ 4 files changed, 77 insertions(+) create mode 100644 src/wgt/step/security/step_check_wgt_notification_category.cc create mode 100644 src/wgt/step/security/step_check_wgt_notification_category.h diff --git a/src/wgt/CMakeLists.txt b/src/wgt/CMakeLists.txt index 1b515f7..5ab8b00 100644 --- a/src/wgt/CMakeLists.txt +++ b/src/wgt/CMakeLists.txt @@ -13,6 +13,7 @@ SET(SRCS step/security/step_add_default_privileges.cc step/security/step_check_settings_level.cc step/security/step_check_wgt_background_category.cc + step/security/step_check_wgt_notification_category.cc wgt_app_query_interface.cc wgt_installer.cc ) diff --git a/src/wgt/step/security/step_check_wgt_notification_category.cc b/src/wgt/step/security/step_check_wgt_notification_category.cc new file mode 100644 index 0000000..67eca45 --- /dev/null +++ b/src/wgt/step/security/step_check_wgt_notification_category.cc @@ -0,0 +1,41 @@ +// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +// Use of this source code is governed by a apache 2.0 license that can be +// found in the LICENSE file. + +#include + +#include + +#include + +namespace { +const char kNotificationCategoryName[] + = "http://tizen.org/category/always_on_top"; +} + +namespace wgt { +namespace security { + +common_installer::Step::Status StepCheckWgtNotificationCategory::process() { + const auto notificationAllowed = context_->privilege_level.get() >= + common_installer::PrivilegeLevel::PARTNER; + + // no point in checking if priv is set + if (notificationAllowed) + return Status::OK; + + for (const auto app : + GListRange(context_->manifest_data.get()->application)) { + for (const auto category : GListRange(app->category)) { + if (strcmp(category, kNotificationCategoryName) == 0) { + LOG(ERROR) << "Insufficient privileges for notification category."; + return Status::PRIVILEGE_ERROR; + } + } + } + + LOG(INFO) << "No notification category present."; + return Status::OK; +} +} // namespace security +} // namespace wgt diff --git a/src/wgt/step/security/step_check_wgt_notification_category.h b/src/wgt/step/security/step_check_wgt_notification_category.h new file mode 100644 index 0000000..738a6ea --- /dev/null +++ b/src/wgt/step/security/step_check_wgt_notification_category.h @@ -0,0 +1,31 @@ +// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved +// Use of this source code is governed by a apache 2.0 license that can be +// found in the LICENSE file. + +#ifndef WGT_STEP_SECURITY_STEP_CHECK_WGT_NOTIFICATION_CATEGORY_H_ +#define WGT_STEP_SECURITY_STEP_CHECK_WGT_NOTIFICATION_CATEGORY_H_ + +#include + +namespace wgt { +namespace security { + +/** + * \brief Checks if the app can show notifications, if it requires that feature. + */ +class StepCheckWgtNotificationCategory : + public common_installer::Step { + public: + using common_installer::Step::Step; + ~StepCheckWgtNotificationCategory() = default; + + Status process() override; + + Status clean() override { return Status::OK; } + Status undo() override { return Status::OK; } + Status precheck() override { return Status::OK; } +}; +} // namespace security +} // namespace wgt + +#endif // WGT_STEP_SECURITY_STEP_CHECK_WGT_NOTIFICATION_CATEGORY_H_ diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index 2476a32..1ba2c06 100644 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -67,6 +67,7 @@ #include "wgt/step/security/step_add_default_privileges.h" #include "wgt/step/security/step_check_settings_level.h" #include "wgt/step/security/step_check_wgt_background_category.h" +#include "wgt/step/security/step_check_wgt_notification_category.h" namespace ci = common_installer; @@ -87,6 +88,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -114,6 +116,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep( @@ -182,6 +185,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep( -- 2.7.4 From 37728c74c4a7957d18aeda51c045117e85146e08 Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Tue, 12 Apr 2016 13:09:32 +0200 Subject: [PATCH 16/16] Mount install steps Mount install is run by "-w $pkgid" option. Mount install, update mount install and deinstallation of mount-installed package should work. Requires: - https://review.tizen.org/gerrit/#/c/65361/ Change-Id: Ie5f6e238160861097359bcb5066b81365e806709 --- src/hybrid/hybrid_installer.cc | 80 ++++++++++++ src/wgt/CMakeLists.txt | 2 + .../step_wgt_prepare_package_directory.cc | 74 ++++++++++++ .../step_wgt_prepare_package_directory.h | 45 +++++++ .../step_wgt_update_package_directory.cc | 134 +++++++++++++++++++++ .../filesystem/step_wgt_update_package_directory.h | 33 +++++ src/wgt/wgt_app_query_interface.cc | 3 +- src/wgt/wgt_installer.cc | 70 +++++++++++ 8 files changed, 440 insertions(+), 1 deletion(-) create mode 100644 src/wgt/step/filesystem/step_wgt_prepare_package_directory.cc create mode 100644 src/wgt/step/filesystem/step_wgt_prepare_package_directory.h create mode 100644 src/wgt/step/filesystem/step_wgt_update_package_directory.cc create mode 100644 src/wgt/step/filesystem/step_wgt_update_package_directory.h diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc index 9727c54..e6ea1fa 100644 --- a/src/hybrid/hybrid_installer.cc +++ b/src/hybrid/hybrid_installer.cc @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -26,7 +27,11 @@ #include #include #include +#include #include +#include +#include +#include #include #include #include @@ -48,6 +53,8 @@ #include #include +#include +#include #include "hybrid/hybrid_backend_data.h" #include "hybrid/step/configuration/step_merge_tpk_config.h" @@ -121,6 +128,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep( ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, ci::configuration::StepParseManifest::StoreLocation::BACKUP); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -153,6 +161,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -181,6 +190,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep( ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, ci::configuration::StepParseManifest::StoreLocation::BACKUP); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -219,6 +229,76 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(pkgmgr_); AddStep(); break; + case ci::RequestType::MountInstall: + AddStep(pkgmgr_); + AddStep(); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::PACKAGE, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); + AddStep(); + AddStep(true); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep( + ci::Plugin::ActionType::Install); + AddStep(); + AddStep(); + AddStep(); + break; + case ci::RequestType::MountUpdate: + AddStep(pkgmgr_); + AddStep(); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::PACKAGE, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); + AddStep(); + AddStep(true); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::BACKUP); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep( + ci::Plugin::ActionType::Upgrade); + break; default: AddStep(); break; diff --git a/src/wgt/CMakeLists.txt b/src/wgt/CMakeLists.txt index 5ab8b00..41de461 100644 --- a/src/wgt/CMakeLists.txt +++ b/src/wgt/CMakeLists.txt @@ -7,7 +7,9 @@ SET(SRCS step/filesystem/step_create_symbolic_link.cc step/filesystem/step_wgt_patch_icons.cc step/filesystem/step_wgt_patch_storage_directories.cc + step/filesystem/step_wgt_prepare_package_directory.cc step/filesystem/step_wgt_resource_directory.cc + step/filesystem/step_wgt_update_package_directory.cc step/pkgmgr/step_generate_xml.cc step/rds/step_wgt_rds_modify.cc step/security/step_add_default_privileges.cc diff --git a/src/wgt/step/filesystem/step_wgt_prepare_package_directory.cc b/src/wgt/step/filesystem/step_wgt_prepare_package_directory.cc new file mode 100644 index 0000000..fc4907b --- /dev/null +++ b/src/wgt/step/filesystem/step_wgt_prepare_package_directory.cc @@ -0,0 +1,74 @@ +// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +// Use of this source code is governed by an apache-2.0 license that can be +// found in the LICENSE file. + +#include "wgt/step/filesystem/step_wgt_prepare_package_directory.h" + +#include +#include +#include + +#include +#include + +namespace bf = boost::filesystem; +namespace bs = boost::system; +namespace ci = common_installer; + +namespace { + +const char kResWgtDirectory[] = "res/wgt"; + +} // namespace + +namespace wgt { +namespace filesystem { + +ci::Step::Status StepWgtPreparePackageDirectory::CreateSymlinkToMountPoint() { + bs::error_code error; + bf::path mount_point = ci::GetMountLocation(context_->pkg_path.get()); + bf::path res_wgt_link = context_->pkg_path.get() / kResWgtDirectory; + if (bf::exists(res_wgt_link)) { + if (!bf::is_symlink(res_wgt_link)) { + LOG(ERROR) << res_wgt_link << " is not symlink. Cannot proceed"; + return Status::APP_DIR_ERROR; + } + bf::remove(res_wgt_link, error); + if (error) { + LOG(ERROR) << "Failed to remote old symlink to wgt resource directory"; + return Status::APP_DIR_ERROR; + } + } else { + bf::create_directories(res_wgt_link.parent_path(), error); + if (error) { + LOG(ERROR) << "Failed to create " << kResWgtDirectory << " directory"; + return Status::APP_DIR_ERROR; + } + } + bf::create_symlink(mount_point, res_wgt_link, error); + if (error) { + LOG(ERROR) << "Failed to create symlink to widget image"; + return Status::APP_DIR_ERROR; + } + return Status::OK; +} + +ci::Step::Status StepWgtPreparePackageDirectory::process() { + Status status = CreateSymlinkToMountPoint(); + if (status != Status::OK) + return status; + LOG(DEBUG) << "Symlink to mount point created"; + + return Status::OK; +} + +ci::Step::Status StepWgtPreparePackageDirectory::precheck() { + if (context_->pkg_path.get().empty()) { + LOG(ERROR) << "Package installation path is not set"; + return Status::INVALID_VALUE; + } + return Status::OK; +} + +} // namespace filesystem +} // namespace wgt diff --git a/src/wgt/step/filesystem/step_wgt_prepare_package_directory.h b/src/wgt/step/filesystem/step_wgt_prepare_package_directory.h new file mode 100644 index 0000000..6d35f30 --- /dev/null +++ b/src/wgt/step/filesystem/step_wgt_prepare_package_directory.h @@ -0,0 +1,45 @@ +// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +// Use of this source code is governed by an apache-2.0 license that can be +// found in the LICENSE file. + +#ifndef WGT_STEP_FILESYSTEM_STEP_WGT_PREPARE_PACKAGE_DIRECTORY_H_ +#define WGT_STEP_FILESYSTEM_STEP_WGT_PREPARE_PACKAGE_DIRECTORY_H_ + +#include + +#include +#include + +#include + +#include "common/installer_context.h" +#include "common/step/step.h" + +namespace wgt { +namespace filesystem { + +/** + * \brief Responsible for adjusting package directory after mounting zip package + * by StepMountInstall or StepMountUpdate + * + * This step will preserve old application symlinks in bin/ directory. + */ +class StepWgtPreparePackageDirectory : public common_installer::Step { + public: + using Step::Step; + + Status process() override; + Status clean() override { return Status::OK; } + Status undo() override { return Status::OK; } + Status precheck() override; + + private: + Status CreateSymlinkToMountPoint(); + + SCOPE_LOG_TAG(WgtPreparePackageDirectory) +}; + +} // namespace filesystem +} // namespace wgt + +#endif // WGT_STEP_FILESYSTEM_STEP_WGT_PREPARE_PACKAGE_DIRECTORY_H_ diff --git a/src/wgt/step/filesystem/step_wgt_update_package_directory.cc b/src/wgt/step/filesystem/step_wgt_update_package_directory.cc new file mode 100644 index 0000000..0aadad5 --- /dev/null +++ b/src/wgt/step/filesystem/step_wgt_update_package_directory.cc @@ -0,0 +1,134 @@ +// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +// Use of this source code is governed by an apache-2.0 license that can be +// found in the LICENSE file. + +#include "wgt/step/filesystem/step_wgt_update_package_directory.h" + +#include +#include +#include + +#include +#include + +namespace bf = boost::filesystem; +namespace bs = boost::system; +namespace ci = common_installer; + +namespace { + +const char* kBackupEntries[] = { + "bin", + "shared/res" +}; + +bool MoveCreateDir(const bf::path& source, const bf::path& destination) { + if (!bf::exists(destination.parent_path())) { + bs::error_code error; + bf::create_directories(destination.parent_path(), error); + if (error) { + LOG(ERROR) << "Cannot create directory: " << destination.parent_path(); + return false; + } + } + if (!ci::MoveDir(source, destination)) { + LOG(ERROR) << "Failed to move directory " << destination; + return false; + } + return true; +} + +} // namespace + +namespace wgt { +namespace filesystem { + +ci::Step::Status +StepWgtUpdatePackageDirectory::CreateBackupOfDirectories() { + bf::path backup_path = + ci::GetBackupPathForPackagePath(context_->pkg_path.get()); + for (auto& entry : kBackupEntries) { + bf::path directory = context_->pkg_path.get() / entry; + if (!bf::exists(directory)) + continue; + LOG(DEBUG) << "Backup directory entry: " << entry; + bf::path directory_backup = backup_path / entry; + if (!MoveCreateDir(directory, directory_backup)) { + LOG(ERROR) << "Failed to create backup directory " + << directory_backup; + return Status::APP_DIR_ERROR; + } + } + return Status::OK; +} + +ci::Step::Status +StepWgtUpdatePackageDirectory::RecoverBackupOfDirectories() { + bf::path backup_path = + ci::GetBackupPathForPackagePath(context_->pkg_path.get()); + + // skip if there is no backup of directories + if (!bf::exists(backup_path)) + return Status::OK; + + for (auto& entry : kBackupEntries) { + bf::path directory = context_->pkg_path.get() / entry; + bf::path directory_backup = backup_path / entry; + if (!bf::exists(directory_backup)) + continue; + LOG(DEBUG) << "Recover directory entry: " << entry; + if (!ci::MoveDir(directory_backup, directory)) { + LOG(ERROR) << "Failed to restore directory backup " + << directory_backup; + return Status::APP_DIR_ERROR; + } + } + return Status::OK; +} + +ci::Step::Status StepWgtUpdatePackageDirectory::process() { + auto status = CreateBackupOfDirectories(); + if (status != Status::OK) + return status; + LOG(DEBUG) << "Directory backups created"; + + status = StepWgtPreparePackageDirectory::process(); + if (status != Status::OK) + return status; + + return Status::OK; +} + +ci::Step::Status StepWgtUpdatePackageDirectory::clean() { + bf::path backup_path = + ci::GetBackupPathForPackagePath(context_->pkg_path.get()); + if (bf::exists(backup_path)) { + bs::error_code error; + bf::remove_all(backup_path, error); + if (error) { + LOG(ERROR) << "Failed to remove backup directories"; + return Status::APP_DIR_ERROR; + } + } + return Status::OK; +} + +ci::Step::Status StepWgtUpdatePackageDirectory::undo() { + Status status = RecoverBackupOfDirectories(); + if (status != Status::OK) + return status; + bf::path backup_path = + ci::GetBackupPathForPackagePath(context_->pkg_path.get()); + if (bf::exists(backup_path)) { + bs::error_code error; + bf::remove_all(backup_path, error); + if (error) { + LOG(ERROR) << "Failed to remove backup directories"; + return Status::APP_DIR_ERROR; + } + } + return Status::OK; +} + +} // namespace filesystem +} // namespace wgt diff --git a/src/wgt/step/filesystem/step_wgt_update_package_directory.h b/src/wgt/step/filesystem/step_wgt_update_package_directory.h new file mode 100644 index 0000000..aa15c02 --- /dev/null +++ b/src/wgt/step/filesystem/step_wgt_update_package_directory.h @@ -0,0 +1,33 @@ +// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +// Use of this source code is governed by an apache-2.0 license that can be +// found in the LICENSE file. + +#ifndef WGT_STEP_FILESYSTEM_STEP_WGT_UPDATE_PACKAGE_DIRECTORY_H_ +#define WGT_STEP_FILESYSTEM_STEP_WGT_UPDATE_PACKAGE_DIRECTORY_H_ + +#include + +#include "wgt/step/filesystem/step_wgt_prepare_package_directory.h" + +namespace wgt { +namespace filesystem { + +class StepWgtUpdatePackageDirectory : public StepWgtPreparePackageDirectory { + public: + using StepWgtPreparePackageDirectory::StepWgtPreparePackageDirectory; + + Status process() override; + Status undo() override; + Status clean() override; + + private: + Status CreateBackupOfDirectories(); + Status RecoverBackupOfDirectories(); + + SCOPE_LOG_TAG(WgtUpdatePackageDirectory) +}; + +} // namespace filesystem +} // namespace wgt + +#endif // WGT_STEP_FILESYSTEM_STEP_WGT_UPDATE_PACKAGE_DIRECTORY_H_ diff --git a/src/wgt/wgt_app_query_interface.cc b/src/wgt/wgt_app_query_interface.cc index 68da917..02678ee 100644 --- a/src/wgt/wgt_app_query_interface.cc +++ b/src/wgt/wgt_app_query_interface.cc @@ -40,7 +40,8 @@ std::string GetInstallationRequestInfo(int argc, char** argv) { std::string path; for (int i = 0; i < argc; ++i) { if (!strcmp(argv[i], "-i") || !strcmp(argv[i], "-r") || - !strcmp(argv[i], "-d") || !strcmp(argv[i], "-b")) { + !strcmp(argv[i], "-d") || !strcmp(argv[i], "-b") || + !strcmp(argv[i], "-w")) { if (i + 1 < argc) { path = argv[i + 1]; break; diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index 1ba2c06..6fdaa51 100644 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -28,7 +29,11 @@ #include #include #include +#include #include +#include +#include +#include #include #include #include @@ -61,7 +66,9 @@ #include "wgt/step/filesystem/step_create_symbolic_link.h" #include "wgt/step/filesystem/step_wgt_patch_icons.h" #include "wgt/step/filesystem/step_wgt_patch_storage_directories.h" +#include "wgt/step/filesystem/step_wgt_prepare_package_directory.h" #include "wgt/step/filesystem/step_wgt_resource_directory.h" +#include "wgt/step/filesystem/step_wgt_update_package_directory.h" #include "wgt/step/pkgmgr/step_generate_xml.h" #include "wgt/step/rds/step_wgt_rds_modify.h" #include "wgt/step/security/step_add_default_privileges.h" @@ -122,6 +129,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep( ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, ci::configuration::StepParseManifest::StoreLocation::BACKUP); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -153,6 +161,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -166,6 +175,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep( ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, ci::configuration::StepParseManifest::StoreLocation::BACKUP); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -191,6 +201,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep( ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, ci::configuration::StepParseManifest::StoreLocation::BACKUP); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -225,6 +236,65 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); break; } + case ci::RequestType::MountInstall: { + AddStep(pkgmgr_); + AddStep(); + AddStep(true); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep( + ci::Plugin::ActionType::Install); + AddStep(); + AddStep(); + break; + } + case ci::RequestType::MountUpdate: { + AddStep(pkgmgr_); + AddStep(); + AddStep(true); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::BACKUP); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep(); + AddStep( + ci::Plugin::ActionType::Upgrade); + AddStep(); + break; + } default: { AddStep(); } -- 2.7.4