Revert "Revert "Change package version comparsion behavior"" 33/275133/1
authorSangyoon Jang <jeremy.jang@samsung.com>
Tue, 17 May 2022 06:14:50 +0000 (15:14 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Tue, 17 May 2022 06:15:16 +0000 (15:15 +0900)
This reverts commit 6eb8a73e1466d86daa9a1bdc695179af43039b57.

Change-Id: I1cfdb754b59ba1df5cb8bcb6e4e6fc7331e4aae6

src/common/step/configuration/step_check_tizen_version.cc

index 5abd419..8c01409 100644 (file)
@@ -6,19 +6,15 @@
 
 #include <manifest_parser/utils/version_number.h>
 #include <pkgmgrinfo_basic.h>
-#include <vconf.h>
 
 #include <cstring>
 #include <string>
 
 #include "common/installer_context.h"
-#include "common/utils/glist_range.h"
 
 namespace {
 
 const char kPlatformVersion[] = TIZEN_FULL_VERSION;
-const char kDotnetAppType[] = "dotnet";
-const char kDotnetAPILevelVconfKey[] = "db/dotnet/tizen_api_version";
 
 int CompareVersion(const std::string& a, const std::string& b) {
   utils::VersionNumber a_ver(a);
@@ -34,13 +30,9 @@ namespace configuration {
 
 Step::Status StepCheckTizenVersion::process() {
   const char* version = context_->manifest_data.get()->api_version;
-  if (IsDotnetAppExist()) {
-    if (!CompareDotnetVersion(version))
-      return Status::OPERATION_NOT_ALLOWED;
-  } else {
-    if (!ComparePlatformVersion(version))
-      return Status::OPERATION_NOT_ALLOWED;
-  }
+  if (!ComparePlatformVersion(version))
+    return Status::OPERATION_NOT_ALLOWED;
+
   return Status::OK;
 }
 
@@ -54,12 +46,7 @@ Step::Status StepCheckTizenVersion::precheck() {
 }
 
 bool StepCheckTizenVersion::IsDotnetAppExist() {
-  GList* applications = context_->manifest_data.get()->application;
-  for (const auto& app : GListRange<application_x*>(applications)) {
-    if (!strcmp(app->type, kDotnetAppType))
-      return true;
-  }
-
+  // Does nothing. Don't delete this until someone overrides this delete it.
   return false;
 }
 
@@ -72,26 +59,5 @@ bool StepCheckTizenVersion::ComparePlatformVersion(const std::string& version) {
   return true;
 }
 
-bool StepCheckTizenVersion::CompareDotnetVersion(const std::string& version) {
-  int dotnet_api_level;
-  if (vconf_get_int(kDotnetAPILevelVconfKey, &dotnet_api_level)) {
-    if (!context_->is_readonly_package.get() &&
-        !context_->is_preload_rw_package.get()) {
-      LOG(ERROR) << "Failed to get platform dotnet API level";
-      return false;
-    } else {
-      // During platform image creation stage, vconf API does not work and
-      // version check fails. This is workaround for this case.
-      return true;
-    }
-  }
-  if (CompareVersion(std::to_string(dotnet_api_level), version) < 0) {
-    LOG(ERROR) << "Package's dotnet API level(" << version << ") is higher "
-               << "than platform dotnet API level(" << dotnet_api_level << ")";
-    return false;
-  }
-  return true;
-}
-
 }  // namespace configuration
 }  // namespace common_installer