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  fa0530550650e586c9b642d84cd689456c73d283 (commit)
       via  c35961b010da87492a60afb6e5dd7436ea36ed8b (commit)
      from  07473a69c38a87f5d365d6a28125a37a954df8f7 (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=fa0530550650e586c9b642d84cd689456c73d283
commit fa0530550650e586c9b642d84cd689456c73d283
Merge: 07473a6 c35961b
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri May 24 15:47:52 2013 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Fri May 24 15:47:52 2013 -0400

    Merge topic 'ExternalData-no-re-stage' into next
    
    c35961b ExternalData: Do not re-stage staged object files


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c35961b010da87492a60afb6e5dd7436ea36ed8b
commit c35961b010da87492a60afb6e5dd7436ea36ed8b
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri May 24 15:33:38 2013 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Fri May 24 15:45:38 2013 -0400

    ExternalData: Do not re-stage staged object files
    
    The ExternalData_LINK_CONTENT option tells ExternalData to convert real
    data files it finds into content links and to "stage" the original
    content in a ".ExternalData_<algo>_<hash>" file.  However, after a data
    object has been staged it is possible that a user-provided pattern in
    the "REGEX:" option will later match the staged object file.  We must
    not process staged object files even when a user pattern matches them.
    
    Fix the implementation to not match a staged object file as a normal
    data file for conversion.  Extend the RunCMake.ExternalData test to
    cover this case.

diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake
index 187f408..8332725 100644
--- a/Modules/ExternalData.cmake
+++ b/Modules/ExternalData.cmake
@@ -551,7 +551,10 @@ function(_ExternalData_arg_find_files pattern regex)
       set(relname "${entry}")
       set(alg "")
     endif()
-    if("x${relname}" MATCHES "^x${regex}$" AND NOT IS_DIRECTORY 
"${top_src}/${entry}")
+    if("x${relname}" MATCHES "^x${regex}$" # matches
+        AND NOT IS_DIRECTORY "${top_src}/${entry}" # not a directory
+        AND NOT "x${relname}" MATCHES "(^x|/)\\.ExternalData_" # not staged obj
+        )
       set(name "${top_src}/${relname}")
       set(file "${top_bin}/${relname}")
       if(alg)
diff --git a/Tests/RunCMake/ExternalData/LinkDirectory1-stdout.txt 
b/Tests/RunCMake/ExternalData/LinkDirectory1-stdout.txt
new file mode 100644
index 0000000..953ea68
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/LinkDirectory1-stdout.txt
@@ -0,0 +1,5 @@
+-- Linked Dir/ToLink.txt.md5 to ExternalData 
MD5/c18ff9804c8deec9eaeb17063cda8b7b
+-- Raw data correctly transformed to content link!
+-- Staged content exists!
+-- Staged content is correct!
+-- Staged content was correctly not re-staged!
diff --git a/Tests/RunCMake/ExternalData/LinkDirectory1.cmake 
b/Tests/RunCMake/ExternalData/LinkDirectory1.cmake
new file mode 100644
index 0000000..541fc79
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/LinkDirectory1.cmake
@@ -0,0 +1,37 @@
+include(ExternalData)
+set(ExternalData_LINK_CONTENT MD5)
+set(ExternalData_SOURCE_ROOT ${CMAKE_CURRENT_BINARY_DIR})
+set(ExternalData_BINARY_ROOT ${CMAKE_CURRENT_BINARY_DIR}/ExternalData)
+set(input ${CMAKE_CURRENT_BINARY_DIR}/Dir)
+set(output ${CMAKE_CURRENT_BINARY_DIR}/ExternalData/Dir)
+set(staged "${input}/.ExternalData_MD5_c18ff9804c8deec9eaeb17063cda8b7b")
+set(content "To be transformed into a content link.")
+file(REMOVE ${staged})
+file(REMOVE_RECURSE ${input})
+file(WRITE ${input}/ToLink.txt "${content}")
+ExternalData_Expand_Arguments(Data args "DATA{${input}/,REGEX:.*}")
+if("x${args}" STREQUAL "x${output}")
+  message(STATUS "Raw data correctly transformed to content link!")
+else()
+  message(FATAL_ERROR "Data reference transformed to:\n  ${args}\n"
+    "but we expected:\n  ${output}")
+endif()
+if(EXISTS "${staged}")
+  message(STATUS "Staged content exists!")
+else()
+  message(FATAL_ERROR "Staged content missing!")
+endif()
+
+# Expand again to check whether staged content is ignored.
+ExternalData_Expand_Arguments(Data args "DATA{${input}/,REGEX:.*}")
+file(STRINGS "${staged}" staged_content LIMIT_INPUT 1024)
+if("${content}" STREQUAL "${staged_content}")
+  message(STATUS "Staged content is correct!")
+else()
+  message(STATUS "Staged content is incorrect!")
+endif()
+if(EXISTS "${staged}.md5")
+  message(FATAL_ERROR "Staged content was incorrectly re-staged!")
+else()
+  message(STATUS "Staged content was correctly not re-staged!")
+endif()
diff --git a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake 
b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake
index ceb2ecf..8fba82c 100644
--- a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake
@@ -13,6 +13,7 @@ run_cmake(Directory4)
 run_cmake(Directory5)
 run_cmake(LinkContentMD5)
 run_cmake(LinkContentSHA1)
+run_cmake(LinkDirectory1)
 run_cmake(MissingData)
 run_cmake(NoLinkInSource)
 run_cmake(NoURLTemplates)

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

Summary of changes:
 Modules/ExternalData.cmake                         |    5 ++-
 .../ExternalData/LinkDirectory1-stdout.txt         |    5 +++
 Tests/RunCMake/ExternalData/LinkDirectory1.cmake   |   37 ++++++++++++++++++++
 Tests/RunCMake/ExternalData/RunCMakeTest.cmake     |    1 +
 4 files changed, 47 insertions(+), 1 deletions(-)
 create mode 100644 Tests/RunCMake/ExternalData/LinkDirectory1-stdout.txt
 create mode 100644 Tests/RunCMake/ExternalData/LinkDirectory1.cmake


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