Simplify repository structure (remove utils lib target) 12/41812/3
authorTomasz Iwanek <t.iwanek@samsung.com>
Wed, 10 Jun 2015 14:14:32 +0000 (16:14 +0200)
committerTomasz Iwanek <t.iwanek@samsung.com>
Fri, 19 Jun 2015 09:33:16 +0000 (11:33 +0200)
Utils library was extracted to separate code imported from
crosswalk. As there is no more crosswalk code (signature was removed)
this structure could be simplified.

Before:
  utils <- signature <- common <- wgt/tpk

After:
  common (with utils) <- wgt/tpk

Additionally removed unused "native" directory.

Change-Id: I533f7d8864bd07766c2d488f952fb6a3e108de3d

59 files changed:
CMakeLists.txt
packaging/app-installers.spec
src/CMakeLists.txt
src/common/CMakeLists.txt
src/common/app_installer.cc
src/common/app_installer.h
src/common/pkgmgr_interface.h
src/common/pkgmgr_signal.cc
src/common/pkgmgr_signal.h
src/common/security_registration.cc
src/common/step/step_backup_icons.h
src/common/step/step_backup_manifest.cc
src/common/step/step_backup_manifest.h
src/common/step/step_check_signature.h
src/common/step/step_configure.cc
src/common/step/step_configure.h
src/common/step/step_copy.cc
src/common/step/step_copy.h
src/common/step/step_copy_backup.cc
src/common/step/step_copy_backup.h
src/common/step/step_copy_storage_directories.cc
src/common/step/step_generate_xml.cc
src/common/step/step_generate_xml.h
src/common/step/step_old_manifest.cc
src/common/step/step_old_manifest.h
src/common/step/step_parse.cc
src/common/step/step_parse.h
src/common/step/step_register_app.cc
src/common/step/step_register_app.h
src/common/step/step_register_security.h
src/common/step/step_remove_files.cc
src/common/step/step_remove_files.h
src/common/step/step_revoke_security.h
src/common/step/step_unregister_app.cc
src/common/step/step_unregister_app.h
src/common/step/step_unzip.cc
src/common/step/step_unzip.h
src/common/step/step_update_app.cc
src/common/step/step_update_app.h
src/common/step/step_update_security.h
src/common/utils/byte_size_literals.h [moved from src/utils/byte_size_literals.h with 79% similarity]
src/common/utils/clist_helpers.h [moved from src/utils/clist_helpers.h with 88% similarity]
src/common/utils/file_util.cc [moved from src/utils/file_util.cc with 97% similarity]
src/common/utils/file_util.h [moved from src/utils/file_util.h with 88% similarity]
src/common/utils/logging.h [moved from src/utils/logging.h with 83% similarity]
src/common/utils/macros.h [moved from src/utils/macros.h with 80% similarity]
src/common/utils/string_util.cc [moved from src/utils/string_util.cc with 94% similarity]
src/common/utils/string_util.h [moved from src/utils/string_util.h with 71% similarity]
src/native/CMakeLists.txt [deleted file]
src/tpk/main.cc
src/tpk/step/step_create_symbolic_link.cc
src/tpk/step/step_parse.cc
src/tpk/task.cc
src/utils/CMakeLists.txt [deleted file]
src/wgt/CMakeLists.txt
src/wgt/step/step_create_symbolic_link.cc
src/wgt/step/step_create_symbolic_link.h
src/wgt/step/step_parse.h
src/wgt/wgt_app_query_interface.cc

index 544299a..b299611 100644 (file)
@@ -24,12 +24,10 @@ SET(CMAKE_CXX_FLAGS_CCOV       "-O0 -std=c++11 -g --coverage")
 
 # Targets
 SET(TARGET_LIBNAME_COMMON "common-installer")
-SET(TARGET_LIBNAME_UTILS "common-installer-utils")
 SET(TARGET_LIBNAME_PARSER "manifest-parser")
 SET(TARGET_LIBNAME_MANIFEST_HANDLERS "manifest-handlers")
 SET(TARGET_WGT_BACKEND "wgt-backend")
 SET(TARGET_XPK_BACKEND "xpk-backend")
-SET(TARGET_NATIVE_BACKEND "native-backend")
 SET(TARGET_TPK_BACKEND "tpk-backend")
 
 ADD_DEFINITIONS("-Wall")
