1 // Copyright (c) 2018 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.
5 #include "step/mount/step_check_mount_path.h"
7 #include <boost/filesystem/operations.hpp>
8 #include <boost/filesystem/path.hpp>
12 #include "common/paths.h"
14 namespace bf = boost::filesystem;
15 namespace bs = boost::system;
17 namespace common_installer {
20 Step::Status StepCheckMountPath::process() {
21 bf::path zip_destination_path =
22 GetZipPackageLocation(context_->GetPkgPath(), context_->pkgid.get());
23 if (!bf::exists(zip_destination_path))
26 context_->manifest_data.get()->zip_mount_file =
27 strdup(zip_destination_path.c_str());
32 Step::Status StepCheckMountPath::precheck() {
33 if (context_->root_application_path.get().empty()) {
34 LOG(ERROR) << "root_application_path attribute is empty";
35 return Step::Status::INVALID_VALUE;
38 if (context_->pkgid.get().empty()) {
39 LOG(ERROR) << "pkgid attribute is empty";
40 return Step::Status::PACKAGE_NOT_FOUND;
43 return Step::Status::OK;
47 } // namespace common_installer