From e3863d2ede47333a5e57442c006a21fb8691084d Mon Sep 17 00:00:00 2001
From: Steven Murray <Steven.Murray@cern.ch>
Date: Thu, 18 Jun 2015 17:19:20 +0200
Subject: [PATCH] Moved DirIterator from the scheduler directory to common

---
 common/CMakeLists.txt                 | 14 ++++++++------
 {scheduler => common}/DirEntry.cpp    |  2 +-
 {scheduler => common}/DirEntry.hpp    |  0
 {scheduler => common}/DirIterator.cpp |  2 +-
 {scheduler => common}/DirIterator.hpp |  2 +-
 nameserver/MockNameServer.hpp         |  2 +-
 nameserver/NameServer.hpp             |  2 +-
 scheduler/CMakeLists.txt              |  2 --
 scheduler/FileSystemDirEntry.hpp      |  2 +-
 scheduler/MockSchedulerDatabase.cpp   |  2 +-
 xroot_plugins/XrdProFile.cpp          |  2 +-
 11 files changed, 16 insertions(+), 16 deletions(-)
 rename {scheduler => common}/DirEntry.cpp (99%)
 rename {scheduler => common}/DirEntry.hpp (100%)
 rename {scheduler => common}/DirIterator.cpp (98%)
 rename {scheduler => common}/DirIterator.hpp (98%)

diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index 25f62f9d3a..efbb3c769f 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -1,18 +1,20 @@
 cmake_minimum_required (VERSION 2.6)
 
 set (COMMON_LIB_SRC_FILES
-  FileStatus.cpp
-  SmartFd.cpp
-  Timer.cpp
-  UserIdentity.cpp
-  Utils.cpp
+  DirEntry.cpp
+  DirIterator.cpp
   exception/Backtrace.cpp
   exception/Errnum.cpp
   exception/Exception.cpp
+  FileStatus.cpp
+  SmartFd.cpp
   strerror_r_wrapper.cpp
+  Timer.cpp
   threading/ChildProcess.cpp
   threading/Mutex.cpp
-  threading/Threading.cpp)
+  threading/Threading.cpp
+  UserIdentity.cpp
+  Utils.cpp)
 
 add_library (ctacommon SHARED
   ${COMMON_LIB_SRC_FILES})
diff --git a/scheduler/DirEntry.cpp b/common/DirEntry.cpp
similarity index 99%
rename from scheduler/DirEntry.cpp
rename to common/DirEntry.cpp
index a8f7d914bc..3bfb48c1e5 100644
--- a/scheduler/DirEntry.cpp
+++ b/common/DirEntry.cpp
@@ -16,7 +16,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "scheduler/DirEntry.hpp"
+#include "common/DirEntry.hpp"
 
 //------------------------------------------------------------------------------
 // entryTypeToStr
diff --git a/scheduler/DirEntry.hpp b/common/DirEntry.hpp
similarity index 100%
rename from scheduler/DirEntry.hpp
rename to common/DirEntry.hpp
diff --git a/scheduler/DirIterator.cpp b/common/DirIterator.cpp
similarity index 98%
rename from scheduler/DirIterator.cpp
rename to common/DirIterator.cpp
index 25ecb8b7b3..71756ebdc2 100644
--- a/scheduler/DirIterator.cpp
+++ b/common/DirIterator.cpp
@@ -16,7 +16,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "scheduler/DirIterator.hpp"
+#include "common/DirIterator.hpp"
 #include "common/exception/Exception.hpp"
 using cta::exception::Exception;
 
diff --git a/scheduler/DirIterator.hpp b/common/DirIterator.hpp
similarity index 98%
rename from scheduler/DirIterator.hpp
rename to common/DirIterator.hpp
index 8ceead2ef2..5a46ca046b 100644
--- a/scheduler/DirIterator.hpp
+++ b/common/DirIterator.hpp
@@ -18,7 +18,7 @@
 
 #pragma once
 
-#include "scheduler/DirEntry.hpp"
+#include "common/DirEntry.hpp"
 
 #include <list>
 
diff --git a/nameserver/MockNameServer.hpp b/nameserver/MockNameServer.hpp
index db233543df..7b569a67d9 100644
--- a/nameserver/MockNameServer.hpp
+++ b/nameserver/MockNameServer.hpp
@@ -20,7 +20,7 @@
 
 #include "common/UserIdentity.hpp"
 #include "nameserver/NameServer.hpp"
-#include "scheduler/DirIterator.hpp"
+#include "common/DirIterator.hpp"
 #include "scheduler/SecurityIdentity.hpp"
 
 #include <list>
diff --git a/nameserver/NameServer.hpp b/nameserver/NameServer.hpp
index cff5b3c0a4..44557e750b 100644
--- a/nameserver/NameServer.hpp
+++ b/nameserver/NameServer.hpp
@@ -19,7 +19,7 @@
 #pragma once
 
 #include "common/FileStatus.hpp"
-#include "scheduler/DirIterator.hpp"
+#include "common/DirIterator.hpp"
 #include "scheduler/SecurityIdentity.hpp"
 
 #include <string>
diff --git a/scheduler/CMakeLists.txt b/scheduler/CMakeLists.txt
index 67c8c67eff..17ce6b69f6 100644
--- a/scheduler/CMakeLists.txt
+++ b/scheduler/CMakeLists.txt
@@ -17,8 +17,6 @@ set (CTA_SCHEDULER_SRC_FILES
   ArchiveToTapeCopyRequest.cpp
   ConfigurationItem.cpp
   CreationLog.cpp
-  DirEntry.cpp
-  DirIterator.cpp
   DiskException.cpp
   DriveQuota.cpp
   FileAttribute.cpp
diff --git a/scheduler/FileSystemDirEntry.hpp b/scheduler/FileSystemDirEntry.hpp
index a2ef8c5cd5..88bcf92725 100644
--- a/scheduler/FileSystemDirEntry.hpp
+++ b/scheduler/FileSystemDirEntry.hpp
@@ -18,7 +18,7 @@
 
 #pragma once
 
-#include "scheduler/DirEntry.hpp"
+#include "common/DirEntry.hpp"
 #include "scheduler/FileSystemStorageClasses.hpp"
 
 namespace cta {
diff --git a/scheduler/MockSchedulerDatabase.cpp b/scheduler/MockSchedulerDatabase.cpp
index fda369e721..1e95dbf322 100644
--- a/scheduler/MockSchedulerDatabase.cpp
+++ b/scheduler/MockSchedulerDatabase.cpp
@@ -25,7 +25,7 @@
 #include "scheduler/ArchiveToFileRequest.hpp"
 #include "scheduler/ArchiveToTapeCopyRequest.hpp"
 #include "scheduler/ArchivalRoute.hpp"
-#include "scheduler/DirIterator.hpp"
+#include "common/DirIterator.hpp"
 #include "scheduler/LogicalLibrary.hpp"
 #include "scheduler/MockSchedulerDatabase.hpp"
 #include "scheduler/RetrieveFromTapeCopyRequest.hpp"
diff --git a/xroot_plugins/XrdProFile.cpp b/xroot_plugins/XrdProFile.cpp
index 2779e0e24a..ea1f401c40 100644
--- a/xroot_plugins/XrdProFile.cpp
+++ b/xroot_plugins/XrdProFile.cpp
@@ -34,7 +34,7 @@
 
 #include "XrdSec/XrdSecEntity.hh"
 #include "cmdline/CTACmd.hpp"
-#include "scheduler/DirIterator.hpp"
+#include "common/DirIterator.hpp"
 
 #include <iostream>
 #include <pwd.h>
-- 
GitLab