index 6fac46c..f2cccb1 100644 (file)
@@ -96,7 +96,6 @@ ln -s %{_bindir}/tpk-backend %{buildroot}%{_sysconfdir}/package-manager/backend/
 %files
 %defattr(-,root,root)
 %{_libdir}/libcommon-installer.so*
-%{_libdir}/libcommon-installer-utils.so*
 %{_datarootdir}/app-installers/signature_schema.xsd
 %license LICENSE
 
index fe6b8ba..97446b7 100644 (file)
@@ -1,7 +1,5 @@
 ADD_SUBDIRECTORY(common)
-ADD_SUBDIRECTORY(utils)
 ADD_SUBDIRECTORY(wgt)
 ADD_SUBDIRECTORY(tpk)
 #ADD_SUBDIRECTORY(xpk)
-#ADD_SUBDIRECTORY(native)
 ADD_SUBDIRECTORY(unit_tests)
index cf651bf..bab306b 100644 (file)
@@ -24,6 +24,8 @@ SET(SRCS
   step/step_unregister_app.cc
   step/step_update_app.cc
   step/step_update_security.cc
+  utils/file_util.cc
+  utils/string_util.cc
 )
 # Target - definition
 ADD_LIBRARY(${TARGET_LIBNAME_COMMON} SHARED ${SRCS})
@@ -39,10 +41,10 @@ APPLY_PKG_CONFIG(${TARGET_LIBNAME_COMMON} PUBLIC
   TZPLATFORM_CONFIG_DEPS
   LIBXML_DEPS
   CERT_SVC_DEPS_VCORE
+  MINIZIP_DEPS
+  ZLIB_DEPS
   Boost
 )
-# Target in-package deps
-TARGET_LINK_LIBRARIES(${TARGET_LIBNAME_COMMON} PUBLIC ${TARGET_LIBNAME_UTILS})
 
 # Extra
 SET_TARGET_PROPERTIES(${TARGET_LIBNAME_COMMON} PROPERTIES VERSION ${VERSION})
index 3fc382a..7fe7289 100644 (file)
@@ -9,7 +9,7 @@
 #include "common/context_installer.h"
 #include "common/pkgmgr_interface.h"
 #include "common/pkgmgr_signal.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace {
 
index fe6f0bf..c584971 100644 (file)
@@ -11,8 +11,8 @@
 
 #include "common/pkgmgr_signal.h"
 #include "common/step/step.h"
