From eaf100f2bde807947ca2df99d804a1d5f94604cd Mon Sep 17 00:00:00 2001
From: Piotr Dabrowski
Date: Fri, 16 Dec 2016 15:16:37 +0100
Subject: [PATCH 01/16] Create private tmp directory in skel
Submit together:
https://review.tizen.org/gerrit/#/c/105467/
https://review.tizen.org/gerrit/#/c/105468/
Change-Id: I7454b05b3d83bac2939594f0d82e8d22d457789c
---
src/hybrid/hybrid_installer.cc | 13 +++++++++----
src/hybrid/shared_dirs.h | 20 ++++++++++++++++++++
src/wgt/shared_dirs.h | 20 ++++++++++++++++++++
src/wgt/wgt_installer.cc | 13 +++++++++----
4 files changed, 58 insertions(+), 8 deletions(-)
create mode 100644 src/hybrid/shared_dirs.h
create mode 100644 src/wgt/shared_dirs.h
diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc
index ccdd3f7..ed90220 100644
--- a/src/hybrid/hybrid_installer.cc
+++ b/src/hybrid/hybrid_installer.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "hybrid/hybrid_installer.h"
+#include "hybrid/shared_dirs.h"
#include
#include
@@ -141,7 +142,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep(
ci::Plugin::ActionType::Install);
- AddStep();
+ AddStep(
+ wgt::filesystem::HybridAdditionalSharedDirs);
AddStep();
AddStep();
break;
@@ -337,7 +339,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep(
ci::Plugin::ActionType::Install);
- AddStep();
+ AddStep(
+ wgt::filesystem::HybridAdditionalSharedDirs);
AddStep();
AddStep();
break;
@@ -411,7 +414,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep(
ci::Plugin::ActionType::Install);
- AddStep();
+ AddStep(
+ wgt::filesystem::HybridAdditionalSharedDirs);
AddStep();
AddStep();
break;
@@ -460,7 +464,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep(
ci::Plugin::ActionType::Install);
- AddStep();
+ AddStep(
+ wgt::filesystem::HybridAdditionalSharedDirs);
AddStep();
break;
}
diff --git a/src/hybrid/shared_dirs.h b/src/hybrid/shared_dirs.h
new file mode 100644
index 0000000..a6a4683
--- /dev/null
+++ b/src/hybrid/shared_dirs.h
@@ -0,0 +1,20 @@
+// 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 HYBRID_SHARED_DIRS_H_
+#define HYBRID_SHARED_DIRS_H_
+
+#include
+
+namespace wgt {
+namespace filesystem {
+
+const std::vector HybridAdditionalSharedDirs = {
+ {"tmp"},
+};
+
+} // namespace filesystem
+} // namespace wgt
+
+#endif // HYBRID_SHARED_DIRS_H_
diff --git a/src/wgt/shared_dirs.h b/src/wgt/shared_dirs.h
new file mode 100644
index 0000000..2b75e91
--- /dev/null
+++ b/src/wgt/shared_dirs.h
@@ -0,0 +1,20 @@
+// 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 HYBRID_SHARED_DIRS_H_
+#define HYBRID_SHARED_DIRS_H_
+
+#include
+
+namespace wgt {
+namespace filesystem {
+
+const std::vector WgtAdditionalSharedDirs = {
+ {"tmp"},
+};
+
+} // namespace filesystem
+} // namespace wgt
+
+#endif // HYBRID_SHARED_DIRS_H_
diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc
index 5929586..cef4e4c 100755
--- a/src/wgt/wgt_installer.cc
+++ b/src/wgt/wgt_installer.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "wgt/wgt_installer.h"
+#include "wgt/shared_dirs.h"
#include
@@ -146,7 +147,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
AddStep();
AddStep(
ci::Plugin::ActionType::Install);
- AddStep();
+ AddStep(
+ wgt::filesystem::WgtAdditionalSharedDirs);
AddStep();
AddStep();
break;
@@ -348,7 +350,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
AddStep();
AddStep();
AddStep();
- AddStep();
+ AddStep(
+ wgt::filesystem::WgtAdditionalSharedDirs);
AddStep();
AddStep();
AddStep();
@@ -420,7 +423,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
AddStep();
AddStep();
AddStep(ci::Plugin::ActionType::Install);
- AddStep();
+ AddStep(
+ wgt::filesystem::WgtAdditionalSharedDirs);
AddStep();
AddStep();
break;
@@ -532,7 +536,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
AddStep();
AddStep();
AddStep(ci::Plugin::ActionType::Install);
- AddStep();
+ AddStep(
+ wgt::filesystem::WgtAdditionalSharedDirs);
AddStep();
break;
}
--
2.7.4
From 8c06a60991d120d64f3147bce724dc1c348276c0 Mon Sep 17 00:00:00 2001
From: Sangyoon Jang
Date: Fri, 16 Dec 2016 18:54:40 +0900
Subject: [PATCH 02/16] Fix generating manifest when install hybrid package
Currently, wgt-backend generate manifest file using manifest_x which is
parsed by manifest parser. This data contains only the parser knows.
However, the manifest file for native packages have many element which
are not parsed manifest parser but parsed by plugin parsers.
So the manifest generated by wgt-backend loses some elements.
This patch will make the manifest have elements as it was before.
StepGenerateXml from hybrid installer will merge original native
manifest into generated widget manifest(config.xml).
Change-Id: Iea0a68c3b695243248469f0794f62f7bec4fa757
Signed-off-by: Sangyoon Jang
---
src/hybrid/CMakeLists.txt | 4 +-
src/hybrid/hybrid_installer.cc | 22 ++--
src/hybrid/step/pkgmgr/step_generate_xml.cc | 189 ++++++++++++++++++++++++++++
src/hybrid/step/pkgmgr/step_generate_xml.h | 45 +++++++
4 files changed, 252 insertions(+), 8 deletions(-)
create mode 100644 src/hybrid/step/pkgmgr/step_generate_xml.cc
create mode 100644 src/hybrid/step/pkgmgr/step_generate_xml.h
diff --git a/src/hybrid/CMakeLists.txt b/src/hybrid/CMakeLists.txt
index e65d713..016c783 100644
--- a/src/hybrid/CMakeLists.txt
+++ b/src/hybrid/CMakeLists.txt
@@ -1,10 +1,12 @@
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} HYBRID_SRCS)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/configuration HYBRID_STEP_CONFIGURATION_SRCS)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/encryption HYBRID_STEP_ENCRYPTION_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/pkgmgr HYBRID_STEP_PKGMGR_SRCS)
ADD_LIBRARY(${TARGET_LIBNAME_HYBRID} STATIC
${HYBRID_SRCS}
${HYBRID_STEP_CONFIGURATION_SRCS}
- ${HYBRID_STEP_ENCRYPTION_SRCS})
+ ${HYBRID_STEP_ENCRYPTION_SRCS}
+ ${HYBRID_STEP_PKGMGR_SRCS})
TARGET_INCLUDE_DIRECTORIES(${TARGET_LIBNAME_HYBRID} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../")
diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc
index ed90220..5aef5e2 100644
--- a/src/hybrid/hybrid_installer.cc
+++ b/src/hybrid/hybrid_installer.cc
@@ -80,6 +80,7 @@
#include "hybrid/step/configuration/step_merge_tpk_config.h"
#include "hybrid/step/configuration/step_stash_tpk_config.h"
#include "hybrid/step/encryption/step_encrypt_resources.h"
+#include "hybrid/step/pkgmgr/step_generate_xml.h"
#include "wgt/step/configuration/step_parse.h"
#include "wgt/step/encryption/step_remove_encryption_data.h"
#include "wgt/step/filesystem/step_copy_preview_icons.h"
@@ -112,7 +113,6 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep(
wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
- AddStep();
AddStep();
AddStep();
AddStep();
@@ -138,6 +138,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep();
AddStep();
+ AddStep();
+ AddStep();
AddStep();
AddStep();
AddStep(
@@ -156,7 +158,6 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep(
wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
- AddStep();
AddStep();
AddStep();
AddStep();
@@ -188,6 +189,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep();
AddStep();
+ AddStep();
+ AddStep();
AddStep();
AddStep(
ci::Plugin::ActionType::Upgrade);
@@ -238,7 +241,6 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep(
wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
- AddStep();
AddStep();
AddStep();
AddStep();
@@ -268,6 +270,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep();
AddStep();
+ AddStep();
+ AddStep();
AddStep();
AddStep(
ci::Plugin::ActionType::Upgrade);
@@ -309,7 +313,6 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep(
wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
- AddStep();
AddStep();
AddStep();
AddStep();
@@ -335,6 +338,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep();
AddStep();
+ AddStep();
+ AddStep();
AddStep();
AddStep();
AddStep(
@@ -353,7 +358,6 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep(
wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
- AddStep();
AddStep();
AddStep();
AddStep();
@@ -384,6 +388,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep();
AddStep();
+ AddStep();
+ AddStep();
AddStep();
AddStep(
ci::Plugin::ActionType::Upgrade);
@@ -399,7 +405,6 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep(
wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
- AddStep();
AddStep();
AddStep();
AddStep();
@@ -410,6 +415,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep();
AddStep();
+ AddStep();
+ AddStep();
AddStep();
AddStep();
AddStep(
@@ -427,7 +434,6 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep(
wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
- AddStep();
AddStep();
AddStep();
AddStep();
@@ -443,6 +449,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep();
AddStep();
+ AddStep();
+ AddStep();
AddStep();
AddStep(
ci::Plugin::ActionType::Upgrade);
diff --git a/src/hybrid/step/pkgmgr/step_generate_xml.cc b/src/hybrid/step/pkgmgr/step_generate_xml.cc
new file mode 100644
index 0000000..7d6f42d
--- /dev/null
+++ b/src/hybrid/step/pkgmgr/step_generate_xml.cc
@@ -0,0 +1,189 @@
+// 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 "hybrid/step/pkgmgr/step_generate_xml.h"
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+#include
+#include
+
+#include "hybrid/hybrid_backend_data.h"
+
+namespace ci = common_installer;
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+
+namespace {
+
+const char kXmlXPathAppExpr[] =
+ "//*[local-name()='ui-application' or local-name()='service-application' "
+ "or local-name()='widget-application' or local-name()='watch-application']";
+const std::vector kBlackListNodes = {
+ {"author"},
+ {"description"},
+ {"profile"},
+};
+const std::vector kNeedMergeNodes = {
+ {"manifest"},
+ {"privileges"},
+};
+const std::vector> kApplicationNodeNames = {
+ {"ui-application", "uiapp"},
+ {"service-application", "svcapp"},
+ {"widget-application", "widgetapp"},
+ {"watch-application", "watchapp"},
+};
+
+} // namespace
+
+namespace hybrid {
+namespace pkgmgr {
+
+bool StepGenerateXml::LoadXmlDocument(const bf::path& wgt_xml_path,
+ const bf::path& tpk_xml_path) {
+ // trim blanks
+ xmlKeepBlanksDefault(0);
+ wgt_doc_ = xmlParseFile(wgt_xml_path.string().c_str());
+ if (!wgt_doc_) {
+ LOG(ERROR) << "Failed to parse file: " << wgt_xml_path;
+ return false;
+ }
+ tpk_doc_ = xmlParseFile(tpk_xml_path.string().c_str());
+ if (!tpk_doc_) {
+ LOG(ERROR) << "Failed to parse file: " << tpk_xml_path;
+ return false;
+ }
+ return true;
+}
+
+xmlNodePtr StepGenerateXml::GetXmlNode(const xmlDocPtr doc,
+ const std::string& name, const std::string& attr,
+ const std::string& attr_val) {
+ xmlXPathContextPtr ctxt = xmlXPathNewContext(doc);
+ if (!ctxt) {
+ LOG(ERROR) << "Failed to create XPath context";
+ return nullptr;
+ }
+
+ std::string expr = "//*[local-name()='" + name + "']";
+ if (!attr.empty() && !attr_val.empty())
+ expr.append("[@" + attr + "='" + attr_val + "']");
+
+ xmlXPathObjectPtr obj =
+ xmlXPathEvalExpression((const xmlChar*)expr.c_str(), ctxt);
+ if (!obj || !obj->nodesetval || !obj->nodesetval->nodeNr) {
+ xmlXPathFreeContext(ctxt);
+ return nullptr;
+ }
+
+ xmlNodePtr node = obj->nodesetval->nodeTab[0];
+ xmlXPathFreeObject(obj);
+ xmlXPathFreeContext(ctxt);
+
+ return node;
+}
+
+void StepGenerateXml::MergeXmlNode(xmlNodePtr node1, xmlNodePtr node2) {
+ xmlNodePtr last = xmlGetLastChild(node1);
+ xmlNodePtr next;
+ // merge node2's child into node1
+ for (xmlNodePtr cur = node2->children; cur; cur = next) {
+ next = cur->next;
+ if (std::find(kBlackListNodes.begin(), kBlackListNodes.end(),
+ reinterpret_cast(cur->name)) != kBlackListNodes.end())
+ continue;
+ // to avoid duplicate
+ if (std::find(kNeedMergeNodes.begin(), kNeedMergeNodes.end(),
+ reinterpret_cast(cur->name)) != kNeedMergeNodes.end())
+ continue;
+ xmlAddNextSibling(last, cur);
+ last = last->next;
+ }
+}
+
+void StepGenerateXml::SetXmlNodeAttribute(xmlNodePtr node,
+ const std::string& attr, const std::string& attr_val) {
+ xmlSetProp(node, reinterpret_cast(attr.c_str()),
+ reinterpret_cast(attr_val.c_str()));
+}
+
+ci::Step::Status StepGenerateXml::process() {
+ bf::path wgt_xml_path = context_->xml_path.get();
+ bf::path tpk_xml_path = context_->pkg_path.get() / "tizen-manifest.xml";
+
+ if (!LoadXmlDocument(wgt_xml_path, tpk_xml_path))
+ return Step::Status::MANIFEST_ERROR;
+
+ for (auto& entry : kNeedMergeNodes) {
+ xmlNodePtr tpk_node = GetXmlNode(tpk_doc_, entry);
+ if (tpk_node == nullptr)
+ continue;
+ // TODO(s89.jang): If cannot find node from wgt doc, merge tpk node itself
+ // instead of merging its child nodes.
+ xmlNodePtr wgt_node = GetXmlNode(wgt_doc_, entry);
+ MergeXmlNode(wgt_node, tpk_node);
+ }
+
+ // set app's executable path
+ HybridBackendData* data =
+ static_cast(context_->backend_data.get());
+ manifest_x* tpk_data = data->tpk_manifest_data.get();
+ for (application_x* app :
+ GListRange(tpk_data->application)) {
+ auto r = std::find_if(kApplicationNodeNames.begin(),
+ kApplicationNodeNames.end(),
+ [app](const std::pair& e) {
+ return strcmp(e.second.c_str(), app->component_type) == 0;
+ });
+ if (r == kApplicationNodeNames.end()) {
+ LOG(WARNING) << "Cannot find component type!";
+ continue;
+ }
+ xmlNodePtr node = GetXmlNode(wgt_doc_, (*r).first, "appid", app->appid);
+ SetXmlNodeAttribute(node, "exec", app->exec);
+ }
+
+ if (xmlSaveFormatFile(wgt_xml_path.string().c_str(), wgt_doc_, 1) == -1) {
+ LOG(ERROR) << "Cannot write xml file";
+ return Step::Status::MANIFEST_ERROR;
+ }
+
+ if (pkgmgr_parser_check_manifest_validation(
+ wgt_xml_path.string().c_str()) != 0) {
+ LOG(ERROR) << "Merged manifest is not valid";
+ return Step::Status::MANIFEST_ERROR;
+ }
+
+ return Status::OK;
+}
+
+ci::Step::Status StepGenerateXml::precheck() {
+ bf::path wgt_xml_path = context_->xml_path.get();
+ if (!bf::exists(wgt_xml_path)) {
+ LOG(ERROR) << "Converted config file not found: " << wgt_xml_path;
+ return Step::Status::MANIFEST_ERROR;
+ }
+
+ bf::path tpk_xml_path = context_->pkg_path.get() / "tizen-manifest.xml";
+ if (!bf::exists(tpk_xml_path)) {
+ LOG(ERROR) << "Native manifest file not found: " << tpk_xml_path;
+ return Step::Status::MANIFEST_ERROR;
+ }
+
+ return Status::OK;
+}
+
+} // namespace pkgmgr
+} // namespace hybrid
diff --git a/src/hybrid/step/pkgmgr/step_generate_xml.h b/src/hybrid/step/pkgmgr/step_generate_xml.h
new file mode 100644
index 0000000..b2a0f6e
--- /dev/null
+++ b/src/hybrid/step/pkgmgr/step_generate_xml.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 HYBRID_STEP_PKGMGR_STEP_GENERATE_XML_H_
+#define HYBRID_STEP_PKGMGR_STEP_GENERATE_XML_H_
+
+#include
+
+#include
+#include
+#include
+
+#include
+
+namespace hybrid {
+namespace pkgmgr {
+
+class StepGenerateXml : 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:
+ bool LoadXmlDocument(const boost::filesystem::path& wgt_xml_path,
+ const boost::filesystem::path& tpk_xml_path);
+ xmlNodePtr GetXmlNode(const xmlDocPtr doc, const std::string& name,
+ const std::string& attr = {}, const std::string& attr_val = {});
+ void MergeXmlNode(xmlNodePtr node1, xmlNodePtr node2);
+ void SetXmlNodeAttribute(xmlNodePtr node, const std::string& attr,
+ const std::string& attr_val);
+
+ xmlDocPtr wgt_doc_;
+ xmlDocPtr tpk_doc_;
+
+ STEP_NAME(GenerateXml2);
+};
+
+} // namespace pkgmgr
+} // namespace hybrid
+
+#endif // HYBRID_STEP_PKGMGR_STEP_GENERATE_XML_H_
--
2.7.4
From 162f3c411544eda1969df2549bb2c0f0f4d3268b Mon Sep 17 00:00:00 2001
From: Sangyoon Jang
Date: Thu, 22 Dec 2016 14:54:25 +0900
Subject: [PATCH 03/16] Fix mount install failure on global installation
Security registration should be done before creating per user storage
directories because StepCreatePerUserStorage calls
security_manager_paths_register() and it needs security context.
Change-Id: I90c846f55c5ba2cdc294c1a762edb9d97cc76b50
Signed-off-by: Sangyoon Jang
---
src/wgt/wgt_installer.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc
index cef4e4c..1f6c18c 100755
--- a/src/wgt/wgt_installer.cc
+++ b/src/wgt/wgt_installer.cc
@@ -350,13 +350,13 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
AddStep();
AddStep();
AddStep();
- AddStep(
- wgt::filesystem::WgtAdditionalSharedDirs);
AddStep();
AddStep();
AddStep();
AddStep(
ci::Plugin::ActionType::Install);
+ AddStep(
+ wgt::filesystem::WgtAdditionalSharedDirs);
AddStep();
AddStep();
break;
--
2.7.4
From e0ef309d989019f5c9904bcaa717e5e91985f625 Mon Sep 17 00:00:00 2001
From: Junghyun Yeon
Date: Thu, 22 Dec 2016 16:17:17 +0900
Subject: [PATCH 04/16] Remove cleardata feature
- Cleardata will be handled by pkg_cleardata
so remove features related with it from backend
Related changes:
[pkgmgr-server] : https://review.tizen.org/gerrit/106486
[pkgmgr-tool] : https://review.tizen.org/gerrit/106485
[app-installers] : https://review.tizen.org/gerrit/105691
[tpk-backend] : https://review.tizen.org/gerrit/106603
Change-Id: I5df69fbe6416fae0188156b0af7d9657951ec32b
Signed-off-by: Junghyun Yeon
---
src/hybrid/hybrid_installer.cc | 8 --------
src/unit_tests/smoke_test.cc | 24 ------------------------
src/unit_tests/test_samples/smoke/ClearMode.wgt | Bin 37643 -> 0 bytes
src/wgt/wgt_installer.cc | 9 ---------
4 files changed, 41 deletions(-)
delete mode 100644 src/unit_tests/test_samples/smoke/ClearMode.wgt
diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc
index 5aef5e2..af34823 100644
--- a/src/hybrid/hybrid_installer.cc
+++ b/src/hybrid/hybrid_installer.cc
@@ -17,7 +17,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -296,13 +295,6 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
AddStep();
AddStep();
break;
- case ci::RequestType::Clear:
- AddStep(pkgmgr_);
- AddStep(
- ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
- ci::configuration::StepParseManifest::StoreLocation::NORMAL);
- AddStep();
- break;
case ci::RequestType::MountInstall:
AddStep(pkgmgr_);
AddStep();
diff --git a/src/unit_tests/smoke_test.cc b/src/unit_tests/smoke_test.cc
index 7b185d3..22ad465 100644
--- a/src/unit_tests/smoke_test.cc
+++ b/src/unit_tests/smoke_test.cc
@@ -366,13 +366,6 @@ 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(), "-u", kTestUserIdStr.c_str()};
- return CallBackend(SIZEOFARRAY(argv), argv, type, mode);
-}
-
ci::AppInstaller::Result EnablePackage(const std::string& pkgid,
PackageType type,
RequestResult mode = RequestResult::NORMAL) {
@@ -549,23 +542,6 @@ TEST_F(SmokeTest, DisablePkg) {
ValidatePackageFS(pkgid, {appid});
}
-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);
- bs::error_code error;
- bf::create_directory(GetPackageRoot(pkgid) / "data" / "dir", error);
- ASSERT_FALSE(error);
- ASSERT_TRUE(TouchFile(GetPackageRoot(pkgid) / "data" / "dir" / "file"));
- ASSERT_TRUE(TouchFile(GetPackageRoot(pkgid) / "data" / "file"));
- ASSERT_EQ(Clear(pkgid, PackageType::WGT), ci::AppInstaller::Result::OK);
- ValidatePackage(pkgid, {appid});
- ASSERT_FALSE(bf::exists(GetPackageRoot(pkgid) / "data" / "dir" / "file"));
- ASSERT_FALSE(bf::exists(GetPackageRoot(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/ClearMode.wgt
deleted file mode 100644
index f6bbe1866f79e27908588ef66cbb4cd6ce8d100b..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 37643
zcmaHSQ*b3r7j10YoCzj&Cf14VWMXsToY;0Iwr$(CZ96A6?)SglmwUUatGZwJ?zL+7
zUVACZKtf@G!NI|S5r&jWg8g3$>%X(1i?fBDBZHHr`Cmh47e`Y@H(Q%7&9#^eZ5;1s
z4KeJ;1U18(pqhV@q3+qy{wX*xlLnJE#Wi+1QcG2b>Tlcs+V2g+e6DdB<*@dBP_ZP3`I9&Yy_alPEZS~wZcQ?5|;
zadSYphP_88M%`qcouimL6aU7n6DU&p*92a`>Pt%#IJ>|4F(Jrrwib-JUt$I7rv(MP
zK9RbRpSF$?zI~BUYjQB%J8@iI>i%|)P(95~Jzbwt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