1 // Copyright (c) 2015 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.
5 #include "common/step/rds/step_rds_parse.h"
7 #include <manifest_parser/utils/logging.h>
11 #include "common/installer_context.h"
12 #include "common/rds_parser.h"
14 namespace common_installer {
17 namespace bf = boost::filesystem;
19 Step::Status StepRDSParse::precheck() {
20 bf::path rdsPath(context_->unpacked_dir_path.get() / ".rds_delta");
21 if (!bf::exists(rdsPath)) {
22 LOG(ERROR) << "no rds_delta file";
23 return Step::Status::INVALID_VALUE;
25 rds_file_path_ = rdsPath;
26 return Step::Status::OK;
29 Step::Status StepRDSParse::process() {
30 RDSParser parser(rds_file_path_.native());
31 if (!parser.Parse()) {
32 LOG(ERROR) << "parsing of rds delta failed";
33 return Step::Status::PARSE_ERROR;
36 context_->files_to_modify.set(parser.files_to_modify());
37 context_->files_to_add.set(parser.files_to_add());
38 context_->files_to_delete.set(parser.files_to_delete());
39 return Step::Status::OK;
43 } // namespace common_installer