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_tep.h"
7 #include <boost/filesystem/operations.hpp>
8 #include <boost/filesystem/path.hpp>
9 #include <boost/system/error_code.hpp>
11 namespace bf = boost::filesystem;
12 namespace bs = boost::system;
14 namespace common_installer {
15 namespace filesystem {
17 Step::Status StepRemoveTep::process() {
18 if (context_->manifest_data.get()->tep_name) {
19 bf::path tep_path(context_->manifest_data.get()->tep_name);
20 if (bf::exists(tep_path)) {
22 bf::remove(tep_path, error);
24 // Deinstallation should not fail even if sd card is not inserted
25 // In spite of this, we print only warning
26 LOG(WARNING) << "Failed to remove tep file from: " << tep_path;
29 LOG(DEBUG) << "Tep package file removed: " << tep_path;
34 } // namespace filesystem
35 } // namespace common_installer