create empty package directory in direct_install mode. 93/58093/4
authorjongmyeongko <jongmyeong.ko@samsung.com>
Wed, 27 Jan 2016 11:24:25 +0000 (20:24 +0900)
committerTomasz Iwanek <t.iwanek@samsung.com>
Mon, 1 Feb 2016 08:57:30 +0000 (00:57 -0800)
this is a way to cover such a lack of initial condition \
which is needed for backend's working.
following:
- preload ui-gadget only package does not have pkg_path.

Change-Id: Iab9568de9396f98c1f98bdfff963a9024281ee53
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
src/common/step/step_configure.cc

index 2799892..f105d06 100644 (file)
@@ -15,6 +15,7 @@
 #include "common/utils/file_util.h"
 
 namespace bf = boost::filesystem;
+namespace bs = boost::system;
 
 namespace common_installer {
 namespace configuration {
@@ -82,6 +83,20 @@ Step::Status StepConfigure::process() {
       context_->pkg_path.set(package_directory);
       context_->xml_path.set(xml_path);
       context_->pkg_type.set(kRpmPackageType);  // temporary fix as rpm
+
+      if (!bf::exists(context_->pkg_path.get())) {
+        LOG(INFO) << "[ManifestDirect] Create pkg_path("
+                  << context_->pkg_path.get()
+                  << ") for package("
+                  << context_->pkgid.get() << ")";
+        bs::error_code error;
+        bf::create_directories(package_directory, error);
+        if (error) {
+          LOG(ERROR) << "Cannot create directory: "
+                  << package_directory.string();
+          return Step::Status::APP_DIR_ERROR;
+        }
+      }
       break;
     }
     default: