This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  34f314d8ee0bb46b23783719c751053177aabe73 (commit)
       via  9d38db531d4bbba4eca48dc1ec4e724e98614201 (commit)
       via  884e3edeb13643826d82a78d283157843f95a2f3 (commit)
       via  d66f6f36baca6d314f1f17e11d90d52b5c9d7ec2 (commit)
      from  46c1e65f85509be189e945db11557829c966a962 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=34f314d8ee0bb46b23783719c751053177aabe73
commit 34f314d8ee0bb46b23783719c751053177aabe73
Merge: 46c1e65 9d38db5
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Mon Jun 3 10:45:50 2013 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Mon Jun 3 10:45:50 2013 -0400

    Merge topic 'update-kwsys' into next
    
    9d38db5 bootstrap: Compile KWSys SystemTools with UTIME(S|NSAT) values
    884e3ed Merge branch 'upstream-kwsys' into update-kwsys
    d66f6f3 KWSys 2013-05-31 (dccf7725)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9d38db531d4bbba4eca48dc1ec4e724e98614201
commit 9d38db531d4bbba4eca48dc1ec4e724e98614201
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Mon Jun 3 10:34:35 2013 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Mon Jun 3 10:36:00 2013 -0400

    bootstrap: Compile KWSys SystemTools with UTIME(S|NSAT) values
    
    The parent commit merged a change to KWSys that adds preprocessor
    definitions for KWSYS_CXX_HAS_UTIMENSAT and KWSYS_CXX_HAS_UTIMES to the
    command line for compiling SystemTools.  For bootstrapping we do not
    need sub-1s timestamps so just define them to 0 for now.

diff --git a/bootstrap b/bootstrap
index 5c2addb..1e2d825 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1082,6 +1082,8 @@ KWSYS_STL_HAS_ALLOCATOR_OBJECTS=0
 KWSYS_CXX_HAS_SETENV=0
 KWSYS_CXX_HAS_UNSETENV=0
 KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=0
+KWSYS_CXX_HAS_UTIMENSAT=0
+KWSYS_CXX_HAS_UTIMES=0
 KWSYS_CXX_HAS_CSTDDEF=0
 KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS=0
 KWSYS_CXX_HAS_MEMBER_TEMPLATES=0
@@ -1466,7 +1468,13 @@ if [ "x${cmake_cxx_flags}" != "x" ]; then
 fi
 
 cmake_c_flags_String="-DKWSYS_STRING_C"
-cmake_cxx_flags_SystemTools="-DKWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV} 
-DKWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV} 
-DKWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}"
+cmake_cxx_flags_SystemTools="
+  -DKWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV}
+  -DKWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV}
+  -DKWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}
+  -DKWSYS_CXX_HAS_UTIMENSAT=${KWSYS_CXX_HAS_UTIMENSAT}
+  -DKWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES}
+"
 cmake_c_flags="${cmake_c_flags}-I`cmake_escape \"${cmake_bootstrap_dir}\"` 
-I`cmake_escape \"${cmake_source_dir}/Source\"` \
   -I`cmake_escape \"${cmake_bootstrap_dir}\"`"
 cmake_cxx_flags="${cmake_cxx_flags} -I`cmake_escape 
\"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=884e3edeb13643826d82a78d283157843f95a2f3
commit 884e3edeb13643826d82a78d283157843f95a2f3
Merge: d114fc3 d66f6f3
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Mon Jun 3 10:23:31 2013 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Mon Jun 3 10:23:31 2013 -0400

    Merge branch 'upstream-kwsys' into update-kwsys


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d66f6f36baca6d314f1f17e11d90d52b5c9d7ec2
commit d66f6f36baca6d314f1f17e11d90d52b5c9d7ec2
Author:     KWSys Robot <kwro...@kitware.com>
AuthorDate: Fri May 31 16:34:02 2013 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Mon Jun 3 10:23:16 2013 -0400

    KWSys 2013-05-31 (dccf7725)
    
    Extract upstream KWSys using the following shell commands.
    
    $ git archive --prefix=upstream-kwsys/ dccf7725 | tar x
    $ git shortlog --no-merges --abbrev=8 --format='%h %s' 725e541e..dccf7725
    Brad King (2):
          e3370418 SystemTools: Use COMPILE_DEFINITIONS to pass platform tests
          dccf7725 SystemTools: Touch with better than 1s resolution if possible
    
    Change-Id: Icdbcdf405e27b2d5dd30857c7c8679ed5096f252

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 124b8ac..6f0281d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -569,8 +569,17 @@ IF(KWSYS_USE_SystemTools)
     "Checking whether CXX compiler has unsetenv" DIRECT)
   KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
     "Checking whether CXX compiler has environ in stdlib.h" DIRECT)
