summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/cmake/TemplateCheck.cmake7
-rw-r--r--indra/newview/CMakeLists.txt6
-rw-r--r--[-rwxr-xr-x]indra/newview/llavataractions.cpp0
-rw-r--r--[-rwxr-xr-x]indra/newview/llcommandhandler.cpp0
-rw-r--r--[-rwxr-xr-x]indra/newview/llfloaterpreference.cpp0
-rw-r--r--[-rwxr-xr-x]indra/newview/llfloaterworldmap.cpp0
-rw-r--r--[-rwxr-xr-x]indra/newview/llpanelpicks.cpp0
-rw-r--r--[-rwxr-xr-x]indra/newview/llpanelpicks.h0
-rw-r--r--[-rwxr-xr-x]indra/newview/llpanelprofile.cpp0
-rw-r--r--[-rwxr-xr-x]indra/newview/llpanelprofile.h0
-rw-r--r--[-rwxr-xr-x]scripts/md5check.py0
-rw-r--r--scripts/messages/message_template.msg.sha11
-rw-r--r--scripts/template_verifier.py22
13 files changed, 27 insertions, 9 deletions
diff --git a/indra/cmake/TemplateCheck.cmake b/indra/cmake/TemplateCheck.cmake
index 90d58d93ad..24805b4214 100644
--- a/indra/cmake/TemplateCheck.cmake
+++ b/indra/cmake/TemplateCheck.cmake
@@ -5,11 +5,10 @@ include(Python)
macro (check_message_template _target)
add_custom_command(
TARGET ${_target}
- POST_BUILD
+ PRE_LINK
COMMAND ${PYTHON_EXECUTABLE}
- ARGS ${SCRIPTS_DIR}/md5check.py
- 3f19d130400c547de36278a6b6f9b028
- ${SCRIPTS_DIR}/messages/message_template.msg
+ ARGS ${SCRIPTS_DIR}/template_verifier.py
+ --mode=development --cache_master ${TEMPLATE_VERIFIER_OPTIONS}
COMMENT "Verifying message template - See http://wiki.secondlife.com/wiki/Template_verifier.py"
)
endmacro (check_message_template)
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 66869288b6..bb4d9d8625 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1648,8 +1648,6 @@ if (WINDOWS)
# sorted out on the parabuild cluster...
#${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2)
- check_message_template(package)
-
endif (PACKAGE)
endif (WINDOWS)
@@ -1771,7 +1769,7 @@ if (LINUX)
${COPY_INPUT_DEPENDENCIES}
COMMENT "Performing viewer_manifest copy"
)
-
+
add_custom_target(copy_l_viewer_manifest ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched)
if (PACKAGE)
@@ -1818,7 +1816,6 @@ if (DARWIN)
if (PACKAGE)
add_custom_target(package ALL DEPENDS ${VIEWER_BINARY_NAME})
- check_message_template(package)
add_custom_command(
TARGET package POST_BUILD
@@ -2001,4 +1998,5 @@ if (LL_TESTS)
endif (LL_TESTS)
+check_message_template(${VIEWER_BINARY_NAME})
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index afa8b62c74..afa8b62c74 100755..100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
diff --git a/indra/newview/llcommandhandler.cpp b/indra/newview/llcommandhandler.cpp
index 1b6ba02aac..1b6ba02aac 100755..100644
--- a/indra/newview/llcommandhandler.cpp
+++ b/indra/newview/llcommandhandler.cpp
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 724096b443..724096b443 100755..100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index 03cf0332a9..03cf0332a9 100755..100644
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp
index ddce83c616..ddce83c616 100755..100644
--- a/indra/newview/llpanelpicks.cpp
+++ b/indra/newview/llpanelpicks.cpp
diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h
index 29db110523..29db110523 100755..100644
--- a/indra/newview/llpanelpicks.h
+++ b/indra/newview/llpanelpicks.h
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index fd5c3362bb..fd5c3362bb 100755..100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h
index fca359f51e..fca359f51e 100755..100644
--- a/indra/newview/llpanelprofile.h
+++ b/indra/newview/llpanelprofile.h
diff --git a/scripts/md5check.py b/scripts/md5check.py
index 1a54a2844c..1a54a2844c 100755..100644
--- a/scripts/md5check.py
+++ b/scripts/md5check.py
diff --git a/scripts/messages/message_template.msg.sha1 b/scripts/messages/message_template.msg.sha1
new file mode 100644
index 0000000000..dcd172cdf6
--- /dev/null
+++ b/scripts/messages/message_template.msg.sha1
@@ -0,0 +1 @@
+a7f6fe7e34c9c92b7315c6fb56ad32b8f651d4fb \ No newline at end of file
diff --git a/scripts/template_verifier.py b/scripts/template_verifier.py
index 7f3fed88a9..113607e02a 100644
--- a/scripts/template_verifier.py
+++ b/scripts/template_verifier.py
@@ -66,6 +66,7 @@ add_indra_lib_path()
import optparse
import os
import urllib
+import hashlib
from indra.ipc import compatibility
from indra.ipc import tokenstream
@@ -233,6 +234,9 @@ http://wiki.secondlife.com/wiki/Template_verifier.py
parser.add_option(
'-c', '--cache_master', action='store_true', dest='cache_master',
default=False, help="""Set to true to attempt use local cached copy of the master template.""")
+ parser.add_option(
+ '-f', '--force', action='store_true', dest='force_verification',
+ default=False, help="""Set to true to skip the sha_1 check and force template verification.""")
options, args = parser.parse_args(sysargs)
@@ -269,8 +273,18 @@ http://wiki.secondlife.com/wiki/Template_verifier.py
print "current:", current_filename
current_url = 'file://%s' % current_filename
- # retrieve the contents of the local template and check for syntax
+ # retrieve the contents of the local template
current = fetch(current_url)
+ hexdigest = hashlib.sha1(current).hexdigest()
+ if not options.force_verification:
+ # Early exist if the template hasn't changed.
+ sha_url = "%s.sha1" % current_url
+ current_sha = fetch(sha_url)
+ if hexdigest == current_sha:
+ print "Message template SHA_1 has not changed."
+ sys.exit(0)
+
+ # and check for syntax
current_parsed = llmessage.parseTemplateString(current)
if options.cache_master:
@@ -301,6 +315,12 @@ http://wiki.secondlife.com/wiki/Template_verifier.py
if acceptable:
explain("--- PASS ---", compat)
+ if options.force_verification == False:
+ print "Updating sha1 to %s" % hexdigest
+ sha_filename = "%s.sha1" % current_filename
+ sha_file = open(sha_filename, 'w')
+ sha_file.write(hexdigest)
+ sha_file.close()
else:
explain("*** FAIL ***", compat)
return 1