Fix pkgdir-tool 53/60953/1 accepted/tizen/common/20160304.194337 accepted/tizen/ivi/20160303.093923 accepted/tizen/mobile/20160303.093809 accepted/tizen/tv/20160303.093832 accepted/tizen/wearable/20160303.093904 submit/tizen/20160303.064856
authorSangyoon Jang <s89.jang@samsung.com>
Thu, 3 Mar 2016 06:23:11 +0000 (15:23 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Thu, 3 Mar 2016 06:26:26 +0000 (15:26 +0900)
- Don't create trusted dir if the package is not signed.
- Continue process even if error occurred.

Change-Id: I489ce0a804783ae4e62720055edad75727e5d193
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
src/pkgdir_tool/pkgdir_tool.cc

index bef90e8..7a8013e 100644 (file)
@@ -190,7 +190,9 @@ bool CreateDirectories(const bf::path& app_dir, const std::string& pkgid,
   }
 
   bs::error_code error;
-  for (auto& entry : kEntries) {
+  std::vector<const char*> dirs(
+      kEntries.begin(), kEntries.end() - (author_id.empty() ? 1 : 0));
+  for (auto& entry : dirs) {
     bf::path subpath = base_dir / entry;
     bf::create_directories(subpath, error);
     if (error) {
@@ -411,13 +413,13 @@ int main(int argc, char** argv) {
       LOG(DEBUG) << "Running for package id: " << std::get<0>(p);
       if (!PerformDirectoryCreation(std::get<0>(p), std::get<1>(p),
           std::get<2>(p)))
-        return -1;
+        continue;
     }
   } else if (delete_mode) {
     for (auto& p : pkgs) {
       LOG(DEBUG) << "Running for package id: " << std::get<0>(p);
       if (!PerformDirectoryDeletion(std::get<0>(p)))
-        return -1;
+        continue;
     }
   }
   return 0;