[Cmake-commits] CMake branch, next, updated. v2.8.1-1515-g0d87744

David Cole david.cole at kitware.com
Sun Jun 27 08:44:16 EDT 2010


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  0d87744a6951eca9d964fd981ce2ebc4746131c7 (commit)
       via  a77aa7065e14c783a237b83b3db2da6613e7c1b5 (commit)
       via  b699509aeeca914ce81cf030e59b8dce98c00278 (commit)
      from  007fc8ea061cdfae7246ce9407c45fea980f2c4a (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=0d87744a6951eca9d964fd981ce2ebc4746131c7
commit 0d87744a6951eca9d964fd981ce2ebc4746131c7
Merge: 007fc8e a77aa70
Author: David Cole <david.cole at kitware.com>
Date:   Sun Jun 27 08:40:22 2010 -0400

    Merge branch 'improve-CheckSourceTree-test' into next


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a77aa7065e14c783a237b83b3db2da6613e7c1b5
commit a77aa7065e14c783a237b83b3db2da6613e7c1b5
Author: David Cole <david.cole at kitware.com>
Date:   Sun Jun 27 08:29:15 2010 -0400

    CheckSourceTree test: read UpdateCommand from Update.xml.
    
    If GIT_EXECUTABLE is not passed in, and is not available from
    DartConfiguration.tcl or CTestConfiguration.ini, then make one
    more last ditch attempt to get it from Update.xml, if there is
    an Update.xml. For dashboards that have successfully done a
    ctest_update call, there should be an Update.xml in the Testing
    subdir of the binary tree. Parse that file for the git executable
    recorded in the <UpdateCommand> element.
    
    And make this test pass on those RogueResearch dashboard machines!

diff --git a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
index 9150aef..73f8b01 100644
--- a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
+++ b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
@@ -149,26 +149,77 @@ if(is_git_checkout AND NOT GIT_EXECUTABLE)
   # from it:
   #
   if(ctest_ini_file)
-    file(STRINGS "${ctest_ini_file}" lines REGEX "^GITCommand: (.*)$")
-    string(REGEX REPLACE "^GITCommand: (.*)$" "\\1" exe "${lines}")
+    file(STRINGS "${ctest_ini_file}" line REGEX "^GITCommand: (.*)$")
+    string(REGEX REPLACE "^GITCommand: (.*)$" "\\1" line "${line}")
+    if("${line}" MATCHES "^\"")
+      string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}")
+    else()
+      string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}")
+    endif()
+    set(exe "${line}")
     if("${exe}" STREQUAL "GITCOMMAND-NOTFOUND")
       set(exe "")
     endif()
+    if(exe)
+      message("info: GIT_EXECUTABLE set by 'GITCommand:' from '${ctest_ini_file}'")
+    endif()
 
     if(NOT exe)
-      file(STRINGS "${ctest_ini_file}" lines REGEX "^UpdateCommand: (.*)$")
-      string(REGEX REPLACE "^UpdateCommand: (.*)$" "\\1" exe "${lines}")
+      file(STRINGS "${ctest_ini_file}" line REGEX "^UpdateCommand: (.*)$")
+      string(REGEX REPLACE "^UpdateCommand: (.*)$" "\\1" line "${line}")
+      if("${line}" MATCHES "^\"")
+        string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}")
+      else()
+        string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}")
+      endif()
+      set(exe "${line}")
       if("${exe}" STREQUAL "GITCOMMAND-NOTFOUND")
         set(exe "")
       endif()
+      if(exe)
+        message("info: GIT_EXECUTABLE set by 'UpdateCommand:' from '${ctest_ini_file}'")
+      endif()
+    endif()
+  else()
+    message("info: no DartConfiguration.tcl or CTestConfiguration.ini file...")
+  endif()
+
+  # If we have still not grokked the exe, look in the Update.xml file to see
+  # if we can parse it from there...
+  #
+  if(NOT exe)
+    file(GLOB_RECURSE update_xml_file "${CMake_BINARY_DIR}/Testing/Update.xml")
+    if(update_xml_file)
+      file(STRINGS "${update_xml_file}" line
+        REGEX "^.*<UpdateCommand>(.*)</UpdateCommand>$" LIMIT_COUNT 1)
+      string(REPLACE "&quot\;" "\"" line "${line}")
+      string(REGEX REPLACE "^.*<UpdateCommand>(.*)</UpdateCommand>$" "\\1" line "${line}")
+      if("${line}" MATCHES "^\"")
+        string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}")
+      else()
+        string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}")
+      endif()
+      if(line)
+        set(exe "${line}")
+      endif()
+      if(exe)
+        message("info: GIT_EXECUTABLE set by '<UpdateCommand>' from '${update_xml_file}'")
+      endif()
+    else()
+      message("info: no Update.xml file...")
     endif()
   endif()
 
   if(exe)
     set(GIT_EXECUTABLE "${exe}")
-    message("info: set GIT_EXECUTABLE to '${GIT_EXECUTABLE}' based on '${ctest_ini_file}'")
+    message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'")
+    message("")
+
+    if(NOT EXISTS "${GIT_EXECUTABLE}")
+      message(FATAL_ERROR "GIT_EXECUTABLE does not exist...")
+    endif()
   else()
-    message(FATAL_ERROR "could not determine GIT_EXECUTABLE based on '${ctest_ini_file}'...")
+    message(FATAL_ERROR "could not determine GIT_EXECUTABLE...")
   endif()
 endif()
 

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

Summary of changes:
 Source/kwsys/kwsysDateStamp.cmake             |    2 +-
 Tests/CMakeTests/CheckSourceTreeTest.cmake.in |   63 ++++++++++++++++++++++--
 2 files changed, 58 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list