From 5c229c3daf7861b1c7703c22eb399c59f52dd334 Mon Sep 17 00:00:00 2001 From: Soyoung Kim Date: Wed, 29 May 2013 23:11:55 +0900 Subject: [PATCH] Add set removable for manifest when CSC installation [Issue#] N/A [Problem] N/A [Cause] N/A [Solution] Add set removable for manifest when CSC installation [SCMRequest] N/A Change-Id: I4cf3aba0480717c5674012f6d0261ee310356820 --- src/commons/wrt_install_mode.h | 4 +++- src/jobs/widget_install/task_manifest_file.cpp | 23 ++++++++++++++++------- src/wrt-installer/wrt-installer.cpp | 11 +++++++++++ src/wrt-installer/wrt-installer.h | 3 +++ 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/commons/wrt_install_mode.h b/src/commons/wrt_install_mode.h index a545f9c..19a387e 100644 --- a/src/commons/wrt_install_mode.h +++ b/src/commons/wrt_install_mode.h @@ -61,7 +61,8 @@ class InstallMode location(lo), rootPath(root), extension(extensionType), - installTime(time) + installTime(time), + removable(true) {}; Command command; @@ -69,6 +70,7 @@ class InstallMode RootPath rootPath; ExtensionType extension; InstallTime installTime; + bool removable; }; #endif // WRT_INSTALL_MODE_H diff --git a/src/jobs/widget_install/task_manifest_file.cpp b/src/jobs/widget_install/task_manifest_file.cpp index 1c040a8..a5bd917 100644 --- a/src/jobs/widget_install/task_manifest_file.cpp +++ b/src/jobs/widget_install/task_manifest_file.cpp @@ -59,8 +59,9 @@ using namespace WrtDB; namespace { typedef std::map LanguageTagMap; -const char* const ST_TRUE = "true"; -const char* const ST_NODISPLAY = "nodisplay"; +const char* const STR_TRUE = "true"; +const char* const STR_FALSE = "false"; +const char* const STR_NODISPLAY = "nodisplay"; LanguageTagMap getLanguageTagMap() { @@ -585,11 +586,19 @@ void TaskManifestFile::stepParseManifest() { int code = 0; - if (!access(commit_manifest.c_str(), F_OK) == 0) { + char* updateTags[3] = {NULL, }; + + if (!m_context.mode.removable) { + updateTags[0] = "preload=false"; + updateTags[1] = "removable=false"; + updateTags[2] = NULL; + } + + if (!access(commit_manifest.c_str(), F_OK) == 0) { commitManifest(); code = pkgmgr_parser_parse_manifest_for_installation( - commit_manifest.c_str(), NULL); + commit_manifest.c_str(), (updateTags[0] == NULL) ? NULL : updateTags); if (code != 0) { LogError("Manifest parser error: " << code); @@ -601,7 +610,7 @@ void TaskManifestFile::stepParseManifest() { commitManifest(); code = pkgmgr_parser_parse_manifest_for_upgrade( - commit_manifest.c_str(), NULL); + commit_manifest.c_str(), (updateTags[0] == NULL) ? NULL : updateTags); if (code != 0) { LogError("Manifest parser error: " << code); @@ -930,8 +939,8 @@ void TaskManifestFile::setWidgetOtherInfo(UiApplication & uiApp) { FOREACH(it, m_context.widgetConfig.configInfo.settingsList) { - if (!strcmp(DPL::ToUTF8String(it->m_name).c_str(), ST_NODISPLAY)) { - if (!strcmp(DPL::ToUTF8String(it->m_value).c_str(), ST_TRUE)) { + if (!strcmp(DPL::ToUTF8String(it->m_name).c_str(), STR_NODISPLAY)) { + if (!strcmp(DPL::ToUTF8String(it->m_value).c_str(), STR_TRUE)) { uiApp.setNodisplay(true); uiApp.setTaskmanage(false); } else { diff --git a/src/wrt-installer/wrt-installer.cpp b/src/wrt-installer/wrt-installer.cpp index 8e6534b..4db1ad4 100644 --- a/src/wrt-installer/wrt-installer.cpp +++ b/src/wrt-installer/wrt-installer.cpp @@ -237,6 +237,17 @@ void WrtInstaller::OnCreate() return showHelpAndQuit(); } m_packagePath = it->second; + + it = m_CSCconfigurationMap.find( + CSCConfiguration::KEY_REMOVABLE); + if (it == m_CSCconfigurationMap.end()) { + return showHelpAndQuit(); + } + + m_installMode.removable = + (it->second.compare(CSCConfiguration::VALUE_FALSE) == 0) + ? false : true; + AddStep(&WrtInstaller::installStep); LogDebug("path = " << m_packagePath); } else if (it->second == CSCConfiguration::VALUE_UNINSTALL) { diff --git a/src/wrt-installer/wrt-installer.h b/src/wrt-installer/wrt-installer.h index 413a0ab..4405a07 100644 --- a/src/wrt-installer/wrt-installer.h +++ b/src/wrt-installer/wrt-installer.h @@ -44,8 +44,11 @@ typedef std::map dataMap; typedef std::pair dataPair; const char* const KEY_OP = "op"; const char* const KEY_PATH = "path"; +const char* const KEY_REMOVABLE = "removable"; const char* const VALUE_INSTALL = "install"; const char* const VALUE_UNINSTALL = "uninstall"; +const char* const VALUE_TRUE = "true"; +const char* const VALUE_FALSE = "false"; } enum ReturnValue -- 2.7.4