-#include "utils/logging.h"
-#include "utils/macros.h"
+#include "common/utils/logging.h"
+#include "common/utils/macros.h"
 
 namespace common_installer {
 
index 07e2e94..ea109ae 100644 (file)
@@ -10,8 +10,8 @@
 #include <memory>
 
 #include "common/app_query_interface.h"
-#include "utils/macros.h"
-#include "utils/logging.h"
+#include "common/utils/macros.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 
index 66b2a64..9fec796 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <cassert>
 
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 // Redefine this value as it is not exported by pkgmgr
 // this should probably be in public interface because of
index 1907918..5482ba9 100644 (file)
@@ -11,7 +11,7 @@
 #include <string>
 
 #include "common/step/step.h"
-#include "utils/macros.h"
+#include "common/utils/macros.h"
 
 namespace common_installer {
 
index 6d0c718..c9542e3 100644 (file)
@@ -6,8 +6,8 @@
 
 #include <security-manager.h>
 
-#include "utils/clist_helpers.h"
-#include "utils/logging.h"
+#include "common/utils/clist_helpers.h"
+#include "common/utils/logging.h"
 
 namespace bf = boost::filesystem;
 
index 3539f71..1e4e895 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "common/context_installer.h"
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace backup_icons {
index 218a9bf..9b74f9e 100644 (file)
@@ -13,8 +13,8 @@
 
 #include <string>
 
-#include "utils/file_util.h"
-#include "utils/logging.h"
+#include "common/utils/file_util.h"
+#include "common/utils/logging.h"
 
 namespace bf = boost::filesystem;
 namespace bs = boost::system;
@@ -36,7 +36,7 @@ Step::Status StepBackupManifest::process() {
   backup_xml_path =  + ".bck";
   context_->backup_xml_path.set(backup_xml_path);
 
-  if (!utils::MoveFile(context_->xml_path.get(),
+  if (!MoveFile(context_->xml_path.get(),
       context_->backup_xml_path.get())) {
     LOG(ERROR) << "Failed to make a copy of xml manifest file";
     return Status::ERROR;
@@ -64,7 +64,7 @@ Step::Status StepBackupManifest::undo() {
       LOG(ERROR) << "Failed to remove newly generated xml file in revert";
       return Status::ERROR;
     }
-    if (!utils::MoveFile(context_->backup_xml_path.get(),
+    if (!MoveFile(context_->backup_xml_path.get(),
         context_->xml_path.get())) {
       LOG(ERROR) << "Failed to revert a content of xml manifest file";
       return Status::ERROR;
index 59906f1..1ad1609 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "common/context_installer.h"
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace backup_manifest {
index 7cbcecd..3743304 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "common/context_installer.h"
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace signature {
index 3ce8da2..f93e002 100644 (file)
@@ -8,7 +8,7 @@
 #include <string>
 
 #include "common/pkgmgr_interface.h"
-#include "utils/file_util.h"
+#include "common/utils/file_util.h"
 
 namespace common_installer {
 namespace configure {
index 8228c3b..d79df1c 100644 (file)
@@ -8,7 +8,7 @@
 #include "common/context_installer.h"
 
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace configure {
index ad21c4a..05593dc 100644 (file)
@@ -9,7 +9,7 @@
 #include <cstring>
 #include <string>
 
-#include "utils/file_util.h"
+#include "common/utils/file_util.h"
 
 namespace common_installer {
 namespace copy {
@@ -81,7 +81,7 @@ Step::Status StepCopy::process() {
                << install_path.parent_path().string();
     return Step::Status::ERROR;
   }
-  if (!utils::MoveDir(context_->unpacked_dir_path.get(), install_path)) {
+  if (!MoveDir(context_->unpacked_dir_path.get(), install_path)) {
     LOG(ERROR) << "Cannot move widget directory to install path";
     return Status::ERROR;
   }
index 7600813..4d36837 100644 (file)
@@ -9,7 +9,7 @@
 #include "common/context_installer.h"
 
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace copy {
index 62777b9..68c6333 100644 (file)
@@ -10,7 +10,7 @@
 #include <cassert>
 #include <string>
 
-#include "utils/file_util.h"
+#include "common/utils/file_util.h"
 
 namespace common_installer {
 namespace copy_backup {
@@ -40,7 +40,7 @@ Step::Status StepCopyBackup::process() {
   backup_path_ = GetBackupPathForPackagePath(context_->pkg_path.get());
 
   // backup old content
-  if (!utils::MoveDir(context_->pkg_path.get(), backup_path_)) {
+  if (!MoveDir(context_->pkg_path.get(), backup_path_)) {
     LOG(ERROR) << "Fail to backup widget directory";
     return Step::Status::ERROR;
   }
@@ -53,7 +53,7 @@ Step::Status StepCopyBackup::process() {
     LOG(ERROR) << "Cannot create widget directory";
     return Status::ERROR;
   }
-  if (!utils::MoveDir(context_->unpacked_dir_path.get(), install_path_)) {
+  if (!MoveDir(context_->unpacked_dir_path.get(), install_path_)) {
     LOG(ERROR) << "Fail to copy tmp dir: " << context_->unpacked_dir_path.get()
                << " to dst dir: " << install_path_;
     return Step::Status::ERROR;
@@ -116,7 +116,7 @@ bool StepCopyBackup::RollbackApplicationDirectory() {
     }
   }
 
-  if (!utils::MoveDir(backup_path_, context_->pkg_path.get())) {
+  if (!MoveDir(backup_path_, context_->pkg_path.get())) {
     return false;
   }
 
index bd0e07a..a62ef52 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "common/context_installer.h"
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace copy_backup {
index a2817b6..2052047 100644 (file)
@@ -31,14 +31,14 @@ bool RestoreApplicationStorageForData(const bf::path& pkg_path) {
 
   bf::path data_path = pkg_path / kDataLocation;
   bf::path data_backup_path = backup_path / kDataLocation;
-  if (!common_installer::utils::CopyDir(data_backup_path, data_path)) {
+  if (!common_installer::CopyDir(data_backup_path, data_path)) {
     LOG(ERROR) << "Failed to restore private directory for widget in update";
     return false;
   }
 
   bf::path shared_path = pkg_path / kSharedLocation;
   bf::path shared_backup_path = backup_path / kSharedLocation;
-  if (!common_installer::utils::CopyDir(shared_backup_path, shared_path)) {
+  if (!common_installer::CopyDir(shared_backup_path, shared_path)) {
     LOG(ERROR) << "Failed to restore shared directory for widget in update";
     return false;
   }
index 322668c..60f88fb 100755 (executable)
@@ -16,8 +16,8 @@
 #include <cstring>
 #include <string>
 
-#include "utils/clist_helpers.h"
-#include "utils/file_util.h"
+#include "common/utils/clist_helpers.h"
+#include "common/utils/file_util.h"
 
 namespace fs = boost::filesystem;
 
@@ -84,7 +84,7 @@ Step::Status StepGenerateXml::GenerateApplicationCommonXml(T* app,
   // and located in TZ_USER_ICON/TZ_SYS_ICON
   // if the icon isn't exist print the default icon app-installers.png
   icon_path_ = fs::path(getIconPath(context_->uid.get()));
-  utils::CreateDir(icon_path_);
+  CreateDir(icon_path_);
   fs::path icon = fs::path(app->appid) += fs::path(".png");
 
   if (app->icon->name) {
index e1a2aa6..baedcf3 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "common/context_installer.h"
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace generate_xml {
index 4a6c43c..0d5e95d 100644 (file)
@@ -8,7 +8,7 @@
 #include <pkgmgr-info.h>
 #include <string>
 
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace old_manifest {
index 5b25aab..e61260f 100644 (file)
@@ -8,7 +8,7 @@
 #include "common/context_installer.h"
 
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace old_manifest {
index 00d8489..a377a16 100644 (file)
@@ -14,7 +14,7 @@
 #include <cstdio>
 #include <string>
 
-#include "utils/file_util.h"
+#include "common/utils/file_util.h"
 
 namespace common_installer {
 namespace parse {
index 0599d8a..11bc94d 100644 (file)
@@ -9,7 +9,7 @@
 #include "common/context_installer.h"
 
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace parse {
index 77f9afa..1859ea8 100644 (file)
@@ -10,7 +10,7 @@
 #include <cstdio>
 #include <string>
 
-#include "utils/file_util.h"
+#include "common/utils/file_util.h"
 
 namespace {
 
index 80d8a60..01100cc 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "common/context_installer.h"
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace register_app {
index 8122c1f..e2ef7c3 100644 (file)
@@ -6,7 +6,7 @@
 #define COMMON_STEP_STEP_REGISTER_SECURITY_H_
 
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace security {
index b106ba2..bc9c626 100755 (executable)
@@ -9,7 +9,7 @@
 
 #include <cstring>
 
-#include "utils/file_util.h"
+#include "common/utils/file_util.h"
 
 namespace common_installer {
 namespace remove {
index 1c28ba4..541369b 100755 (executable)
@@ -8,7 +8,7 @@
 #include "common/context_installer.h"
 
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace remove {
index 2844ee0..4296480 100644 (file)
@@ -6,7 +6,7 @@
 #define COMMON_STEP_STEP_REVOKE_SECURITY_H_
 
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace revoke_security {
index 58bfb8f..03f00ea 100755 (executable)
@@ -9,7 +9,7 @@
 #include <cstring>
 
 #include "common/step/step_unregister_app.h"
-#include "utils/file_util.h"
+#include "common/utils/file_util.h"
 
 namespace common_installer {
 namespace unregister_app {
index 5de22a6..98e34bb 100755 (executable)
@@ -7,7 +7,7 @@
 
 #include "common/context_installer.h"
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace unregister_app {
index 64e5e6b..de964f3 100644 (file)
@@ -17,7 +17,7 @@
 #include <cstring>
 #include <string>
 
-#include "utils/file_util.h"
+#include "common/utils/file_util.h"
 
 namespace bf = boost::filesystem;
 namespace bs = boost::system;
@@ -83,15 +83,15 @@ Step::Status StepUnzip::precheck() {
 
 Step::Status StepUnzip::process() {
   bf::path tmp_dir =
-      utils::GenerateTmpDir(context_->root_application_path.get());
+      GenerateTmpDir(context_->root_application_path.get());
 
-  if (!utils::CreateDir(tmp_dir)) {
+  if (!CreateDir(tmp_dir)) {
     LOG(ERROR) << "Failed to create temp directory: " << tmp_dir;
     return Step::Status::ERROR;
   }
 
   int64_t required_size =
-      utils::GetUnpackedPackageSize(context_->file_path.get());
+      GetUnpackedPackageSize(context_->file_path.get());
 
   if (required_size == -1) {
     LOG(ERROR) << "Couldn't get uncompressed size for package: "
@@ -112,7 +112,7 @@ Step::Status StepUnzip::process() {
     return Step::Status::OUT_OF_SPACE;
   }
 
-  if (!utils::ExtractToTmpDir(context_->file_path.get().string().c_str(),
+  if (!ExtractToTmpDir(context_->file_path.get().string().c_str(),
       tmp_dir)) {
     LOG(ERROR) << "Failed to process unpack step";
     return Step::Status::ERROR;
index f943076..a123a0b 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "common/context_installer.h"
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace unzip {
index 462b892..20ebc3e 100644 (file)
@@ -14,7 +14,7 @@
 #include <cstring>
 #include <string>
 
-#include "utils/file_util.h"
+#include "common/utils/file_util.h"
 
 namespace bf = boost::filesystem;
 
index c57cc61..fd97471 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "common/context_installer.h"
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace update_app {
index b223719..e5b6e88 100644 (file)
@@ -6,7 +6,7 @@
 #define COMMON_STEP_STEP_UPDATE_SECURITY_H_
 
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace common_installer {
 namespace update_security {
similarity index 79%
rename from src/utils/byte_size_literals.h
rename to src/common/utils/byte_size_literals.h
index ffb85be..eb30053 100644 (file)
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a apache 2.0 license that can be
 // found in the LICENSE file.
 
-#ifndef UTILS_BYTE_SIZE_LITERALS_H_
-#define UTILS_BYTE_SIZE_LITERALS_H_
+#ifndef COMMON_UTILS_BYTE_SIZE_LITERALS_H_
+#define COMMON_UTILS_BYTE_SIZE_LITERALS_H_
 
 constexpr unsigned long long operator"" _kB(unsigned long long v) {  // NOLINT
   return v * (1 << 10);
@@ -17,5 +17,5 @@ constexpr unsigned long long operator"" _GB(unsigned long long v) {  // NOLINT
   return v * (1 << 30);
 }
 
-#endif  // UTILS_BYTE_SIZE_LITERALS_H_
+#endif  // COMMON_UTILS_BYTE_SIZE_LITERALS_H_
 
similarity index 88%
rename from src/utils/clist_helpers.h
rename to src/common/utils/clist_helpers.h
index ce7abc3..f0fd08d 100644 (file)
@@ -2,8 +2,8 @@
 // Use of this source code is governed by an apache 2.0 license that can be
 // found in the LICENSE file.
 
-#ifndef UTILS_CLIST_HELPERS_H_
-#define UTILS_CLIST_HELPERS_H_
+#ifndef COMMON_UTILS_CLIST_HELPERS_H_
+#define COMMON_UTILS_CLIST_HELPERS_H_
 
 #include "pkgmgr/pkgmgr_parser.h"
 
@@ -18,4 +18,4 @@
     }                                                                          \
   } while (0)                                                                  \
 
-#endif  // UTILS_CLIST_HELPERS_H_
+#endif  // COMMON_UTILS_CLIST_HELPERS_H_
similarity index 97%
rename from src/utils/file_util.cc
rename to src/common/utils/file_util.cc
index c81aec0..93916ea 100644 (file)
@@ -1,6 +1,6 @@
 /* 2014, Copyright © Intel Coporation, license APACHE-2.0, see LICENSE file */
 
-#include "utils/file_util.h"
+#include "common/utils/file_util.h"
 
 #include <fcntl.h>
 #include <sys/stat.h>
@@ -12,8 +12,8 @@
 
 #include <string>
 
-#include "utils/byte_size_literals.h"
-#include "utils/logging.h"
+#include "common/utils/byte_size_literals.h"
+#include "common/utils/logging.h"
 
 namespace bs = boost::system;
 namespace bf = boost::filesystem;
@@ -40,7 +40,6 @@ int64_t RoundUpToBlockSizeOf(int64_t size, int64_t block_size) {
 }  // namespace
 
 namespace common_installer {
-namespace utils {
 
 bool CreateDir(const bf::path& path) {
   if (bf::exists(path))
@@ -119,7 +118,7 @@ bool MoveDir(const bf::path& src, const bf::path& dst) {
   bf::rename(src, dst, error);
   if (error) {
     LOG(WARNING) << "Cannot move directory: " << src << ". Will copy/remove...";
-    if (!utils::CopyDir(src, dst)) {
+    if (!CopyDir(src, dst)) {
       LOG(ERROR) << "Cannot copy directory: " << src;
       return false;
     }
@@ -247,7 +246,7 @@ bool ExtractToTmpDir(const char* zip_path, const bf::path& tmp_dir,
         std::string(raw_file_name_in_zip).find(filter_prefix) == 0) {
       bf::path filename_in_zip_path(raw_file_name_in_zip);
       if (!filename_in_zip_path.parent_path().empty()) {
-        if (!utils::CreateDir(filename_in_zip_path.parent_path())) {
+        if (!CreateDir(filename_in_zip_path.parent_path())) {
           LOG(ERROR) << "Failed to create directory: "
               << filename_in_zip_path.parent_path();
           return false;
@@ -297,5 +296,4 @@ bool ExtractToTmpDir(const char* zip_path, const bf::path& tmp_dir,
   return true;
 }
 
-}  // namespace utils
 }  // namespace common_installer
similarity index 88%
rename from src/utils/file_util.h
rename to src/common/utils/file_util.h
index 53ee8cb..98e70ec 100644 (file)
@@ -1,14 +1,13 @@
 /* 2014, Copyright © Intel Coporation, license APACHE-2.0, see LICENSE file */
 
-#ifndef UTILS_FILE_UTIL_H_
-#define UTILS_FILE_UTIL_H_
+#ifndef COMMON_UTILS_FILE_UTIL_H_
+#define COMMON_UTILS_FILE_UTIL_H_
 
 #include <boost/filesystem.hpp>
 
 #include <string>
 
 namespace common_installer {
-namespace utils {
 
 bool CreateDir(const boost::filesystem::path& path);
 
@@ -32,7 +31,6 @@ bool ExtractToTmpDir(const char* zip_path,
                      const boost::filesystem::path& tmp_dir,
                      const std::string& filter_prefix);
 
-}  // namespace utils
 }  // namespace common_installer
 
-#endif  // UTILS_FILE_UTIL_H_
+#endif  // COMMON_UTILS_FILE_UTIL_H_
similarity index 83%
rename from src/utils/logging.h
rename to src/common/utils/logging.h
index ec91119..d23335f 100644 (file)
@@ -2,15 +2,15 @@
 // Use of this source code is governed by a apache 2.0 license that can be
 // found in the LICENSE file.
 
-#ifndef UTILS_LOGGING_H_
-#define UTILS_LOGGING_H_
+#ifndef COMMON_UTILS_LOGGING_H_
+#define COMMON_UTILS_LOGGING_H_
 
 #include <cassert>
 #include <iomanip>
 #include <iostream>
 #include <sstream>
 
-namespace utils {
+namespace common_installer {
 
 enum class LogLevel {
   LOG_ERROR,
@@ -43,7 +43,7 @@ class LogCatcher {
   }
 };
 
-}  // namespace utils
+}  // namespace common_installer
 
 inline static const constexpr char* __tag_for_logging() {
   return "";
@@ -61,9 +61,10 @@ inline static const constexpr char* __tag_for_logging() {
 //     where:
 //       LEVEL = ERROR | WARNING | INFO | DEBUG
 #define LOG(LEVEL)                                                             \
-    ::utils::LogCatcher() & std::ostringstream()                               \
-      << ::utils::LogTag<::utils::LogLevel::LOG_ ## LEVEL>::value              \
+    ::common_installer::LogCatcher() & std::ostringstream()                    \
+      << ::common_installer::LogTag<                                           \
+         ::common_installer::LogLevel::LOG_ ## LEVEL>::value                   \
       << " " << std::setw(20) << std::left << __tag_for_logging()              \
       << std::setw(0) << " : "                                                 \
 
-#endif  // UTILS_LOGGING_H_
+#endif  // COMMON_UTILS_LOGGING_H_
similarity index 80%
rename from src/utils/macros.h
rename to src/common/utils/macros.h
index 40e1cb6..4ea8ef0 100644 (file)
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a apache 2.0 license that can be
 // found in the LICENSE file.
 
-#ifndef UTILS_MACROS_H_
-#define UTILS_MACROS_H_
+#ifndef COMMON_UTILS_MACROS_H_
+#define COMMON_UTILS_MACROS_H_
 
 #define DISALLOW_COPY_AND_ASSIGN(CLASS)            \
   CLASS(const CLASS&) = delete;                    \
@@ -11,4 +11,4 @@
 
 #define DEPRECATED  __attribute__ ((__deprecated__))
 
-#endif  // UTILS_MACROS_H_
+#endif  // COMMON_UTILS_MACROS_H_
similarity index 94%
rename from src/utils/string_util.cc
rename to src/common/utils/string_util.cc
index af32ea2..d800a17 100644 (file)
@@ -5,14 +5,13 @@
 // This file was rewritten completely in
 // 7c807fc0d4561d178b7c2d8b8d532f48e78ab1bc so fixing license.
 
-#include "utils/string_util.h"
+#include "common/utils/string_util.h"
 
 #include <cstdlib>
 #include <string>
 #include <vector>
 
 namespace common_installer {
-namespace utils {
 
 std::string DecodePercentEscapedCharacter(const std::string& path) {
   std::vector<int> input(path.begin(), path.end());
@@ -39,5 +38,4 @@ std::string DecodePercentEscapedCharacter(const std::string& path) {
   return std::string(output.begin(), output.end());
 }
 
-}  // namespace utils
 }  // namespace common_installer
similarity index 71%
rename from src/utils/string_util.h
rename to src/common/utils/string_util.h
index f01c93e..d1bcba5 100644 (file)
@@ -2,17 +2,15 @@
 // Use of this source code is governed by a apache 2.0 license that can be
 // found in the LICENSE file.
 
-#ifndef UTILS_STRING_UTIL_H_
-#define UTILS_STRING_UTIL_H_
+#ifndef COMMON_UTILS_STRING_UTIL_H_
+#define COMMON_UTILS_STRING_UTIL_H_
 
 #include <string>
 
 namespace common_installer {
-namespace utils {
 
 std::string DecodePercentEscapedCharacter(const std::string& path);
 
-}  // namespace utils
 }  // namespace common_installer
 
-#endif  // UTILS_STRING_UTIL_H_
+#endif  // COMMON_UTILS_STRING_UTIL_H_
diff --git a/src/native/CMakeLists.txt b/src/native/CMakeLists.txt
deleted file mode 100644 (file)
index 5ef1e2d..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# Target - sources
-SET(SRCS
-  tpk-backend.cc
-)
-# Target - definition
-ADD_EXECUTABLE(${TARGET_NATIVE_BACKEND} ${SRCS})
-# Target - includes
-TARGET_INCLUDE_DIRECTORIES(${TARGET_NATIVE_BACKEND} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../")
-# Target - deps
-APPLY_PKG_CONFIG(${TARGET_NATIVE_BACKEND} PUBLIC
-  PKGMGR_INSTALLER_DEPS
-)
-# Target - in-package deps
-TARGET_LINK_LIBRARIES(${TARGET_NATIVE_BACKEND} PUBLIC ${TARGET_LIBNAME_COMMON})
-
-# Install
-INSTALL(TARGETS ${TARGET_NATIVE_BACKEND} DESTINATION ${BINDIR})
index 7137b43..e960ed0 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright 2015 Samsung Electronics, license APACHE-2.0, see LICENSE file */
 #include <iostream>
 #include "tpk/task.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 
 int main(const int argc, char* argv[]) {
index 16353d2..f89a7bd 100644 (file)
@@ -5,8 +5,8 @@
 #include "common/step/step.h"
 #include "common/app_installer.h"
 #include "common/context_installer.h"
-#include "utils/file_util.h"
-#include "utils/logging.h"
+#include "common/utils/file_util.h"
+#include "common/utils/logging.h"
 
 
 namespace tpk {
@@ -28,7 +28,7 @@ bool CreateSymLink(T *app, ContextInstaller* context) {
     fs::path bindir = context->pkg_path.get() / fs::path(app->appid) /
         fs::path("bin");
     LOG(INFO) << "Creating dir: " << bindir;
-    if (!common_installer::utils::CreateDir(bindir)) {
+    if (!common_installer::CreateDir(bindir)) {
       LOG(ERROR) << "Directory creation failure";
       return false;
     }
index 9ba373a..e9a9ba2 100644 (file)
@@ -6,7 +6,7 @@
 #include <vector>
 #include "common/context_installer.h"
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 #include "xml_parser/xml_parser.h"
 
 using std::vector;
index d8a8044..d817fff 100644 (file)
@@ -26,7 +26,7 @@
 #include "common/step/step_update_security.h"
 #include "tpk/step/step_parse.h"
 #include "tpk/step/step_create_symbolic_link.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 #endif
 
 
diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt
deleted file mode 100644 (file)
index 99601ba..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# Target - sources
-SET(SRCS
-  file_util.cc
-  string_util.cc
-)
-# Target - definition
-ADD_LIBRARY(${TARGET_LIBNAME_UTILS} SHARED ${SRCS})
-# Target - includes
-TARGET_INCLUDE_DIRECTORIES(${TARGET_LIBNAME_UTILS} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../")
-
-# Target - deps
-APPLY_PKG_CONFIG(${TARGET_LIBNAME_UTILS} PUBLIC
-  MINIZIP_DEPS
-  ZLIB_DEPS
-  Boost
-)
-
-# Extra
-SET_TARGET_PROPERTIES(${TARGET_LIBNAME_UTILS} PROPERTIES VERSION ${VERSION})
-SET_TARGET_PROPERTIES(${TARGET_LIBNAME_UTILS} PROPERTIES SOVERSION ${VERSION_MAJOR})
-
-# Install
-INSTALL(TARGETS ${TARGET_LIBNAME_UTILS} DESTINATION ${LIB_INSTALL_DIR})
index 39641d9..e28de86 100644 (file)
@@ -27,7 +27,6 @@ APPLY_PKG_CONFIG(${TARGET_WGT_BACKEND} PUBLIC
 
 # Target - in-package deps
 TARGET_LINK_LIBRARIES(${TARGET_WGT_BACKEND} PUBLIC ${TARGET_LIBNAME_COMMON})
-TARGET_LINK_LIBRARIES(${TARGET_WGT_BACKEND} PUBLIC ${TARGET_LIBNAME_UTILS})
 
 # Install
 INSTALL(TARGETS ${TARGET_WGT_BACKEND} DESTINATION ${BINDIR})
index 61254fa..0cab72f 100644 (file)
@@ -14,7 +14,7 @@
 #include <cstdio>
 #include <string>
 
-#include "utils/file_util.h"
+#include "common/utils/file_util.h"
 
 namespace wgt {
 namespace symbolic_link {
@@ -38,7 +38,7 @@ common_installer::Step::Status StepCreateSymbolicLink::process() {
     fs::path exec_path =
         context_->pkg_path.get() / fs::path(ui->appid)
             / fs::path("bin");
-    common_installer::utils::CreateDir(exec_path);
+    common_installer::CreateDir(exec_path);
 
     exec_path /= fs::path(ui->appid);
 
@@ -54,7 +54,7 @@ common_installer::Step::Status StepCreateSymbolicLink::process() {
     fs::path exec_path =
         context_->pkg_path.get() / fs::path(svc->appid)/
             fs::path("bin");
-    common_installer::utils::CreateDir(exec_path);
+    common_installer::CreateDir(exec_path);
 
     exec_path /= fs::path(svc->appid);
 
index a9007a7..893483b 100644 (file)
@@ -10,7 +10,7 @@
 #include "common/app_installer.h"
 #include "common/context_installer.h"
 #include "common/step/step.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace wgt {
 namespace symbolic_link {
index 3704651..324cace 100644 (file)
@@ -20,7 +20,7 @@
 #include "manifest_handlers/tizen_application_handler.h"
 #include "manifest_handlers/widget_handler.h"
 #include "manifest_parser/manifest_parser.h"
-#include "utils/logging.h"
+#include "common/utils/logging.h"
 
 namespace wgt {
 namespace parse {
index 190c717..5cccbb0 100644 (file)
@@ -24,8 +24,8 @@
 #include <utility>
 #include <vector>
 
-#include "utils/file_util.h"
-#include "utils/logging.h"
+#include "common/utils/file_util.h"
+#include "common/utils/logging.h"
 
 namespace bf = boost::filesystem;
 namespace bs = boost::system;
@@ -46,12 +46,12 @@ std::string GetInstallationPackagePath(int argc, char** argv) {
 }
 
 std::string GetAppIdFromPath(const std::string& path) {
-  bf::path tmp_path = common_installer::utils::GenerateTmpDir("/tmp");
+  bf::path tmp_path = common_installer::GenerateTmpDir("/tmp");
   bs::error_code code;
   bf::create_directories(tmp_path, code);
   if (code)
     return {};
-  if (!common_installer::utils::ExtractToTmpDir(path.c_str(), tmp_path,
+  if (!common_installer::ExtractToTmpDir(path.c_str(), tmp_path,
       "config.xml")) {
     bf::remove_all(tmp_path, code);
     return {};