1 // Copyright (c) 2016 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 "common/step/filesystem/step_remove_zip_image.h"
12 #include "common/utils/paths.h"
13 #include "common/pkgmgr_registration.h"
14 #include "common/utils/pkgmgr_query.h"
15 #include "common/utils/file_util.h"
17 namespace fs = std::filesystem;
19 namespace common_installer {
20 namespace filesystem {
22 Step::Status StepRemoveZipImage::precheck() {
23 if (!context_->manifest_data.get())
24 LOG(ERROR) << "manifest_data is not set";
25 return Step::Status::OK;
28 Step::Status StepRemoveZipImage::process() {
29 fs::path zip_image_path =
30 GetZipPackageLocation(context_->GetPkgPath(), context_->pkgid.get());
31 if (fs::exists(zip_image_path)) {
32 if (Remove(zip_image_path))
33 LOG(INFO) << "Zip image file removed: " << zip_image_path;
38 } // namespace filesystem
39 } // namespace common_installer