From 42126aaf6ca83bbfbebab364a026763f62770bf7 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Thu, 7 Oct 2010 00:24:44 +0200 Subject: FindSubversion: Fix for German localized client (#11273) On a Win32 system with a German version of SilkSVN I couldn't run CMake again on the working copy as the cache is displayed as corrupted. The cause is that the regular expression to find the version number will not match and put everything from the "svn --version" output into the cache, which contains umlauts and other funny characters. Fix the regexp to not only match " version " but also " Version " as it's in the German output. I have no idea what will happen on a French or Japanese system. This should be easy to test as it happens also on a German Linux system. --- Modules/FindSubversion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake index daf3d87..61e0253 100644 --- a/Modules/FindSubversion.cmake +++ b/Modules/FindSubversion.cmake @@ -57,7 +57,7 @@ IF(Subversion_SVN_EXECUTABLE) OUTPUT_VARIABLE Subversion_VERSION_SVN OUTPUT_STRIP_TRAILING_WHITESPACE) - STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*" + STRING(REGEX REPLACE "^(.*\n)?svn, [Vv]ersion ([.0-9]+).*" "\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}") MACRO(Subversion_WC_INFO dir prefix) -- cgit v0.12 From d2f8c5f8ab657f35d71f1f4a67721ead7ee622c4 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Thu, 7 Oct 2010 16:30:01 +0200 Subject: FindSubversion: Use C locale to detect version (#11273) Force LC_ALL to C before the call of the svn executable as it is done in the Subversion_WC_INFO macro a few lines below. --- Modules/FindSubversion.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake index 61e0253..3561a19 100644 --- a/Modules/FindSubversion.cmake +++ b/Modules/FindSubversion.cmake @@ -52,12 +52,19 @@ FIND_PROGRAM(Subversion_SVN_EXECUTABLE svn MARK_AS_ADVANCED(Subversion_SVN_EXECUTABLE) IF(Subversion_SVN_EXECUTABLE) + # the subversion commands should be executed with the C locale, otherwise + # the message (which are parsed) may be translated, Alex + SET(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}") + SET(ENV{LC_ALL} C) EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version OUTPUT_VARIABLE Subversion_VERSION_SVN OUTPUT_STRIP_TRAILING_WHITESPACE) - STRING(REGEX REPLACE "^(.*\n)?svn, [Vv]ersion ([.0-9]+).*" + # restore the previous LC_ALL + SET(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL}) + + STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*" "\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}") MACRO(Subversion_WC_INFO dir prefix) -- cgit v0.12