Move file_util.cc to utils 10/36110/2
authorTomasz Iwanek <t.iwanek@samsung.com>
Mon, 23 Feb 2015 10:35:33 +0000 (11:35 +0100)
committerPawel Sikorski <p.sikorski@samsung.com>
Mon, 9 Mar 2015 13:19:49 +0000 (06:19 -0700)
Change-Id: Ida4e0c8c922549165f318b7ca3292d1a4fd381ba

13 files changed:
src/common/CMakeLists.txt
src/common/step/step_copy.cc
src/common/step/step_generate_xml.cc
src/common/step/step_parse.cc
src/common/step/step_record.cc
src/common/step/step_remove.cc
src/common/step/step_signal.cc
src/common/step/step_unregister.cc
src/common/step/step_unzip.cc
src/utils/CMakeLists.txt
src/utils/file_util.cc [moved from src/common/utils.cc with 95% similarity]
src/utils/file_util.h [moved from src/common/utils.h with 68% similarity]
src/wgt/step/step_symbolic_link.cc

index 8b2ef6b..0e29938 100644 (file)
@@ -15,7 +15,6 @@ SET(SRCS
   step/step_security.cc
   step/step_signal.cc
   step/step_unregister.cc
-  utils.cc
 )
 # Target - definition
 ADD_LIBRARY(${TARGET_LIBNAME_COMMON} SHARED ${SRCS})
index b8e0332..b29bf40 100644 (file)
@@ -6,7 +6,7 @@
 #include <cstring>
 #include <string>
 
-#include "common/utils.h"
+#include "utils/file_util.h"
 
 namespace common_installer {
 namespace copy {
index 2d5feb7..03b2b98 100644 (file)
@@ -14,7 +14,7 @@
 #include <cstring>
 #include <string>
 
-#include "common/utils.h"
+#include "utils/file_util.h"
 
 #define PKGMGR_LIST_MOVE_NODE_TO_HEAD(list, node) do {                        \
     if (list) { LISTHEAD(list, node); }                                       \
index 7c7471d..56d8657 100644 (file)
@@ -11,7 +11,7 @@
 #include <cstdio>
 #include <string>
 
-#include "common/utils.h"
+#include "utils/file_util.h"
 
 namespace common_installer {
 namespace parse {
index c65edbc..cd581a7 100644 (file)
@@ -11,7 +11,7 @@
 #include <cstdio>
 #include <string>
 
-#include "common/utils.h"
+#include "utils/file_util.h"
 
 namespace {
 
index c588e2c..e3761ab 100755 (executable)
@@ -9,7 +9,7 @@
 
 #include <cstring>
 
-#include "common/utils.h"
+#include "utils/file_util.h"
 
 namespace common_installer {
 namespace remove {
index 25f6002..c595d87 100644 (file)
@@ -5,7 +5,7 @@
 #include <pkgmgr-info.h>
 #include <unistd.h>
 
-#include "common/utils.h"
+#include "utils/file_util.h"
 
 namespace common_installer {
 namespace signal {
index 21a584a..ca8c10e 100755 (executable)
@@ -9,7 +9,7 @@
 #include <cstring>
 
 #include "common/step/step_unregister.h"
-#include "common/utils.h"
+#include "utils/file_util.h"
 
 namespace common_installer {
 namespace unregister {
index 0c47ba9..e775b51 100644 (file)
@@ -17,7 +17,7 @@
 #include <cstring>
 #include <string>
 
-#include "common/utils.h"
+#include "utils/file_util.h"
 
 #define ZIPBUFSIZE 8192
 #define ZIPMAXPATH 256
index 3b985a8..463030c 100644 (file)
@@ -1,5 +1,6 @@
 # Target - sources
 SET(SRCS
+  file_util.cc
   system_locale.cc
   string_util.cc
   values.cc
similarity index 95%
rename from src/common/utils.cc
rename to src/utils/file_util.cc
index 5130417..5357223 100644 (file)
@@ -1,12 +1,13 @@
 /* 2014, Copyright © Intel Coporation, license APACHE-2.0, see LICENSE file */
 
-#include "common/utils.h"
+#include "utils/file_util.h"
 
 #include <boost/filesystem/path.hpp>
 #include <string>
 
 #include "utils/logging.h"
 
+namespace common_installer {
 namespace utils {
 
 namespace fs = boost::filesystem;
@@ -79,3 +80,4 @@ bool CopyDir(const fs::path& src, const fs::path& dst) {
 }
 
 }  // namespace utils
+}  // namespace common_installer
similarity index 68%
rename from src/common/utils.h
rename to src/utils/file_util.h
index f2030b6..c46b64f 100644 (file)
@@ -1,10 +1,11 @@
 /* 2014, Copyright © Intel Coporation, license APACHE-2.0, see LICENSE file */
 
-#ifndef COMMON_UTILS_H_
-#define COMMON_UTILS_H_
+#ifndef UTILS_FILE_UTIL_H_
+#define UTILS_FILE_UTIL_H_
 
 #include <boost/filesystem.hpp>
 
+namespace common_installer {
 namespace utils {
 
 bool CreateDir(const boost::filesystem::path& path);
@@ -13,5 +14,6 @@ bool CopyDir(const boost::filesystem::path& src,
              const boost::filesystem::path& dst);
 
 }  // namespace utils
+}  // namespace common_installer
 
-#endif  // COMMON_UTILS_H_
+#endif  // UTILS_FILE_UTIL_H_
index af5bb26..58a50ed 100644 (file)
@@ -11,7 +11,7 @@
 #include <cstdio>
 #include <string>
 
-#include "common/utils.h"
+#include "utils/file_util.h"
 
 namespace wgt {
 namespace symbolic_link {
@@ -33,7 +33,7 @@ common_installer::Step::Status StepSymbolicLink::process() {
     // binary is a symbolic link named <appid> and is located in <pkgid>/<appid>
     fs::path exec_path = fs::path(context_->pkg_path()) / fs::path(ui->appid)
         / fs::path("bin");
-    utils::CreateDir(exec_path);
+    common_installer::utils::CreateDir(exec_path);
 
     exec_path /= fs::path(ui->appid);
 
@@ -48,7 +48,7 @@ common_installer::Step::Status StepSymbolicLink::process() {
     // binary is a symbolic link named <appid> and is located in <pkgid>/<appid>
     fs::path exec_path = fs::path(context_->pkg_path()) / fs::path(svc->appid)
         / fs::path("bin");
-    utils::CreateDir(exec_path);
+    common_installer::utils::CreateDir(exec_path);
 
     exec_path /= fs::path(svc->appid);