From 6e97ead181f04c5cb4953e5e3316d7d8caf0a1ec Mon Sep 17 00:00:00 2001 From: Kelly Washington Date: Thu, 3 Mar 2011 12:05:40 -0800 Subject: Add early exit to message template check if it hasn't changed. --- scripts/template_verifier.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/template_verifier.py b/scripts/template_verifier.py index ddb050fbbb..d01750ffc6 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 -- cgit v1.3 From f360ce118d8016a052e30538037993d984ae01d8 Mon Sep 17 00:00:00 2001 From: Kelly Washington Date: Thu, 3 Mar 2011 12:14:10 -0800 Subject: Add template .sha1 --- scripts/messages/message_template.msg.sha1 | 1 + 1 file changed, 1 insertion(+) create mode 100644 scripts/messages/message_template.msg.sha1 (limited to 'scripts') 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 -- cgit v1.3 From 44ad672b9e0a5ba1eef3ef7c71da3eb887f4fe0a Mon Sep 17 00:00:00 2001 From: "Christian Goetze (CG)" Date: Thu, 31 Mar 2011 15:43:47 -0700 Subject: 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(-) (limited to 'scripts') diff --git a/build.sh b/build.sh index 1c28f5a255..92c2222c73 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 24805b4214..2fada2eda9 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 5dc0cabf03..0d7156b91d 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 113607e02a..b44410cdd8 100644 --- a/scripts/template_verifier.py +++ b/scripts/template_verifier.py @@ -229,7 +229,7 @@ http://wiki.secondlife.com/wiki/Template_verifier.py """) 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', -- cgit v1.3 From 6540ccd307128df192ed728ff5b25c6a6e27050c Mon Sep 17 00:00:00 2001 From: Kelly Washington Date: Thu, 31 Mar 2011 16:15:48 -0700 Subject: Updated message template hash. --- scripts/messages/message_template.msg.sha1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/messages/message_template.msg.sha1 b/scripts/messages/message_template.msg.sha1 index dcd172cdf6..4b1ba7e2d3 100644 --- a/scripts/messages/message_template.msg.sha1 +++ b/scripts/messages/message_template.msg.sha1 @@ -1 +1 @@ -a7f6fe7e34c9c92b7315c6fb56ad32b8f651d4fb \ No newline at end of file +ee062c94248e9af06df5284f7186893a135084c9 \ No newline at end of file -- cgit v1.3 From cf4d929888025552050e66f3b359e49ed131af8d Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 1 Apr 2011 06:49:19 -0400 Subject: STORM-956 update message template --- scripts/messages/message_template.msg | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/messages/message_template.msg b/scripts/messages/message_template.msg index 77dc940335..d292653d3f 100644 --- a/scripts/messages/message_template.msg +++ b/scripts/messages/message_template.msg @@ -2966,7 +2966,7 @@ version 2.0 { BillableFactor F32 } { ObjectBonusFactor F32 } { WaterHeight F32 } - { TerrainRaiseLimit F32 } + { TerrainRaiseLimit F32 } { TerrainLowerLimit F32 } { PricePerMeter S32 } { RedirectGridX S32 } @@ -4242,6 +4242,10 @@ version 2.0 Buttons Variable { ButtonLabel Variable 1 } } + { + OwnerData Variable + { OwnerID LLUUID } + } } @@ -6762,6 +6766,8 @@ version 2.0 } // And, the money transfer +// *NOTE: Unused as of 2010-04-06, because all back-end money transactions +// are done with web services via L$ API. JC { MoneyTransferBackend Low 312 Trusted Zerocoded { -- cgit v1.3