[cmake-commits] hoffman committed System.h.in 1.3.2.2 1.3.2.3 SystemTools.cxx 1.157.2.10 1.157.2.11

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Feb 5 13:21:35 EST 2007


Update of /cvsroot/CMake/CMake/Source/kwsys
In directory public:/mounts/ram/cvs-serv30870/Source/kwsys

Modified Files:
      Tag: CMake-2-4
	System.h.in SystemTools.cxx 
Log Message:
ENH: merge in changes from branch


Index: System.h.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/System.h.in,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -u -d -r1.3.2.2 -r1.3.2.3
--- System.h.in	27 Oct 2006 20:01:50 -0000	1.3.2.2
+++ System.h.in	5 Feb 2007 18:21:32 -0000	1.3.2.3
@@ -80,7 +80,7 @@
       Shell_Flag_Make.  */
   kwsysSystem_Shell_Flag_VSIDE              = (1<<1),
 
-  /** In a windows whell the argument is being passed to "echo".  */
+  /** In a windows shell the argument is being passed to "echo".  */
   kwsysSystem_Shell_Flag_EchoWindows        = (1<<2),
 
   /** The target shell is in a Watcom WMake makefile.  */

Index: SystemTools.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/SystemTools.cxx,v
retrieving revision 1.157.2.10
retrieving revision 1.157.2.11
diff -u -d -r1.157.2.10 -r1.157.2.11
--- SystemTools.cxx	27 Oct 2006 20:01:50 -0000	1.157.2.10
+++ SystemTools.cxx	5 Feb 2007 18:21:32 -0000	1.157.2.11
@@ -1464,10 +1464,33 @@
 bool SystemTools::CopyFileIfDifferent(const char* source,
                                       const char* destination)
 {
+  // special check for a destination that is a directory
+  // FilesDiffer does not handle file to directory compare
+  if(SystemTools::FileIsDirectory(destination))
+    {
+    kwsys_stl::string new_destination = destination;
+    SystemTools::ConvertToUnixSlashes(new_destination);
+    new_destination += '/';
+    kwsys_stl::string source_name = source;
+    new_destination += SystemTools::GetFilenameName(source_name);
+    if(SystemTools::FilesDiffer(source, new_destination.c_str()))
+      {
+      return SystemTools::CopyFileAlways(source, destination);
+      }
+    else
+      {
+      // the files are the same so the copy is done return
+      // true
+      return true;
+      }
+    }
+  // source and destination are files so do a copy if they
+  // are different
   if(SystemTools::FilesDiffer(source, destination))
     {
     return SystemTools::CopyFileAlways(source, destination);
     }
+  // at this point the files must be the same so return true
   return true;
 }
 
@@ -1556,7 +1579,6 @@
     {
     return true;
     }
-
   mode_t perm = 0;
   bool perms = SystemTools::GetPermissions(source, perm);
 



More information about the Cmake-commits mailing list