Minor improvements for force-uninstall step
[platform/core/appfw/wgt-backend.git] / src / wgt / step / step_wgt_remove_manifest.cc
1 // Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by a apache 2.0 license that can be
3 // found in the LICENSE file.
4
5 #include "wgt/step/step_wgt_remove_manifest.h"
6
7 #include <boost/filesystem/path.hpp>
8 #include <boost/filesystem/operations.hpp>
9 #include <boost/system/error_code.hpp>
10
11 #include <pkgmgr-info.h>
12 #include <pkgmgr_installer.h>
13
14 #include <algorithm>
15 #include <string>
16
17 #include "common/utils/file_util.h"
18
19 namespace bf = boost::filesystem;
20 namespace bs = boost::system;
21
22 namespace wgt {
23 namespace pkgmgr {
24
25
26 common_installer::Step::Status StepRemoveManifest::process() {
27   bs::error_code error;
28   bf::remove(context_->xml_path.get(), error);
29
30   if (error) {
31     LOG(ERROR) << "Failed to remove xml manifest file";
32     return Status::MANIFEST_ERROR;
33   }
34   LOG(DEBUG) << "Manifest file removed";
35   return Status::OK;
36 }
37
38
39 }  // namespace wgt
40 }  // namespace pkgmgr