1 // Copyright (c) 2020 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_unmount.h"
7 #include <boost/filesystem/operations.hpp>
8 #include <boost/filesystem/path.hpp>
12 #include "common/utils/paths.h"
13 #include "common/tzip_interface.h"
14 #include "common/zip_interface.h"
16 namespace bf = boost::filesystem;
17 namespace bs = boost::system;
19 namespace common_installer {
22 Step::Status StepUnmount::process() {
23 auto zip_final = CreateZipInterface(
24 GetMountLocation(context_->GetPkgPath()));
26 if (!zip_final->UnmountZip()) {
27 LOG(ERROR) << "Failed to unmount zip package after installation";
28 return Status::APP_DIR_ERROR;
34 std::unique_ptr<IZipInterface> StepUnmount::CreateZipInterface(
35 const boost::filesystem::path& mount_path) {
36 std::unique_ptr<IZipInterface> zip_interface(
37 new TzipInterface(mount_path));
42 } // namespace common_installer