Remove assert checking for existance of widget package file 88/37988/3
authorJakub Izydorczyk <j.izydorczyk@samsung.com>
Fri, 6 Mar 2015 12:12:53 +0000 (13:12 +0100)
committerPawel Sikorski <p.sikorski@samsung.com>
Thu, 9 Apr 2015 08:23:00 +0000 (01:23 -0700)
Remove assert, which checks if widget package file exsits
and replace it with checks from boost lib for file existence and
return error on failure.

Change-Id: I75dd117d85bef0fe1313da8a2510fe5bd6673dc7

src/common/step/step_unzip.cc

index 4f36052..225dddd 100644 (file)
@@ -216,7 +216,11 @@ Step::Status StepUnzip::ExtractToTmpDir(const char* src,
 
 Step::Status StepUnzip::process() {
   assert(!context_->file_path.get().empty());
-  assert(!access(context_->file_path.get().c_str(), F_OK));
+  if (!boost::filesystem::exists(context_->file_path.get())) {
+    LOG(ERROR) << "Specified widget does not exist: "
+               << context_->file_path.get();
+    return Step::Status::ERROR;
+  }
 
   bf::path tmp_dir =
       GenerateTmpDir(context_->root_application_path.get());