X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fjobs%2Fwidget_install%2Ftask_manifest_file.cpp;h=33b1283dc05998e95697867bf8847180b4ca2c1b;hb=7fb83d1e97cd557be2a3b16edd5dc651a2d27306;hp=70746090f5a71268f76391cb09391e590205159c;hpb=07a04fd17aff2b05680ffb0dd14028e28543756d;p=framework%2Fweb%2Fwrt-installer.git diff --git a/src/jobs/widget_install/task_manifest_file.cpp b/src/jobs/widget_install/task_manifest_file.cpp index 7074609..33b1283 100644 --- a/src/jobs/widget_install/task_manifest_file.cpp +++ b/src/jobs/widget_install/task_manifest_file.cpp @@ -111,6 +111,7 @@ TaskManifestFile::TaskManifestFile(InstallerContext &inCont) : // for widget update. AddStep(&TaskManifestFile::stepBackupIconFiles); AddStep(&TaskManifestFile::stepCopyIconFiles); + AddStep(&TaskManifestFile::stepCreateExecFile); AddStep(&TaskManifestFile::stepGenerateManifest); AddStep(&TaskManifestFile::stepParseUpgradedManifest); AddStep(&TaskManifestFile::stepUpdateFinalize); @@ -307,8 +308,7 @@ void TaskManifestFile::stepBackupIconFiles() { LogDebug("Backup Icon Files"); - backup_dir << m_context.locations->getPackageInstallationDir(); - backup_dir << "/" << "backup" << "/"; + backup_dir << m_context.locations->getBackupDir() << "/"; backupIconFiles(); @@ -544,18 +544,22 @@ void TaskManifestFile::stepParseManifest() void TaskManifestFile::stepParseUpgradedManifest() { - int code = pkgmgr_parser_parse_manifest_for_upgrade( - DPL::ToUTF8String(manifest_file).c_str(), NULL); + if (m_context.widgetConfig.packagingType != + PKG_TYPE_HYBRID_WEB_APP) + { + int code = pkgmgr_parser_parse_manifest_for_upgrade( + DPL::ToUTF8String(manifest_file).c_str(), NULL); - if (code != 0) { - LogError("Manifest parser error: " << code); - ThrowMsg(Exceptions::ManifestInvalid, "Parser returncode: " << code); - } + if (code != 0) { + LogError("Manifest parser error: " << code); + ThrowMsg(Exceptions::ManifestInvalid, "Parser returncode: " << code); + } - m_context.job->UpdateProgress( - InstallerContext::INSTALL_CREATE_MANIFEST, - "Widget Manifest Parsing Finished"); - LogDebug("Manifest parsed"); + m_context.job->UpdateProgress( + InstallerContext::INSTALL_CREATE_MANIFEST, + "Widget Manifest Parsing Finished"); + LogDebug("Manifest parsed"); + } } void TaskManifestFile::commitManifest() @@ -563,9 +567,7 @@ void TaskManifestFile::commitManifest() LogDebug("Commiting manifest file : " << manifest_file); std::ostringstream destFile; - if (m_context.job->getInstallerStruct().m_installMode - == InstallMode::INSTALL_MODE_PRELOAD) - { + if (m_context.mode.rootPath == InstallMode::RootPath::RO) { destFile << "/usr/share/packages" << "/"; //TODO constant with path } else { destFile << "/opt/share/packages" << "/"; //TODO constant with path @@ -602,6 +604,7 @@ void TaskManifestFile::writeManifest(const DPL::String & path) setWidgetManifest(manifest); setWidgetOtherInfo(uiApp); setAppCategory(uiApp); + setMetadata(uiApp); setLiveBoxInfo(manifest); setAccount(manifest); setPrivilege(manifest); @@ -627,6 +630,7 @@ void TaskManifestFile::writeManifest(const DPL::String & path) setWidgetIcons(uiApp); setAppControlInfo(uiApp, *it); setAppCategory(uiApp); + setMetadata(uiApp); manifest.addUiApplication(uiApp); } #else @@ -640,6 +644,7 @@ void TaskManifestFile::writeManifest(const DPL::String & path) setWidgetOtherInfo(uiApp); setAppControlsInfo(uiApp); setAppCategory(uiApp); + setMetadata(uiApp); setLiveBoxInfo(manifest); setAccount(manifest); setPrivilege(manifest); @@ -945,6 +950,21 @@ void TaskManifestFile::setAppCategory(UiApplication &uiApp) } } +void TaskManifestFile::setMetadata(UiApplication &uiApp) +{ + WrtDB::ConfigParserData::MetadataList metadataList = + m_context.widgetConfig.configInfo.metadataList; + + if (metadataList.empty()) { + LogInfo("Web application doesn't contain metadata"); + return; + } + FOREACH(it, metadataList) { + MetadataType metadataType(it->key, it->value); + uiApp.addMetadata(metadataType); + } +} + void TaskManifestFile::stepAbortParseManifest() { LogError("[Parse Manifest] Abroting....");