#include "common/pkgmgr_interface.h"
-#include <boost/filesystem/path.hpp>
-#include <boost/filesystem.hpp>
-
#include <tzplatform_config.h>
#include <memory>
#include <string>
+#include <filesystem>
#include <fstream>
+#include <optional>
#include "common/app_query_interface.h"
#include "common/utils/pkgmgr_query.h"
#include "common/utils/manifest_util.h"
#include "common/utils/user_util.h"
-namespace bf = boost::filesystem;
+namespace fs = std::filesystem;
namespace ci = common_installer;
namespace {
bool CheckIfAppFilesExists(const std::string& pkgid,
uid_t uid,
bool is_readonly) {
- return bf::exists(ci::GetManifestLocation(pkgid,
+ return fs::exists(ci::GetManifestLocation(pkgid,
uid, is_readonly));
}
}
if (!is_delta) {
- std::string extension = bf::path(path).extension().string();
+ std::string extension = fs::path(path).extension().string();
if (extension == kDeltaFileExtension)
is_delta = true;
}
return -1;
}
- boost::optional<bool> is_admin_user =
+ std::optional<bool> is_admin_user =
IsAdminUser(pkgmgr_installer_get_uid(pi_));
if (!is_admin_user) {
LOG(ERROR) << "Cannot get admin user info. Aborting.";
// method name?
bool PkgMgrInterface::SetAppQueryInterface(int idx) {
// reset this flag to processing new package
- is_app_installed_ = boost::none;
+ is_app_installed_.reset();
auto it = query_interface_map_.find(idx);
if (it == query_interface_map_.end()) {
if (request_info.empty())
return RequestType::Unknown;
bool is_delta = IsDeltaPkg(request_info);
- if (!is_app_installed_.get()) {
+ if (!is_app_installed_.value()) {
if (is_delta) {
LOG(ERROR) << "Package is not installed. "
"Cannot update from delta package";
return RequestType::Uninstall;
}
case PKGMGR_REQ_MANIFEST_DIRECT_INSTALL:
- if (!is_app_installed_.get()) {
+ if (!is_app_installed_.value()) {
if (GetIsPreloadRequest() && GetIsPartialRW())
return RequestType::ManifestPartialInstall;
else
return RequestType::ManifestDirectUpdate;
}
case PKGMGR_REQ_MOUNT_INSTALL: {
- if (!is_app_installed_.get()) {
+ if (!is_app_installed_.value()) {
return RequestType::MountInstall;
} else {
std::string pkgid = query_interface->GetPkgId(GetRequestInfo(idx));
return request_info;
}
-boost::filesystem::path PkgMgrInterface::GetTepPath() const {
+std::filesystem::path PkgMgrInterface::GetTepPath() const {
if (pkgmgr_installer_get_tep_path(pi_) == nullptr)
- return boost::filesystem::path("");
+ return std::filesystem::path("");
else
- return boost::filesystem::path(pkgmgr_installer_get_tep_path(pi_));
+ return std::filesystem::path(pkgmgr_installer_get_tep_path(pi_));
}
bool PkgMgrInterface::GetIsTepMove() const {