[Release] wrt-installer_0.1.94 submit/tizen_2.2/20130702.113806
authorsung-su.kim <sung-su.kim@samsung.com>
Tue, 2 Jul 2013 11:16:09 +0000 (20:16 +0900)
committersung-su.kim <sung-su.kim@samsung.com>
Tue, 2 Jul 2013 11:16:09 +0000 (20:16 +0900)
Change-Id: I2541dd4458b0a3716e953719a2de84981cf69119

packaging/wrt-installer.spec
src/jobs/widget_install/task_install_ospsvc.cpp
src/pkg-manager/CMakeLists.txt
src/pkg-manager/backendlib.cpp

index 3d5c4bc..47eb82b 100644 (file)
@@ -1,7 +1,7 @@
 #git:framework/web/wrt-installer
 Name:       wrt-installer
 Summary:    Installer for tizen Webruntime
-Version:    0.1.92
+Version:    0.1.94
 Release:    1
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index 0ef8990..b3e3374 100644 (file)
@@ -103,25 +103,22 @@ void TaskInstallOspsvc::StepUpdateManifestFile()
     std::string pkgid = DPL::ToUTF8String(m_context.widgetConfig.tzPkgid);
     pkgmgrinfo_pkginfo_h handle;
 
-    int ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid.c_str(), &handle);
-    if (ret != PMINFO_R_OK) {
-        LogDebug("StepUpdateManifestFile");
-        std::ostringstream manifest_file;
-        if (m_context.mode.rootPath == InstallMode::RootPath::RO) {
-            manifest_file << "/usr/share/packages/"; //TODO constant with path
-        } else {
-            manifest_file << "/opt/share/packages/"; //TODO constant with path
-        }
-        manifest_file << pkgid;
-        manifest_file << ".xml";
-        LogDebug("manifest file : " << manifest_file.str());
-
-        int code = pkgmgr_parser_parse_manifest_for_upgrade(
-                manifest_file.str().c_str(), NULL);
-
-        if (code != 0) {
-            LogError("Manifest parser error: " << code);
-        }
+    LogDebug("StepUpdateManifestFile");
+    std::ostringstream manifest_file;
+    if (m_context.mode.rootPath == InstallMode::RootPath::RO) {
+        manifest_file << "/usr/share/packages/"; //TODO constant with path
+    } else {
+        manifest_file << "/opt/share/packages/"; //TODO constant with path
+    }
+    manifest_file << pkgid;
+    manifest_file << ".xml";
+    LogDebug("manifest file : " << manifest_file.str());
+
+    int code = pkgmgr_parser_parse_manifest_for_upgrade(
+            manifest_file.str().c_str(), NULL);
+
+    if (code != 0) {
+        LogError("Manifest parser error: " << code);
     }
 }
 } //namespace WidgetInstall
index c1ce69d..cad802d 100755 (executable)
@@ -21,6 +21,7 @@ SET(BACKLIB_SRCS
     ${PROJECT_SOURCE_DIR}/src/configuration_parser/ignoring_parser.cpp
     ${PROJECT_SOURCE_DIR}/src/configuration_parser/deny_all_parser.cpp
     ${PROJECT_SOURCE_DIR}/src/configuration_parser/libiriwrapper.cpp
+    ${PROJECT_SOURCE_DIR}/src/wrt-installer/language_subtag_rst_tree.cpp
 )
 
 PKG_CHECK_MODULES(WRT_BACKLIB_PKGS
@@ -33,6 +34,7 @@ PKG_CHECK_MODULES(WRT_BACKLIB_PKGS
     pkgmgr
     dlog
     libpcrecpp
+    libiri
     REQUIRED)
 
 INCLUDE_DIRECTORIES(
index 48f98d4..f783f8c 100644 (file)
@@ -255,6 +255,16 @@ int getConfigParserData(const std::string &widgetPath, ConfigParserData& configI
     const char* CONFIG_XML = "config.xml";
     const char* WITH_OSP_XML = "res/wgt/config.xml";
 
+    try
+    {
+        WrtDB::WrtDatabase::attachToThreadRO();
+    }
+    catch (const DPL::DB::SqlConnection::Exception::ConnectionBroken& ex)
+    {
+        LogError("Could not attach to DB: " << ex.GetMessage());
+        return FALSE;
+    }
+
     Try {
         ParserRunner parser;
 
@@ -286,35 +296,43 @@ int getConfigParserData(const std::string &widgetPath, ConfigParserData& configI
     }
     Catch(DPL::ZipInput::Exception::OpenFailed)
     {
+        WrtDB::WrtDatabase::detachFromThread();
         LogError("Failed to open widget package");
         return FALSE;
     }
     Catch(DPL::ZipInput::Exception::OpenFileFailed)
     {
+        WrtDB::WrtDatabase::detachFromThread();
         LogError("Failed to open config.xml file");
         return FALSE;
     }
     Catch(DPL::CopyFailed)
     {
+        WrtDB::WrtDatabase::detachFromThread();
         LogError("Failed to extract config.xml file");
         return FALSE;
     }
     Catch(DPL::FileInput::Exception::OpenFailed)
     {
+        WrtDB::WrtDatabase::detachFromThread();
         LogError("Failed to open config.xml file");
         return FALSE;
     }
     Catch(ElementParser::Exception::ParseError)
     {
+        WrtDB::WrtDatabase::detachFromThread();
         LogError("Failed to parse config.xml file");
         return FALSE;
     }
     Catch(DPL::ZipInput::Exception::SeekFileFailed)
     {
+        WrtDB::WrtDatabase::detachFromThread();
         LogError("Failed to seek widget archive - corrupted package?");
         return FALSE;
     }
 
+    WrtDB::WrtDatabase::detachFromThread();
+
     return TRUE;
 }