Fix TEP copying 78/68678/4
authorTomasz Iwanek <t.iwanek@samsung.com>
Mon, 9 May 2016 08:57:20 +0000 (10:57 +0200)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Tue, 10 May 2016 08:44:23 +0000 (01:44 -0700)
To verify, install/update package with tep. Tep can be any file.
 $ backend -i ${package} -e ${tep_file}
tep file must be copied to ${package_root}/tep/

Change-Id: Ie28a94ba8b32606fa29fb7c6309e697f2e1bca7e

src/common/step/filesystem/step_copy_tep.cc

index 7199ff0..3e34580 100644 (file)
@@ -48,6 +48,15 @@ Step::Status StepCopyTep::process() {
   bf::path tep_path =
       context_->pkg_path.get() / "tep" / context_->tep_path.get().filename();
 
+  if (!bf::exists(tep_path.parent_path())) {
+    bs::error_code error;
+    bf::create_directory(tep_path.parent_path(), error);
+    if (error) {
+      LOG(ERROR) << "Cannot create tep parent directory";
+      return Status::APP_DIR_ERROR;
+    }
+  }
+
   if (context_->is_tep_move.get()) {
     if (!MoveFile(context_->tep_path.get(), tep_path)) {
       LOG(ERROR) << "Cannnot move TEP file into install path";