set 'rpm' type to rpm packed application packages 04/60104/6 accepted/tizen/ivi/20160225.081531 accepted/tizen/mobile/20160225.081439 accepted/tizen/tv/20160225.081503 accepted/tizen/wearable/20160225.081516 submit/tizen/20160224.000443 submit/tizen/20160224.092603
authorjongmyeongko <jongmyeong.ko@samsung.com>
Tue, 23 Feb 2016 09:38:53 +0000 (18:38 +0900)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Tue, 23 Feb 2016 12:32:35 +0000 (04:32 -0800)
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 <jongmyeong.ko@samsung.com>
src/common/step/step_parse_manifest.cc

index 1a2c457..409ff9f 100644 (file)
@@ -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<label_x*>(calloc(1, sizeof(label_x)));
     if (!pair.first.empty())