From 44708abe247f3559808c235533d9ed7de569c7c6 Mon Sep 17 00:00:00 2001 From: jongmyeongko Date: Tue, 23 Feb 2016 18:38:53 +0900 Subject: [PATCH] set 'rpm' type to rpm packed application packages to support the old behaviors use 'type' information(like as 'rpm') for their own purpose. we can't not figure out which modules use 'type' info in previous entire models and, it not easy to make them fix the behavior to other way. so, now we realive the 'rpm' type. only rpm packed application package can be 'rpm' type. Change-Id: I7c7e40e5fc925e1daff5629a36e7ba47acddb8e7 Signed-off-by: jongmyeongko --- src/common/step/step_parse_manifest.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/common/step/step_parse_manifest.cc b/src/common/step/step_parse_manifest.cc index 1a2c457..409ff9f 100644 --- a/src/common/step/step_parse_manifest.cc +++ b/src/common/step/step_parse_manifest.cc @@ -164,9 +164,19 @@ bool StepParseManifest::FillPackageInfo(manifest_x* manifest) { manifest->version = strdup(pkg_info->version().c_str()); manifest->installlocation = strdup(pkg_info->install_location().c_str()); manifest->api_version = strdup(pkg_info->api_version().c_str()); - manifest->type = strdup("tpk"); manifest->preload = strdup(pkg_info->preload().c_str()); + if (pkg_info->type().empty()) { + common_installer::RequestType req_type = context_->request_type.get(); + if (req_type == RequestType::ManifestDirectInstall || + req_type == RequestType::ManifestDirectUpdate) + manifest->type = strdup("rpm"); + else + manifest->type = strdup("tpk"); + } else { + manifest->type = strdup(pkg_info->type().c_str()); + } + for (auto& pair : pkg_info->labels()) { label_x* label = reinterpret_cast(calloc(1, sizeof(label_x))); if (!pair.first.empty()) -- 2.7.4