#include <cassert>
#include <cstring>
+#include <filesystem>
#include <string>
+#include <system_error>
#include "common/shared_dirs.h"
#include "common/utils/file_util.h"
-namespace bf = boost::filesystem;
-namespace bs = boost::system;
namespace ci = common_installer;
+namespace fs = std::filesystem;
namespace common_installer {
namespace filesystem {
LOG(ERROR) << "root_application_path attribute is empty";
return Step::Status::INVALID_VALUE;
}
- if (!boost::filesystem::exists(context_->root_application_path.get())) {
+ if (!std::filesystem::exists(context_->root_application_path.get())) {
LOG(ERROR) << "root_application_path ("
<< context_->root_application_path.get()
<< ") path does not exist";
LOG(ERROR) << "unpacked_dir_path attribute is empty";
return Step::Status::INVALID_VALUE;
}
- if (!boost::filesystem::exists(context_->unpacked_dir_path.get())) {
+ if (!std::filesystem::exists(context_->unpacked_dir_path.get())) {
LOG(ERROR) << "unpacked_dir_path ("
<< context_->unpacked_dir_path.get()
<< ") path does not exist";
}
Step::Status StepCopy::process() {
- bf::path install_path;
+ fs::path install_path;
if (context_->storage.get() == Storage::EXTENDED) {
- install_path = bf::path(GetExtendedRootAppPath(context_->uid.get())) /
+ install_path = fs::path(GetExtendedRootAppPath(context_->uid.get())) /
context_->pkgid.get();
} else {
install_path = context_->GetPkgPath();
ci::RemoveRWDirectories(context_->unpacked_dir_path.get());
- bs::error_code error;
- bf::create_directories(install_path.parent_path(), error);
+ std::error_code error;
+ fs::create_directories(install_path.parent_path(), error);
if (error) {
LOG(ERROR) << "Cannot create directory: "
<< install_path.parent_path().string();
<< " to: " << install_path << " directory";
if (context_->storage.get() == Storage::EXTENDED) {
- bf::create_symlink(install_path, context_->GetPkgPath(), error);
+ fs::create_symlink(install_path, context_->GetPkgPath(), error);
if (error) {
LOG(ERROR) << "Failed to create symlink for extended path: "
<< error.message();
if (context_->external_storage) {
context_->external_storage->Abort();
} else if (context_->storage.get() == Storage::EXTENDED) {
- bf::path install_path =
- bf::path(GetExtendedRootAppPath(context_->uid.get())) /
+ fs::path install_path =
+ fs::path(GetExtendedRootAppPath(context_->uid.get())) /
context_->pkgid.get();
RemoveAll(install_path);
}