X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fjobs%2Fwidget_uninstall%2Ftask_delete_pkginfo.cpp;fp=src_mobile%2Fjobs%2Fwidget_uninstall%2Ftask_delete_pkginfo.cpp;h=ed78727884afb9c4d9c7f04d00f6dd035d79636e;hb=8dca06a97c6e118a413c9a5e3890750baa75b799;hp=88db8e213b02fbc478d8c792de4317f3e4a96d34;hpb=764ea635f2e980157258d6c3107a4480a6ae12d0;p=framework%2Fweb%2Fwrt-installer.git diff --git a/src_mobile/jobs/widget_uninstall/task_delete_pkginfo.cpp b/src/jobs/widget_uninstall/task_delete_pkginfo.cpp similarity index 65% rename from src_mobile/jobs/widget_uninstall/task_delete_pkginfo.cpp rename to src/jobs/widget_uninstall/task_delete_pkginfo.cpp index 88db8e2..ed78727 100644 --- a/src_mobile/jobs/widget_uninstall/task_delete_pkginfo.cpp +++ b/src/jobs/widget_uninstall/task_delete_pkginfo.cpp @@ -27,9 +27,10 @@ #include #include #include -#include -#include -#include +#include +#include + +namespace bf = boost::filesystem; namespace Jobs { namespace WidgetUninstall { @@ -45,31 +46,34 @@ TaskDeletePkgInfo::TaskDeletePkgInfo( void TaskDeletePkgInfo::StartStep() { - _D("--------- : START ----------"); + LOGI("--------- : START ----------"); } void TaskDeletePkgInfo::EndStep() { - _D("--------- : END ----------"); + LOGI("--------- : END ----------"); } void TaskDeletePkgInfo::StepDeletePkgInfo() { std::ostringstream manifest_name; manifest_name << m_context.tzPkgid << ".xml"; - DPL::Utils::Path pre_manifest("/usr/share/packages"); + bf::path pre_manifest("/usr/share/packages"); pre_manifest /= manifest_name.str(); - - if (!(m_context.manifestFile.Exists() == 0 && pre_manifest.Exists())) { - if (0 != pkgmgr_parser_parse_manifest_for_uninstallation( - m_context.manifestFile.Fullpath().c_str(), NULL)) { - _W("Manifest file failed to parse for uninstallation"); + try { + if (!(bf::exists(m_context.manifestFile) == 0 && bf::exists(pre_manifest))) { + if (0 != pkgmgr_parser_parse_manifest_for_uninstallation( + m_context.manifestFile.c_str(), NULL)) { + _W("Manifest file failed to parse for uninstallation"); + } } - } - if (!DPL::Utils::TryRemove(m_context.manifestFile)) { - _W("No manifest file found: %s", m_context.manifestFile.Fullpath().c_str()); - } else { - _D("Manifest file removed: %s", m_context.manifestFile.Fullpath().c_str()); + if (bf::remove_all(bf::path(m_context.manifestFile))) { + _D("Manifest file removed: %s", m_context.manifestFile.c_str()); + } else { + _W("No manifest file found: %s", m_context.manifestFile.c_str()); + } + } catch (const bf::filesystem_error& ex) { + _E("boost::filesystem::error: %s", ex.what()); } } } //namespace WidgetUninstall