Add set removable for manifest when CSC installation
authorSoyoung Kim <sy037.kim@samsung.com>
Wed, 29 May 2013 14:11:55 +0000 (23:11 +0900)
committerSoyoung Kim <sy037.kim@samsung.com>
Thu, 30 May 2013 07:19:02 +0000 (16:19 +0900)
[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
src/jobs/widget_install/task_manifest_file.cpp
src/wrt-installer/wrt-installer.cpp
src/wrt-installer/wrt-installer.h

index a545f9c..19a387e 100644 (file)
@@ -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
index 1c040a8..a5bd917 100644 (file)
@@ -59,8 +59,9 @@ using namespace WrtDB;
 namespace {
 typedef std::map<DPL::String, DPL::String> 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 {
index 8e6534b..4db1ad4 100644 (file)
@@ -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) {
index 413a0ab..4405a07 100644 (file)
@@ -44,8 +44,11 @@ typedef std::map<std::string, std::string> dataMap;
 typedef std::pair<std::string, std::string> 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