Implement StepRestoreWgtSymbolicLink
[platform/core/appfw/wgt-backend.git] / src / wgt / step / filesystem / step_restore_wgt_symbolic_link.cc
1 // Copyright (c) 2022 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/filesystem/step_restore_wgt_symbolic_link.h"
6
7 #include "wgt/step/filesystem/step_create_symbolic_link.h"
8
9 namespace bf = boost::filesystem;
10 namespace bs = boost::system;
11
12 namespace wgt {
13 namespace filesystem {
14
15 common_installer::Step::Status StepRestoreWgtSymbolicLink::undo() {
16   StepCreateSymbolicLink step(context_);
17
18   Status result = step.precheck();
19   if (result != Status::OK) {
20     LOG(ERROR) << "Fail to execute precheck of CreateWgtSymbolicLink";
21     return result;
22   }
23
24   result = step.process();
25   if (result != Status::OK) {
26     LOG(ERROR) << "Fail to execute process of CreateWgtSymbolicLink";
27     return result;
28   }
29
30   return result;
31 }
32
33 }  // namespace filesystem
34 }  // namespace wgt