Remove boost dependency
[platform/core/appfw/app-installers.git] / src / common / step / pkgmgr / step_check_force_clean.cc
index 5490324..f826924 100644 (file)
@@ -8,14 +8,13 @@
 #include <pkgmgr-info.h>
 #include <tzplatform_config.h>
 
-#include <boost/filesystem.hpp>
-#include <boost/filesystem/path.hpp>
+#include <filesystem>
 
-#include "common/pkgmgr_query.h"
+#include "common/utils/pkgmgr_query.h"
 #include "common/installer_context.h"
 #include "common/utils/manifest_util.h"
 
-namespace bf = boost::filesystem;
+namespace fs = std::filesystem;
 
 
 namespace common_installer {
@@ -26,21 +25,23 @@ Step::Status StepCheckForceClean::process() {
       context_->request_type.get() != RequestType::PartialUninstall)
     return Status::OK;
 
-  bf::path xml_path = GetManifestLocation(context_->pkgid.get(),
+  fs::path xml_path = GetManifestLocation(context_->pkgid.get(),
                                           context_->uid.get(),
                                           context_->is_readonly_package.get());
 
   // if manifeset not found but pkg exist in db for target uid, do clean
   PkgQueryInterface pkg_query(context_->pkgid.get(), context_->uid.get());
-  if (!bf::exists(xml_path) &&
+  if (!fs::exists(xml_path) &&
       pkg_query.IsPackageInstalled()) {
     context_->force_clean_from_db.set(true);
-    manifest_x* manifest =
-        static_cast<manifest_x*>(calloc(1, sizeof(manifest_x)));
-    if (!PkgmgrGenerateManifestInfoFromDB(manifest, context_->pkgid.get(),
-            context_->uid.get())) {
-      context_->manifest_data.set(manifest);
+    manifest_x* manifest = PkgmgrGenerateManifestInfoFromDB(
+        context_->pkgid.get(), context_->uid.get());
+    if (!manifest) {
+      LOG(ERROR) << "Failed to get manifest_x from DB";
+      return Status::ERROR;
     }
+
+    context_->manifest_data.set(manifest);
   }
 
   return Status::OK;