X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fjobs%2Fwidget_install%2Ftask_install_ospsvc.cpp;h=30c810164d35c739f387685d5ec9364363327f19;hb=bb6a49cba8cf075304d971b519809b1816bc53ad;hp=7909c266caa7b4a68fa5773318996a84b4136efa;hpb=4c3a03cc7892389de60114e3ef3afff627fe919a;p=framework%2Fweb%2Fwrt-installer.git diff --git a/src/jobs/widget_install/task_install_ospsvc.cpp b/src/jobs/widget_install/task_install_ospsvc.cpp index 7909c26..30c8101 100644 --- a/src/jobs/widget_install/task_install_ospsvc.cpp +++ b/src/jobs/widget_install/task_install_ospsvc.cpp @@ -24,6 +24,9 @@ #include #include +#include +#include +#include #include #include #include @@ -48,6 +51,7 @@ TaskInstallOspsvc::TaskInstallOspsvc(InstallerContext& context) : m_context(context) { AddStep(&TaskInstallOspsvc::StepInstallOspService); + AddStep(&TaskInstallOspsvc::StepUpdateManifestFile); } void TaskInstallOspsvc::StepInstallOspService() @@ -93,5 +97,39 @@ void TaskInstallOspsvc::StepInstallOspService() InstallerContext::INSTALL_INSTALL_OSPSVC, "Installed Osp servcie"); } + +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 ret = pkgmgr_parser_parse_manifest_for_uninstallation( + manifest_file.str().c_str(), NULL); + + if (ret != 0) { + LogError("Manifest parser error: " << ret); + } + + int code = pkgmgr_parser_parse_manifest_for_installation( + manifest_file.str().c_str(), NULL); + + if (code != 0) { + LogError("Manifest parser error: " << code); + } + } +} } //namespace WidgetInstall } //namespace Jobs