Fix author parsing in StepParseManifest 64/60464/3
authorTomasz Iwanek <t.iwanek@samsung.com>
Fri, 26 Feb 2016 08:29:20 +0000 (09:29 +0100)
committerTomasz Iwanek <t.iwanek@samsung.com>
Mon, 29 Feb 2016 09:47:24 +0000 (01:47 -0800)
Requires to be submitted with:
 - https://review.tizen.org/gerrit/60463

Change-Id: Ic714815a7ff86ee54d1082041c40bfd113cf138d

src/common/step/step_copy_storage_directories.cc
src/common/step/step_parse_manifest.cc
src/common/step/step_recover_storage_directories.cc

index fa9a45d..a77d0b7 100644 (file)
@@ -19,7 +19,7 @@ namespace {
 
 const char kCache[] = "cache";
 const char kDataLocation[] = "data";
-const char kSharedLocation[] = "shared";
+const char kSharedResLocation[] = "shared";
 
 }  // namespace
 
@@ -61,7 +61,7 @@ common_installer::Step::Status StepCopyStorageDirectories::process() {
 
   if (!MoveAppStorage(backup_path_,
                       context_->pkg_path.get(),
-                      kSharedLocation, true)) {
+                      kSharedResLocation, true)) {
     LOG(ERROR) << "Failed to restore shared directory for widget in update";
     return Status::APP_DIR_ERROR;
   }
@@ -83,7 +83,7 @@ common_installer::Step::Status StepCopyStorageDirectories::undo() {
 
   if (!MoveAppStorage(context_->pkg_path.get(),
                       backup_path_,
-                      kSharedLocation)) {
+                      kSharedResLocation)) {
     LOG(ERROR) << "Failed to restore shared directory for package in update";
     ret = Status::APP_DIR_ERROR;
   }
index 3c73fc5..2b75a9b 100644 (file)
@@ -215,12 +215,10 @@ bool StepParseManifest::FillPackageInfo(manifest_x* manifest) {
 bool StepParseManifest::FillAuthorInfo(manifest_x* manifest) {
   std::shared_ptr<const tpk::parse::AuthorInfo> author_info =
       std::static_pointer_cast<const tpk::parse::AuthorInfo>(
-          parser_->GetManifestData(app_keys::kAuthorKey));
+          parser_->GetManifestData(tpk::parse::AuthorInfo::Key()));
 
-  if (!author_info) {
-    LOG(ERROR) << "Author data has not been found.";
-    return false;
-  }
+  if (!author_info)
+    return true;
 
   author_x* author = reinterpret_cast<author_x*>(calloc(1, sizeof(author_x)));
   author->text = strdup(author_info->name().c_str());
@@ -691,6 +689,8 @@ bool StepParseManifest::FillManifestX(manifest_x* manifest) {
     return false;
   if (!FillPrivileges(manifest))
     return false;
+  if (!FillAuthorInfo(manifest))
+    return false;
   if (!FillAccounts())
     return false;
   if (!FillShortcuts())
index 95fb033..0633e2f 100644 (file)
@@ -12,7 +12,7 @@
 
 namespace {
 const char kDataLocation[] = "data";
-const char kSharedLocation[] = "shared";
+const char kSharedResLocation[] = "shared";
 }  // namespace
 
 namespace bf = boost::filesystem;
@@ -37,7 +37,7 @@ Step::Status StepRecoverStorageDirectories::RecoveryUpdate() {
         context_->pkg_path.get());
     if (bf::exists(backup_path)) {
       MoveAppStorage(context_->pkg_path.get(), backup_path, kDataLocation);
-      MoveAppStorage(context_->pkg_path.get(), backup_path, kSharedLocation);
+      MoveAppStorage(context_->pkg_path.get(), backup_path, kSharedResLocation);
     }
   }
   return Status::OK;