From 44ad672b9e0a5ba1eef3ef7c71da3eb887f4fe0a Mon Sep 17 00:00:00 2001
From: "Christian Goetze (CG)" <cg@lindenlab.com>
Date: Thu, 31 Mar 2011 15:43:47 -0700
Subject: [PATCH] Apply server side code to message template verification onto
 the viewer tree.

---
 build.sh                        | 5 ++++-
 indra/cmake/TemplateCheck.cmake | 2 +-
 indra/cmake/Variables.cmake     | 2 ++
 scripts/template_verifier.py    | 2 +-
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/build.sh b/build.sh
index 1c28f5a2559..92c2222c730 100755
--- a/build.sh
+++ b/build.sh
@@ -53,6 +53,8 @@ pre_build()
   local build_dir="$2"
   begin_section "Pre$variant"
   #export PATH="/cygdrive/c/Program Files/Microsoft Visual Studio 8/Common7/IDE/:$PATH"
+  [ -n "$master_message_template_checkout" ] && [ -r "$master_message_template_checkout/message_template.msg" ]\
+   && template_verifier_master_url="-DTEMPLATE_VERIFIER_MASTER_URL=file://$master_message_template_checkout/message_template.msg"
   python develop.py \
     --incredibuild \
     --unattended \
@@ -67,7 +69,8 @@ pre_build()
     -DLOCALIZESETUP:BOOL=ON \
     -DPACKAGE:BOOL=ON \
     -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
-    -DLL_TESTS:BOOL="$run_tests"
+    -DLL_TESTS:BOOL="$run_tests" \
+    -DTEMPLATE_VERIFIER_OPTIONS:STRING="$template_verifier_options" $template_verifier_master_url
   end_section "Pre$variant"
 }
 
diff --git a/indra/cmake/TemplateCheck.cmake b/indra/cmake/TemplateCheck.cmake
index 24805b42149..2fada2eda97 100644
--- a/indra/cmake/TemplateCheck.cmake
+++ b/indra/cmake/TemplateCheck.cmake
@@ -8,7 +8,7 @@ macro (check_message_template _target)
       PRE_LINK
       COMMAND ${PYTHON_EXECUTABLE}
       ARGS ${SCRIPTS_DIR}/template_verifier.py
-           --mode=development --cache_master ${TEMPLATE_VERIFIER_OPTIONS}
+           --mode=development --cache_master --master_url=${TEMPLATE_VERIFIER_MASTER_URL} ${TEMPLATE_VERIFIER_OPTIONS}
       COMMENT "Verifying message template - See http://wiki.secondlife.com/wiki/Template_verifier.py"
       )
 endmacro (check_message_template)
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
index 5dc0cabf03e..0d7156b91d1 100644
--- a/indra/cmake/Variables.cmake
+++ b/indra/cmake/Variables.cmake
@@ -41,6 +41,8 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake)
   set(INSTALL_PROPRIETARY ON CACHE BOOL "Install proprietary binaries")
 endif (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake)
 
+set(TEMPLATE_VERIFIER_OPTIONS "" CACHE STRING "Options for scripts/template_verifier.py")
+set(TEMPLATE_VERIFIER_MASTER_URL "http://bitbucket.org/lindenlab/master-message-template/raw/tip/message_template.msg" CACHE STRING "Location of the master message template")
 
 if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
   set(WINDOWS ON BOOL FORCE)
diff --git a/scripts/template_verifier.py b/scripts/template_verifier.py
index 113607e02a0..b44410cdd84 100644
--- a/scripts/template_verifier.py
+++ b/scripts/template_verifier.py
@@ -229,7 +229,7 @@ def run(sysargs):
 """)
     parser.add_option(
         '-u', '--master_url', type='string', dest='master_url',
-        default='http://secondlife.com/app/message_template/master_message_template.msg',
+        default='http://bitbucket.org/lindenlab/master-message-template/raw/tip/message_template.msg',
         help="""The url of the master message template.""")
     parser.add_option(
         '-c', '--cache_master', action='store_true', dest='cache_master',
-- 
GitLab