Remove codes related with pkgdir-tool
[platform/core/appfw/app-installers.git] / src / common / step / filesystem / step_remove_per_user_storage_directories.cc
1 // Copyright (c) 2016 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.
4
5 #include "common/step/filesystem/step_remove_per_user_storage_directories.h"
6
7 #include <string>
8 #include <vector>
9
10 #include "common/installer_context.h"
11 #include "common/shared_dirs.h"
12
13 namespace common_installer {
14 namespace filesystem {
15
16 Step::Status StepRemovePerUserStorageDirectories::process() {
17   if (context_->request_mode.get() != RequestMode::GLOBAL)
18     return Step::Status::OK;
19
20   std::string package_id = context_->pkgid.get();
21
22   if (!common_installer::DeleteSkelDirectories(package_id)) {
23     LOG(ERROR) << "Failed to delete skel dirs";
24     return Status::APP_DIR_ERROR;
25   }
26
27   if (DeleteUserDirectories(package_id)) {
28     LOG(ERROR) << "Failed to delete shared dirs for users";
29     return Status::APP_DIR_ERROR;
30   }
31
32   return Step::Status::OK;
33 }
34
35 }  // namespace filesystem
36 }  // namespace common_installer
37