Fix in StepWgtPatchStorageDirectory
[platform/core/appfw/wgt-backend.git] / src / wgt / step / configuration / step_parse_recovery.cc
1 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache-2.0 license that can be
3 // found in the LICENSE file.
4
5 #include "wgt/step/configuration/step_parse_recovery.h"
6
7 #include <common/paths.h>
8 #include <common/installer_context.h>
9
10 namespace {
11
12 const char kResWgtPath[] = "res/wgt";
13
14 }
15
16 namespace wgt {
17 namespace configuration {
18
19 StepParseRecovery::StepParseRecovery(
20     common_installer::InstallerContext* context)
21     : StepParse(context, StepParse::ConfigLocation::RECOVERY, false) {
22 }
23
24 common_installer::Step::Status StepParseRecovery::process() {
25   (void) StepParse::process();
26   context_->pkg_path.set(
27       context_->root_application_path.get() / context_->pkgid.get());
28   return Status::OK;
29 }
30
31 common_installer::Step::Status StepParseRecovery::precheck() {
32   if (context_->root_application_path.get().empty()) {
33     LOG(ERROR) << "Root path of packages in not set";
34     return Status::INVALID_VALUE;
35   }
36   if (context_->pkgid.get().empty()) {
37     LOG(WARNING) << "Pkgid is not set. Parsing skipped";
38     return Status::OK;
39   }
40   return Status::OK;
41 }
42
43 }  // namespace configuration
44 }  // namespace wgt