-  SET_SOURCE_FILES_PROPERTIES(SystemTools.cxx PROPERTIES
-    COMPILE_FLAGS "-DKWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV} 
-DKWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV} 
-DKWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}")
+  KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_UTIMES
+    "Checking whether CXX compiler has utimes" DIRECT)
+  KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_UTIMENSAT
+    "Checking whether CXX compiler has utimensat" DIRECT)
+  SET_PROPERTY(SOURCE SystemTools.cxx APPEND PROPERTY COMPILE_DEFINITIONS
+    KWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV}
+    KWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV}
+    KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}
+    KWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES}
+    KWSYS_CXX_HAS_UTIMENSAT=${KWSYS_CXX_HAS_UTIMENSAT}
+    )
 ENDIF()
 
 IF(KWSYS_USE_SystemInformation)
diff --git a/SystemTools.cxx b/SystemTools.cxx
index 158217e..652649f 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -1124,22 +1124,58 @@ bool SystemTools::Touch(const char* filename, bool 
create)
       }
     return false;
     }
-#ifdef _MSC_VER
-#define utime _utime
-#define utimbuf _utimbuf
-#endif
-  struct stat fromStat;
-  if(stat(filename, &fromStat) < 0)
+#if defined(_WIN32) && !defined(__CYGWIN__)
+  HANDLE h = CreateFile(filename, FILE_WRITE_ATTRIBUTES,
+                        FILE_SHARE_WRITE, 0, OPEN_EXISTING,
+                        FILE_FLAG_BACKUP_SEMANTICS, 0);
+  if(!h)
+    {
+    return false;
+    }
+  FILETIME mtime;
+  GetSystemTimeAsFileTime(&mtime);
+  if(!SetFileTime(h, 0, 0, &mtime))
     {
+    CloseHandle(h);
     return false;
     }
-  struct utimbuf buf;
-  buf.actime = fromStat.st_atime;
-  buf.modtime = static_cast<time_t>(SystemTools::GetTime());
-  if(utime(filename, &buf) < 0)
+  CloseHandle(h);
+#elif KWSYS_CXX_HAS_UTIMENSAT
+  struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}};
+  if(utimensat(AT_FDCWD, filename, times, 0) < 0)
+    {
+    return false;
+    }
+#else
+  struct stat st;
+  if(stat(filename, &st) < 0)
     {
     return false;
     }
+  struct timeval mtime;
+  gettimeofday(&mtime, 0);
+# if KWSYS_CXX_HAS_UTIMES
+  struct timeval times[2] =
+    {
+#  if KWSYS_STAT_HAS_ST_MTIM
+      {st.st_atim.tv_sec, st.st_atim.tv_nsec/1000}, /* tv_sec, tv_usec */
+#  else
+      {st.st_atime, 0},
+#  endif
+      mtime
+    };
+  if(utimes(filename, times) < 0)
+    {
+    return false;
+    }
+# else
+  struct utimbuf times = {st.st_atime, mtime.tv_sec};
+  if(utime(filename, &times) < 0)
+    {
+    return false;
+    }
+# endif
+#endif
   return true;
 }
 
diff --git a/kwsysPlatformTestsCXX.cxx b/kwsysPlatformTestsCXX.cxx
index 48976c4..a7e3b50 100644
--- a/kwsysPlatformTestsCXX.cxx
+++ b/kwsysPlatformTestsCXX.cxx
@@ -494,6 +494,25 @@ int main()
 }
 #endif
 
+#ifdef TEST_KWSYS_CXX_HAS_UTIMES
+#include <sys/time.h>
+int main()
+{
+  struct timeval* current_time = 0;
+  return utimes("/example", current_time);
+}
+#endif
+
+#ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
+#include <fcntl.h>
+#include <sys/stat.h>
+int main()
+{
+  struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}};
+  return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW);
+}
+#endif
+
 #ifdef TEST_KWSYS_CXX_TYPE_INFO
 /* Collect fundamental type information and save it to a CMake script.  */
 

-----------------------------------------------------------------------

Summary of changes:
 Source/kwsys/CMakeLists.txt            |   13 ++++++-
 Source/kwsys/SystemTools.cxx           |   56 ++++++++++++++++++++++++++------
 Source/kwsys/kwsysPlatformTestsCXX.cxx |   19 +++++++++++
 bootstrap                              |   10 +++++-
 4 files changed, 85 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits

Reply via email to