diff options
106 files changed, 2332 insertions, 2868 deletions
@@ -441,3 +441,16 @@ adc360e6bf21390d2665380951d85937cd29a604 3.5.0-release 4b7fa963b80e2056ab648f83a4d61310b3cedb3d DRTVWR-314 65ae89aeb7ea674a555e439e963f17949322ac94 3.5.1-beta3 13149a524874b608aeb76325b35faff113a5ea53 3.5.1-release +78a8fe6abf331944d6b6bb1ce1024a6bc08141f4 DRTVWR-298 +50ccc12f38c3c99f03b374e32429cb043b73e2a6 DRTVWR-294 +c2b1066514308dff1eeb91162392dfe08bf1c0fe DRTVWR-309 +e6b8a92acffd693cd1459e4212e3dff1050acf67 DRTVWR-278 +106f19cc011aafdfc9a6d12b641fe8db6e9735a7 3.5.2-beta1 +509b97acc4ca1f2644197f1b555773ac0bb6838c 3.5.2-beta2 +6cb3689d89c13876ce8fa8faefa7b05e4279502d DRTVWR-316 +cfc3e650e5b2063288e7b832e9c9f521bbdacc92 DRTVWR-315 +e6e35501f1fea252ef83080adcf30c3cb7c2f75c DRTVWR-299 +b6a4ac8f1916ede76e8a023e1cf35c045d0ac707 3.5.2-beta3 +a314f1c94374ab1f6633dd2983f7090a68663eb2 3.5.2-beta4 +1cfa86d604909dfdb8b372069ff61f9afaa2aac1 MAINT-2647 +895628bb5e162410cfdf4bca58f0a57d22ccfcde 3.5.2-beta5 diff --git a/BuildParams b/BuildParams index 1223db6981..863989724d 100755 --- a/BuildParams +++ b/BuildParams @@ -26,40 +26,36 @@ codeticket_since = 3.3.0-release Linux.gcc_version = /usr/bin/gcc-4.6 Linux.cxx_version = /usr/bin/g++-4.6 -# ======================================== -# Viewer Development -# ======================================== +################################################################ +#### Examples of how to set the viewer_channel #### +# +# To build a Release or Release candidate in build bingo: +# bingo.viewer_channel = "Second Life Release" +# +# To build a Beta for the 'Bingo' project in build bingo: +# bingo.viewer_channel = "Second Life Beta Bingo" +# +# To build a Project viewer for the 'Bingo' project in build bingo: +# bingo.viewer_channel = "Second Life Project Bingo" +# +# If left unset, viewer_channel defaults to 'Second Life Test', +# which is appropriate for individual developer builds. +# +# All Linden Lab builds (and only Linden Lab builds) +# should use a viewer_channel that begins with "Second Life" +################################################################ +viewer_channel = "Second Life Test" # Report changes since... viewer-development.show_changes_since = last_sprint # Build Settings -viewer-development_coverity.coverity_product = viewer -viewer-development_coverity.run_tests = false viewer-development.build_debug_release_separately = true # Notifications - to configure email notices, add a setting like this: # <username>_<reponame>.email = <email-address> - -# ================================================================= -# Canonical viewer integration builds - Oz Linden -# ================================================================= -integration_viewer-development.viewer_channel = "Second Life Development" -integration_viewer-development.login_channel = "Second Life Development" -integration_viewer-development.build_viewer_update_version_manager = false -integration_viewer-development.email = viewer-development-builds@lists.secondlife.com -integration_viewer-development.build_enforce_coding_policy = false -integration_viewer-development.codeticket_add_context = false - -viewer-beta.viewer_channel = "Second Life Beta Viewer" -viewer-beta.login_channel = "Second Life Beta Viewer" -viewer-beta.build_debug_release_separately = true -viewer-beta.build_viewer_update_version_manager = true -viewer-beta.codeticket_add_context = false - viewer-release.viewer_channel = "Second Life Release" -viewer-release.login_channel = "Second Life Release" viewer-release.build_debug_release_separately = true viewer-release.build_viewer_update_version_manager = true viewer-release.codeticket_add_context = false @@ -69,7 +65,6 @@ viewer-release.codeticket_add_context = false # mesh-development # ======================================== mesh-development.viewer_channel = "Project Viewer - Mesh" -mesh-development.login_channel = "Project Viewer - Mesh" mesh-development.viewer_grid = aditi mesh-development.build_debug_release_separately = true mesh-development.build_CYGWIN_Debug = false @@ -79,7 +74,6 @@ mesh-development.build_viewer_update_version_manager = false # mesh-development-release-1-candidate # ======================================== mesh-development-release-1-candidate.viewer_channel = "Project Viewer - Mesh" -mesh-development-release-1-candidate.login_channel = "Project Viewer - Mesh" mesh-development-release-1-candidate.viewer_grid = agni mesh-development-release-1-candidate.build_debug_release_separately = true mesh-development-release-1-candidate.build_CYGWIN_Debug = false @@ -89,7 +83,6 @@ mesh-development-release-1-candidate.build_viewer_update_version_manager = false # mesh-development-rc # ======================================== mesh-development-rc.viewer_channel = "Project Viewer - Mesh" -mesh-development-rc.login_channel = "Project Viewer - Mesh" mesh-development-rc.viewer_grid = agni mesh-development-rc.build_debug_release_separately = true mesh-development-rc.build_CYGWIN_Debug = false @@ -99,7 +92,6 @@ mesh-development-rc.build_viewer_update_version_manager = false # mesh-asset-deprecation # ======================================== mesh-asset-deprecation.viewer_channel = "Project Viewer - Mesh Asset Deprecation" -mesh-asset-deprecation.login_channel = "Project Viewer - Mesh Asset Deprecation" mesh-asset-deprecation.viewer_grid = aditi mesh-asset-deprecation.build_debug_release_separately = true mesh-asset-deprecation.build_CYGWIN_Debug = false @@ -117,7 +109,6 @@ viewer-mesh.build_viewer_update_version_manager = false viewer-mesh.build_Debug = false viewer-mesh.build_RelWithDebInfo = false viewer-mesh.viewer_channel = "Project Viewer - Mesh" -viewer-mesh.login_channel = "Project Viewer - Mesh" viewer-mesh.viewer_grid = aditi viewer-mesh.email = shining@lists.lindenlab.com @@ -126,7 +117,6 @@ viewer-mesh.email = shining@lists.lindenlab.com # ======================================== viewer-pathfinding.viewer_channel = "Project Viewer - Pathfinding" -viewer-pathfinding.login_channel = "Project Viewer - Pathfinding" viewer-pathfinding.viewer_grid = agni viewer-pathfinding.build_debug_release_separately = true viewer-pathfinding.build_CYGWIN_Debug = false @@ -157,14 +147,12 @@ viewer-chui.build_viewer_update_version_manager = false # asset delivery 2010 projects # ================================================================= viewer-asset-delivery.viewer_channel = "Second Life Development" -viewer-asset-delivery.login_channel = "Second Life Development" viewer-asset-delivery.build_viewer_update_version_manager = false viewer-asset-delivery.email = monty@lindenlab.com viewer-asset-delivery.build_server = false viewer-asset-delivery.build_server_tests = false viewer-asset-delivery-metrics.viewer_channel = "Second Life Development" -viewer-asset-delivery-metrics.login_channel = "Second Life Development" viewer-asset-delivery-metrics.build_viewer_update_version_manager = false viewer-asset-delivery-metrics.email = monty@lindenlab.com viewer-asset-delivery-metrics.build_server = false @@ -181,34 +169,29 @@ simon_viewer-dev-private.email_status_this_is_os = false # Vir # ======================================== vir-project-1.viewer_channel = "Second Life Release" -vir-project-1.login_channel = "Second Life Release" # ======================================== # THX-1138 / Runway projects # ======================================== viewer-thx1138-runway-shared.viewer_channel = "Project Viewer - THX-1138 Runway" -viewer-thx1138-runway-shared.login_channel = "Project Viewer - THX-1138 Runway" viewer-thx1138-runway-shared.viewer_grid = uma viewer-thx1138-runway-shared.build_debug_release_separately = true viewer-thx1138-runway-shared.build_CYGWIN_Debug = false viewer-thx1138-runway-shared.build_viewer_update_version_manager = false viewer-thx1138.viewer_channel = "Project Viewer - THX-1138" -viewer-thx1138.login_channel = "Project Viewer - THX-1138" viewer-thx1138.viewer_grid = uma viewer-thx1138.build_debug_release_separately = true viewer-thx1138.build_CYGWIN_Debug = false viewer-thx1138.build_viewer_update_version_manager = false runway-merge.viewer_channel = "Project Viewer - Runway Merge" -runway-merge.login_channel = "Project Viewer - Runway Merge" runway-merge.viewer_grid = agni runway-merge.build_debug_release_separately = true runway-merge.build_CYGWIN_Debug = false runway-merge.build_viewer_update_version_manager = false runway.viewer_channel = "Project Viewer - Runway" -runway.login_channel = "Project Viewer - Runway" runway.viewer_grid = agni runway.build_debug_release_separately = true runway.build_CYGWIN_Debug = false diff --git a/autobuild.xml b/autobuild.xml index 712094d607..f8138172b7 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -186,9 +186,9 @@ <key>archive</key> <map> <key>hash</key> - <string>ac37d0038c91b0672fa31a02731f0eac</string> + <string>06dd7af75e1eb179aed54fd58d8688af</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/268347/arch/Darwin/installer/boost-1.52.0-darwin-20121218.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/270698/arch/Darwin/installer/boost-1.52.0-darwin-20130221.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -198,9 +198,9 @@ <key>archive</key> <map> <key>hash</key> - <string>146ed8a8c2ef8ab3f0a6c4f214fc5c22</string> + <string>50c8b50b7cced52cc5656fb44e9b12cf</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/268347/arch/Linux/installer/boost-1.52.0-linux-20121218.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/270698/arch/Linux/installer/boost-1.52.0-linux-20130222.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -210,9 +210,9 @@ <key>archive</key> <map> <key>hash</key> - <string>3ea60f17d986b7e8a3351298734bdca4</string> + <string>742fc9675b033df7f9c6f215ff250f6c</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/268347/arch/CYGWIN/installer/boost-1.52.0-windows-20121218.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/270698/arch/CYGWIN/installer/boost-1.52.0-windows-20130221.tar.bz2</string> </map> <key>name</key> <string>windows</string> @@ -65,19 +65,16 @@ pre_build() && [ -r "$master_message_template_checkout/message_template.msg" ] \ && template_verifier_master_url="-DTEMPLATE_VERIFIER_MASTER_URL=file://$master_message_template_checkout/message_template.msg" - check_for "Before 'autobuild configure'" ${build_dir}/packages/dictionaries + check_for "Confirm dictionaries are installed before 'autobuild configure'" ${build_dir}/packages/dictionaries "$AUTOBUILD" configure -c $variant -- \ -DPACKAGE:BOOL=ON \ -DRELEASE_CRASH_REPORTING:BOOL=ON \ -DVIEWER_CHANNEL:STRING="\"$viewer_channel\"" \ - -DVIEWER_LOGIN_CHANNEL:STRING="\"$viewer_login_channel\"" \ -DGRID:STRING="\"$viewer_grid\"" \ -DLL_TESTS:BOOL="$run_tests" \ -DTEMPLATE_VERIFIER_OPTIONS:STRING="$template_verifier_options" $template_verifier_master_url - check_for "After 'autobuild configure'" ${build_dir}/packages/dictionaries - end_section "Pre$variant" } @@ -110,7 +107,6 @@ build() if $build_viewer then begin_section "Viewer$variant" - check_for "Before 'autobuild build'" ${build_dir}/packages/dictionaries "$AUTOBUILD" build --no-configure -c $variant build_ok=$? @@ -135,8 +131,6 @@ build() else echo false >"$build_dir"/build_ok fi - check_for "After 'autobuild configure'" ${build_dir}/packages/dictionaries - fi } @@ -171,21 +165,6 @@ fi # Check to see if we're skipping the platform eval '$build_'"$arch" || pass -# Run the version number update script -# File no longer exists in code-sep branch, so let's make sure it exists in order to use it. -if test -f scripts/update_version_files.py ; then - begin_section UpdateVer - eval $(python scripts/update_version_files.py \ - --channel="$viewer_channel" \ - --server_channel="$server_channel" \ - --revision=$revision \ - --verbose \ - | sed -n -e "s,Setting viewer channel/version: '\([^']*\)' / '\([^']*\)',VIEWER_CHANNEL='\1';VIEWER_VERSION='\2',p")\ - || fail update_version_files.py - echo "{\"Type\":\"viewer\",\"Version\":\"${VIEWER_VERSION}\"}" > summary.json - end_section UpdateVer -fi - if [ -z "$AUTOBUILD" ] then export autobuild_dir="$here/../../../autobuild/bin/" @@ -209,27 +188,11 @@ then fi # load autbuild provided shell functions and variables -# Merov: going back to the previous code that passes even if it fails catching a failure -# TODO: use the correct code here under and fix the llbase import in python code -#if "$AUTOBUILD" source_environment > source_environment -#then -# . source_environment -#else - # dump environment variables for debugging -# env|sort -# record_failure "autobuild source_environment failed" -# cat source_environment >&3 -# exit 1 -#fi eval "$("$AUTOBUILD" source_environment)" # dump environment variables for debugging env|sort -check_for "Before 'autobuild install'" ${build_dir}/packages/dictionaries - - -check_for "After 'autobuild install'" ${build_dir}/packages/dictionaries # Now run the build succeeded=true build_processes= @@ -403,7 +366,7 @@ then do upload_item symbolfile "$build_dir/$symbolfile" binary/octet-stream done - + # Upload the llphysicsextensions_tpv package, if one was produced # *TODO: Make this an upload-extension if [ -r "$build_dir/llphysicsextensions_package" ] diff --git a/doc/contributions.txt b/doc/contributions.txt index 33cf0a422e..26fbfe2bb0 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1070,10 +1070,12 @@ Sheet Spotter Shnurui Troughton Shyotl Kuhr MAINT-1138 + MAINT-2334 Siana Gearz STORM-960 STORM-1088 MAINT-1138 + MAINT-2334 sicarius Thorne Sicarius Toxx SignpostMarv Martin @@ -1091,6 +1093,8 @@ SLB Wirefly Slee Mayo SEC-1075 snowy Sidran +Sovereign Engineer + MAINT-2334 SpacedOut Frye VWR-34 VWR-45 @@ -1345,3 +1349,4 @@ Zoex Flanagan + diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index e06c928eb5..bdbfc55fa2 100755 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -3,14 +3,8 @@ # cmake_minimum_required should appear before any # other commands to guarantee full compatibility # with the version specified - -# The "cmake -E touch" command was released with 2.4.8. -cmake_minimum_required(VERSION 2.4.8 FATAL_ERROR) - -# This makes cmake 2.6 not complain about version 2.4 compatibility. -if (COMMAND cmake_policy) - cmake_policy(SET CMP0003 OLD) -endif (COMMAND cmake_policy) +## prior to 2.8, the add_custom_target commands used in setting the version did not work correctly +cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR) set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING "The root project/makefile/solution name. Defaults to SecondLife.") @@ -19,13 +13,7 @@ project(${ROOT_PROJECT_NAME}) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") include(Variables) - -if (DARWIN) - # 2.6.4 fixes a Mac bug in get_target_property(... "SLPlugin" LOCATION): - # before that version it returns "pathname/SLPlugin", whereas the correct - # answer is "pathname/SLPlugin.app/Contents/MacOS/SLPlugin". - cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR) -endif (DARWIN) +include(BuildVersion) if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING @@ -64,50 +52,49 @@ if (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts) endif (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts) add_custom_target(viewer) - add_subdirectory(${LIBS_OPEN_PREFIX}llcrashlogger) - add_subdirectory(${LIBS_OPEN_PREFIX}llplugin) - add_subdirectory(${LIBS_OPEN_PREFIX}llui) - add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components) +add_subdirectory(${LIBS_OPEN_PREFIX}llcrashlogger) +add_subdirectory(${LIBS_OPEN_PREFIX}llplugin) +add_subdirectory(${LIBS_OPEN_PREFIX}llui) +add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components) - # Legacy C++ tests. Build always, run if LL_TESTS is true. - add_subdirectory(${VIEWER_PREFIX}test) +# Legacy C++ tests. Build always, run if LL_TESTS is true. +add_subdirectory(${VIEWER_PREFIX}test) - # viewer media plugins - add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins) +# viewer media plugins +add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins) - # llplugin testbed code (is this the right way to include it?) - if (LL_TESTS AND NOT LINUX) - add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest) - endif (LL_TESTS AND NOT LINUX) +# llplugin testbed code (is this the right way to include it?) +if (LL_TESTS AND NOT LINUX) + add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest) +endif (LL_TESTS AND NOT LINUX) - if (LINUX) - add_subdirectory(${VIEWER_PREFIX}linux_crash_logger) +if (LINUX) + add_subdirectory(${VIEWER_PREFIX}linux_crash_logger) add_subdirectory(${VIEWER_PREFIX}linux_updater) if (INSTALL_PROPRIETARY) include(LLAppearanceUtility) add_subdirectory(${LLAPPEARANCEUTILITY_SRC_DIR} ${LLAPPEARANCEUTILITY_BIN_DIR}) endif (INSTALL_PROPRIETARY) add_dependencies(viewer linux-crash-logger-strip-target linux-updater) - elseif (DARWIN) - add_subdirectory(${VIEWER_PREFIX}mac_crash_logger) - add_subdirectory(${VIEWER_PREFIX}mac_updater) - add_dependencies(viewer mac-updater mac-crash-logger) - elseif (WINDOWS) - add_subdirectory(${VIEWER_PREFIX}win_crash_logger) - # cmake EXISTS requires an absolute path, see indra/cmake/Variables.cmake - if (EXISTS ${VIEWER_DIR}win_setup) - add_subdirectory(${VIEWER_DIR}win_setup) - endif (EXISTS ${VIEWER_DIR}win_setup) - add_subdirectory(${VIEWER_PREFIX}win_updater) - # add_dependencies(viewer windows-updater windows-setup windows-crash-logger) - add_dependencies(viewer windows-updater windows-crash-logger) - elseif (SOLARIS) - add_subdirectory(solaris_crash_logger) - add_dependencies(viewer solaris-crash-logger) - endif (LINUX) - - add_subdirectory(${VIEWER_PREFIX}newview) - add_dependencies(viewer secondlife-bin) +elseif (DARWIN) + add_subdirectory(${VIEWER_PREFIX}mac_crash_logger) + add_dependencies(viewer mac-crash-logger) +elseif (WINDOWS) + add_subdirectory(${VIEWER_PREFIX}win_crash_logger) + # cmake EXISTS requires an absolute path, see indra/cmake/Variables.cmake + if (EXISTS ${VIEWER_DIR}win_setup) + add_subdirectory(${VIEWER_DIR}win_setup) + endif (EXISTS ${VIEWER_DIR}win_setup) + add_subdirectory(${VIEWER_PREFIX}win_updater) + # add_dependencies(viewer windows-updater windows-setup windows-crash-logger) + add_dependencies(viewer windows-updater windows-crash-logger) +elseif (SOLARIS) + add_subdirectory(solaris_crash_logger) + add_dependencies(viewer solaris-crash-logger) +endif (LINUX) + +add_subdirectory(${VIEWER_PREFIX}newview) +add_dependencies(viewer secondlife-bin) if (LL_TESTS) # Define after the custom targets are created so diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index b969084632..472f271fa8 100755 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -153,21 +153,21 @@ if (LINUX) -pthread ) - add_definitions(-DAPPID=secondlife) - add_definitions(-fvisibility=hidden) - # don't catch SIGCHLD in our base application class for the viewer - some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The viewer doesn't need to catch SIGCHLD anyway. - add_definitions(-DLL_IGNORE_SIGCHLD) - if (WORD_SIZE EQUAL 32) - add_definitions(-march=pentium4) - endif (WORD_SIZE EQUAL 32) - add_definitions(-mfpmath=sse) - #add_definitions(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2 - if (NOT STANDALONE) - # this stops us requiring a really recent glibc at runtime - add_definitions(-fno-stack-protector) - # linking can be very memory-hungry, especially the final viewer link - set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory") - endif (NOT STANDALONE) + add_definitions(-DAPPID=secondlife) + add_definitions(-fvisibility=hidden) + # don't catch SIGCHLD in our base application class for the viewer - some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The viewer doesn't need to catch SIGCHLD anyway. + add_definitions(-DLL_IGNORE_SIGCHLD) + if (WORD_SIZE EQUAL 32) + add_definitions(-march=pentium4) + endif (WORD_SIZE EQUAL 32) + add_definitions(-mfpmath=sse) + #add_definitions(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2 + if (NOT STANDALONE) + # this stops us requiring a really recent glibc at runtime + add_definitions(-fno-stack-protector) + # linking can be very memory-hungry, especially the final viewer link + set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory") + endif (NOT STANDALONE) set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}") set(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE}") @@ -175,12 +175,7 @@ endif (LINUX) if (DARWIN) - # NOTE (per http://lists.apple.com/archives/darwin-dev/2008/Jan/msg00232.html): - # > Why the bus error? What am I doing wrong? - # This is a known issue where getcontext(3) is writing past the end of the - # ucontext_t struct when _XOPEN_SOURCE is not defined (rdar://problem/5578699 ). - # As a workaround, define _XOPEN_SOURCE before including ucontext.h. - add_definitions(-DLL_DARWIN=1 -D_XOPEN_SOURCE) + add_definitions(-DLL_DARWIN=1) set(CMAKE_CXX_LINK_FLAGS "-Wl,-no_compact_unwind -Wl,-headerpad_max_install_names,-search_paths_first") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}") set(DARWIN_extra_cstar_flags "-mlong-branch -g") diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 1acb2bbbfd..cff762e1f0 100755 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -7,11 +7,12 @@ set(Boost_FIND_REQUIRED ON) if (STANDALONE) include(FindBoost) + set(BOOST_CONTEXT_LIBRARY boost_context-mt) + set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt) set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) set(BOOST_REGEX_LIBRARY boost_regex-mt) set(BOOST_SIGNALS_LIBRARY boost_signals-mt) set(BOOST_SYSTEM_LIBRARY boost_system-mt) - set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt) set(BOOST_THREAD_LIBRARY boost_thread-mt) else (STANDALONE) use_prebuilt_binary(boost) @@ -20,6 +21,12 @@ else (STANDALONE) if (WINDOWS) if(MSVC80) + set(BOOST_CONTEXT_LIBRARY + optimized libboost_context-vc80-mt-${BOOST_VERSION} + debug libboost_context-vc80-mt-gd-${BOOST_VERSION}) + set(BOOST_FILESYSTEM_LIBRARY + optimized libboost_filesystem-vc80-mt-${BOOST_VERSION} + debug libboost_filesystem-vc80-mt-gd-${BOOST_VERSION}) set(BOOST_PROGRAM_OPTIONS_LIBRARY optimized libboost_program_options-vc80-mt-${BOOST_VERSION} debug libboost_program_options-vc80-mt-gd-${BOOST_VERSION}) @@ -32,59 +39,74 @@ else (STANDALONE) set(BOOST_SYSTEM_LIBRARY optimized libboost_system-vc80-mt-${BOOST_VERSION} debug libboost_system-vc80-mt-gd-${BOOST_VERSION}) - set(BOOST_FILESYSTEM_LIBRARY - optimized libboost_filesystem-vc80-mt-${BOOST_VERSION} - debug libboost_filesystem-vc80-mt-gd-${BOOST_VERSION}) + set(BOOST_THREAD_LIBRARY + optimized libboost_thread-vc80-mt-${BOOST_VERSION} + debug libboost_thread-vc80-mt-gd-${BOOST_VERSION}) else(MSVC80) # MSVC 10.0 config + set(BOOST_CONTEXT_LIBRARY + optimized libboost_context-mt + debug libboost_context-mt-gd) + set(BOOST_FILESYSTEM_LIBRARY + optimized libboost_filesystem-mt + debug libboost_filesystem-mt-gd) set(BOOST_PROGRAM_OPTIONS_LIBRARY optimized libboost_program_options-mt debug libboost_program_options-mt-gd) set(BOOST_REGEX_LIBRARY optimized libboost_regex-mt debug libboost_regex-mt-gd) + set(BOOST_SIGNALS_LIBRARY + optimized libboost_signals-mt + debug libboost_signals-mt-gd) set(BOOST_SYSTEM_LIBRARY optimized libboost_system-mt debug libboost_system-mt-gd) - set(BOOST_FILESYSTEM_LIBRARY - optimized libboost_filesystem-mt - debug libboost_filesystem-mt-gd) set(BOOST_THREAD_LIBRARY optimized libboost_thread-mt debug libboost_thread-mt-gd) endif (MSVC80) elseif (LINUX) + set(BOOST_CONTEXT_LIBRARY + optimized boost_context-mt + debug boost_context-mt-d) + set(BOOST_FILESYSTEM_LIBRARY + optimized boost_filesystem-mt + debug boost_filesystem-mt-d) set(BOOST_PROGRAM_OPTIONS_LIBRARY optimized boost_program_options-mt debug boost_program_options-mt-d) set(BOOST_REGEX_LIBRARY optimized boost_regex-mt debug boost_regex-mt-d) + set(BOOST_SIGNALS_LIBRARY + optimized boost_signals-mt + debug boost_signals-mt-d) set(BOOST_SYSTEM_LIBRARY optimized boost_system-mt debug boost_system-mt-d) - set(BOOST_FILESYSTEM_LIBRARY - optimized boost_filesystem-mt - debug boost_filesystem-mt-d) set(BOOST_THREAD_LIBRARY optimized boost_thread-mt debug boost_thread-mt-d) elseif (DARWIN) - set(BOOST_PROGRAM_OPTIONS_LIBRARY - optimized boost_program_options-mt - debug boost_program_options-mt-d) + set(BOOST_CONTEXT_LIBRARY + optimized boost_context-mt + debug boost_context-mt-d) + set(BOOST_FILESYSTEM_LIBRARY + optimized boost_filesystem-mt + debug boost_filesystem-mt-d) set(BOOST_PROGRAM_OPTIONS_LIBRARY optimized boost_program_options-mt debug boost_program_options-mt-d) set(BOOST_REGEX_LIBRARY optimized boost_regex-mt debug boost_regex-mt-d) + set(BOOST_SIGNALS_LIBRARY + optimized boost_signals-mt + debug boost_signals-mt-d) set(BOOST_SYSTEM_LIBRARY optimized boost_system-mt debug boost_system-mt-d) - set(BOOST_FILESYSTEM_LIBRARY - optimized boost_filesystem-mt - debug boost_filesystem-mt-d) set(BOOST_THREAD_LIBRARY optimized boost_thread-mt debug boost_thread-mt-d) diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index 60a519c9af..c494355746 100755 --- a/indra/cmake/BuildVersion.cmake +++ b/indra/cmake/BuildVersion.cmake @@ -1,18 +1,48 @@ # -*- cmake -*- +# Construct the viewer version number based on the indra/VIEWER_VERSION file -include(Python) +if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/newview/ + set(VIEWER_VERSION_BASE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/newview/VIEWER_VERSION.txt") -macro (build_version _target) - execute_process( - COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/build_version.py - llversion${_target}.h ${LLCOMMON_INCLUDE_DIRS} - OUTPUT_VARIABLE ${_target}_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE - ) + if ( EXISTS ${VIEWER_VERSION_BASE_FILE} ) + file(STRINGS ${VIEWER_VERSION_BASE_FILE} VIEWER_SHORT_VERSION REGEX "^[0-9]+\\.[0-9]+\\.[0-9]+") + string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" VIEWER_VERSION_MAJOR ${VIEWER_SHORT_VERSION}) + string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" VIEWER_VERSION_MINOR ${VIEWER_SHORT_VERSION}) + string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" VIEWER_VERSION_PATCH ${VIEWER_SHORT_VERSION}) - if (${_target}_VERSION) - message(STATUS "Version of ${_target} is ${${_target}_VERSION}") - else (${_target}_VERSION) - message(SEND_ERROR "Could not determine ${_target} version") - endif (${_target}_VERSION) -endmacro (build_version) + if (DEFINED ENV{revision}) + set(VIEWER_VERSION_REVISION $ENV{revision}) + message("Revision (from environment): ${VIEWER_VERSION_REVISION}") + + else (DEFINED ENV{revision}) + find_program(MERCURIAL hg) + if (DEFINED MERCURIAL) + execute_process( + COMMAND ${MERCURIAL} parents --template "{rev}" + OUTPUT_VARIABLE VIEWER_VERSION_REVISION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if (DEFINED VIEWER_VERSION_REVISION) + message("Revision (from hg) ${VIEWER_VERSION_REVISION}") + else (DEFINED VIEWER_VERSION_REVISION) + set(VIEWER_VERSION_REVISION 0 ) + message("Revision not set, repository not found, using ${VIEWER_VERSION_REVISION}") + endif (DEFINED VIEWER_VERSION_REVISION) + else (DEFINED MERCURIAL) + set(VIEWER_VERSION_REVISION 0) + message("Revision not set, 'hg' not found (${MERCURIAL}), using ${VIEWER_VERSION_REVISION}") + endif (DEFINED MERCURIAL) + endif (DEFINED ENV{revision}) + message("Building '${VIEWER_CHANNEL}' Version ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") + else ( EXISTS ${VIEWER_VERSION_BASE_FILE} ) + message(SEND_ERROR "Cannot get viewer version from '${VIEWER_VERSION_BASE_FILE}'") + endif ( EXISTS ${VIEWER_VERSION_BASE_FILE} ) + + set(VIEWER_CHANNEL_VERSION_DEFINES + "LL_VIEWER_CHANNEL=\"${VIEWER_CHANNEL}\"" + "LL_VIEWER_VERSION_MAJOR=${VIEWER_VERSION_MAJOR}" + "LL_VIEWER_VERSION_MINOR=${VIEWER_VERSION_MINOR}" + "LL_VIEWER_VERSION_PATCH=${VIEWER_VERSION_PATCH}" + "LL_VIEWER_VERSION_BUILD=${VIEWER_VERSION_REVISION}" + ) +endif (NOT DEFINED VIEWER_SHORT_VERSION) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index a03c1a4281..29ab4b1710 100755 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -221,8 +221,10 @@ elseif(DARWIN) libcollada14dom.dylib ) - # fmod is statically linked on darwin - set(fmod_files "") + if (FMODEX) + set(debug_files ${debug_files} libfmodexL.dylib) + set(release_files ${release_files} libfmodex.dylib) + endif (FMODEX) elseif(LINUX) # linux is weird, multiple side by side configurations aren't supported @@ -253,12 +255,13 @@ elseif(LINUX) libapr-1.so.0 libaprutil-1.so.0 libatk-1.0.so + libboost_context-mt.so.${BOOST_VERSION}.0 + libboost_filesystem-mt.so.${BOOST_VERSION}.0 libboost_program_options-mt.so.${BOOST_VERSION}.0 libboost_regex-mt.so.${BOOST_VERSION}.0 - libboost_thread-mt.so.${BOOST_VERSION}.0 - libboost_filesystem-mt.so.${BOOST_VERSION}.0 libboost_signals-mt.so.${BOOST_VERSION}.0 libboost_system-mt.so.${BOOST_VERSION}.0 + libboost_thread-mt.so.${BOOST_VERSION}.0 libcollada14dom.so libcrypto.so.1.0.0 libdb-5.1.so @@ -365,30 +368,6 @@ copy_if_different( ) set(third_party_targets ${third_party_targets} ${out_targets}) -if (FMOD_SDK_DIR) - copy_if_different( - ${FMOD_SDK_DIR} - "${CMAKE_CURRENT_BINARY_DIR}/Debug" - out_targets - ${fmod_files} - ) - set(all_targets ${all_targets} ${out_targets}) - copy_if_different( - ${FMOD_SDK_DIR} - "${CMAKE_CURRENT_BINARY_DIR}/Release" - out_targets - ${fmod_files} - ) - set(all_targets ${all_targets} ${out_targets}) - copy_if_different( - ${FMOD_SDK_DIR} - "${CMAKE_CURRENT_BINARY_DIR}/RelWithDbgInfo" - out_targets - ${fmod_files} - ) - set(all_targets ${all_targets} ${out_targets}) -endif (FMOD_SDK_DIR) - if(NOT STANDALONE) add_custom_target( stage_third_party_libs ALL diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 6ec621632b..7c310ba9c3 100755 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -170,8 +170,7 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Default deploy grid set(GRID agni CACHE STRING "Target Grid") -set(VIEWER_CHANNEL "LindenDeveloper" CACHE STRING "Viewer Channel Name") -set(VIEWER_LOGIN_CHANNEL ${VIEWER_CHANNEL} CACHE STRING "Fake login channel for A/B Testing") +set(VIEWER_CHANNEL "Second Life Test" CACHE STRING "Viewer Channel Name") if (XCODE_VERSION GREATER 4.2) set(ENABLE_SIGNING OFF CACHE BOOL "Enable signing the viewer") diff --git a/indra/edit-me-to-trigger-new-build.txt b/indra/edit-me-to-trigger-new-build.txt index 0f6a8b8a1d..e003ed7788 100755 --- a/indra/edit-me-to-trigger-new-build.txt +++ b/indra/edit-me-to-trigger-new-build.txt @@ -1 +1,5 @@ Wed Nov 7 00:25:19 UTC 2012 + + + + diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py index 97cc31bba0..9cb830a2db 100755 --- a/indra/lib/python/indra/util/llmanifest.py +++ b/indra/lib/python/indra/util/llmanifest.py @@ -84,30 +84,8 @@ def get_default_platform(dummy): 'darwin':'darwin' }[sys.platform] -def get_default_version(srctree): - # look up llversion.h and parse out the version info - paths = [os.path.join(srctree, x, 'llversionviewer.h') for x in ['llcommon', '../llcommon', '../../indra/llcommon.h']] - for p in paths: - if os.path.exists(p): - contents = open(p, 'r').read() - major = re.search("LL_VERSION_MAJOR\s=\s([0-9]+)", contents).group(1) - minor = re.search("LL_VERSION_MINOR\s=\s([0-9]+)", contents).group(1) - patch = re.search("LL_VERSION_PATCH\s=\s([0-9]+)", contents).group(1) - build = re.search("LL_VERSION_BUILD\s=\s([0-9]+)", contents).group(1) - return major, minor, patch, build - -def get_channel(srctree): - # look up llversionserver.h and parse out the version info - paths = [os.path.join(srctree, x, 'llversionviewer.h') for x in ['llcommon', '../llcommon', '../../indra/llcommon.h']] - for p in paths: - if os.path.exists(p): - contents = open(p, 'r').read() - channel = re.search("LL_CHANNEL\s=\s\"(.+)\";\s*$", contents, flags = re.M).group(1) - return channel - - DEFAULT_SRCTREE = os.path.dirname(sys.argv[0]) -DEFAULT_CHANNEL = 'Second Life Release' +RELEASE_CHANNEL = 'Second Life Release' ARGUMENTS=[ dict(name='actions', @@ -140,10 +118,7 @@ ARGUMENTS=[ default=""), dict(name='channel', description="""The channel to use for updates, packaging, settings name, etc.""", - default=get_channel), - dict(name='login_channel', - description="""The channel to use for login handshake/updates only.""", - default=None), + default='CHANNEL UNSET'), dict(name='installer_name', description=""" The name of the file that the installer should be packaged up into. Only used on Linux at the moment.""", @@ -164,10 +139,8 @@ ARGUMENTS=[ contain the name of the final package in a form suitable for use by a .bat file.""", default=None), - dict(name='version', - description="""This specifies the version of Second Life that is - being packaged up.""", - default=get_default_version), + dict(name='versionfile', + description="""The name of a file containing the full version number."""), dict(name='signature', description="""This specifies an identity to sign the viewer with, if any. If no value is supplied, the default signature will be used, if any. Currently @@ -232,9 +205,14 @@ def main(): args[arg['name']] = default # fix up version - if isinstance(args.get('version'), str): - args['version'] = args['version'].split('.') - + if isinstance(args.get('versionfile'), str): + try: # read in the version string + vf = open(args['versionfile'], 'r') + args['version'] = vf.read().strip().split('.') + except: + print "Unable to read versionfile '%s'" % args['versionfile'] + raise + # default and agni are default if args['grid'] in ['default', 'agni']: args['grid'] = '' @@ -291,7 +269,7 @@ class LLManifest(object): def default_grid(self): return self.args.get('grid', None) == '' def default_channel(self): - return self.args.get('channel', None) == DEFAULT_CHANNEL + return self.args.get('channel', None) == RELEASE_CHANNEL def construct(self): """ Meant to be overriden by LLManifest implementors with code that diff --git a/indra/llaudio/llaudioengine_fmodex.cpp b/indra/llaudio/llaudioengine_fmodex.cpp index 5ec30c7d1d..c2c3648ae8 100644 --- a/indra/llaudio/llaudioengine_fmodex.cpp +++ b/indra/llaudio/llaudioengine_fmodex.cpp @@ -305,8 +305,11 @@ void LLAudioEngine_FMODEX::shutdown() LLAudioEngine::shutdown(); llinfos << "LLAudioEngine_FMODEX::shutdown() closing FMOD Ex" << llendl; + if ( mSystem ) // speculative fix for MAINT-2657 + { mSystem->close(); mSystem->release(); + } llinfos << "LLAudioEngine_FMODEX::shutdown() done closing FMOD Ex" << llendl; delete mListenerp; diff --git a/indra/llaudio/llstreamingaudio_fmodex.cpp b/indra/llaudio/llstreamingaudio_fmodex.cpp index 266fa2f57b..42f30aa1c4 100644 --- a/indra/llaudio/llstreamingaudio_fmodex.cpp +++ b/indra/llaudio/llstreamingaudio_fmodex.cpp @@ -310,7 +310,7 @@ LLAudioStreamManagerFMODEX::LLAudioStreamManagerFMODEX(FMOD::System *system, con { mInternetStreamURL = url; - FMOD_RESULT result = mSystem->createStream(url.c_str(), FMOD_2D | FMOD_NONBLOCKING | FMOD_MPEGSEARCH | FMOD_IGNORETAGS, 0, &mInternetStream); + FMOD_RESULT result = mSystem->createStream(url.c_str(), FMOD_2D | FMOD_NONBLOCKING | FMOD_IGNORETAGS, 0, &mInternetStream); if (result!= FMOD_OK) { diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 3e57280067..95b1d536fe 100755 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -247,7 +247,6 @@ set(llcommon_HEADER_FILES lluuid.h lluuidhashmap.h llversionserver.h - llversionviewer.h llworkerthread.h ll_template_cast.h metaclass.h diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h index 034546c3f3..752574c65d 100755 --- a/indra/llcommon/llapr.h +++ b/indra/llcommon/llapr.h @@ -182,8 +182,10 @@ typedef LLAtomic32<S32> LLAtomicS32; // abbreviated flags #define LL_APR_R (APR_READ) // "r" #define LL_APR_W (APR_CREATE|APR_TRUNCATE|APR_WRITE) // "w" +#define LL_APR_A (APR_CREATE|APR_WRITE|APR_APPEND) // "w" #define LL_APR_RB (APR_READ|APR_BINARY) // "rb" #define LL_APR_WB (APR_CREATE|APR_TRUNCATE|APR_WRITE|APR_BINARY) // "wb" +#define LL_APR_AB (APR_CREATE|APR_WRITE|APR_BINARY|APR_APPEND) #define LL_APR_RPB (APR_READ|APR_WRITE|APR_BINARY) // "r+b" #define LL_APR_WPB (APR_CREATE|APR_TRUNCATE|APR_READ|APR_WRITE|APR_BINARY) // "w+b" diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index 0b5829eb7e..9122704306 100755 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -115,7 +115,7 @@ std::string LLCoros::getNameByID(const void* self_id) const // passed to us comes. for (CoroMap::const_iterator mi(mCoros.begin()), mend(mCoros.end()); mi != mend; ++mi) { - namespace coro_private = boost::coroutines::detail; + namespace coro_private = boost::dcoroutines::detail; if (static_cast<void*>(coro_private::coroutine_accessor::get_impl(const_cast<coro&>(*mi->second)).get()) == self_id) { diff --git a/indra/llcommon/llcoros.h b/indra/llcommon/llcoros.h index d75f28ec1a..03df406b68 100755 --- a/indra/llcommon/llcoros.h +++ b/indra/llcommon/llcoros.h @@ -29,7 +29,7 @@ #if ! defined(LL_LLCOROS_H) #define LL_LLCOROS_H -#include <boost/coroutine/coroutine.hpp> +#include <boost/dcoroutine/coroutine.hpp> #include "llsingleton.h" #include <boost/ptr_container/ptr_map.hpp> #include <string> @@ -78,8 +78,8 @@ class LL_COMMON_API LLCoros: public LLSingleton<LLCoros> { public: - /// Canonical boost::coroutines::coroutine signature we use - typedef boost::coroutines::coroutine<void()> coro; + /// Canonical boost::dcoroutines::coroutine signature we use + typedef boost::dcoroutines::coroutine<void()> coro; /// Canonical 'self' type typedef coro::self self; diff --git a/indra/llcommon/lleventcoro.h b/indra/llcommon/lleventcoro.h index 88a5e6ec74..a42af63b65 100755 --- a/indra/llcommon/lleventcoro.h +++ b/indra/llcommon/lleventcoro.h @@ -29,8 +29,8 @@ #if ! defined(LL_LLEVENTCORO_H) #define LL_LLEVENTCORO_H -#include <boost/coroutine/coroutine.hpp> -#include <boost/coroutine/future.hpp> +#include <boost/dcoroutine/coroutine.hpp> +#include <boost/dcoroutine/future.hpp> #include <boost/optional.hpp> #include <string> #include <stdexcept> @@ -206,13 +206,13 @@ LLSD postAndWait(SELF& self, const LLSD& event, const LLEventPumpOrPumpName& req const LLEventPumpOrPumpName& replyPump, const LLSD& replyPumpNamePath=LLSD()) { // declare the future - boost::coroutines::future<LLSD> future(self); + boost::dcoroutines::future<LLSD> future(self); // make a callback that will assign a value to the future, and listen on // the specified LLEventPump with that callback std::string listenerName(LLEventDetail::listenerNameForCoro(self)); LLTempBoundListener connection( replyPump.getPump().listen(listenerName, - voidlistener(boost::coroutines::make_callback(future)))); + voidlistener(boost::dcoroutines::make_callback(future)))); // skip the "post" part if requestPump is default-constructed if (requestPump) { @@ -257,7 +257,7 @@ namespace LLEventDetail * This helper is specifically for the two-pump version of waitForEventOn(). * We use a single future object, but we want to listen on two pumps with it. * Since we must still adapt from (the callable constructed by) - * boost::coroutines::make_callback() (void return) to provide an event + * boost::dcoroutines::make_callback() (void return) to provide an event * listener (bool return), we've adapted LLVoidListener for the purpose. The * basic idea is that we construct a distinct instance of WaitForEventOnHelper * -- binding different instance data -- for each of the pumps. Then, when a @@ -331,16 +331,16 @@ LLEventWithID postAndWait2(SELF& self, const LLSD& event, const LLSD& replyPump1NamePath=LLSD()) { // declare the future - boost::coroutines::future<LLEventWithID> future(self); + boost::dcoroutines::future<LLEventWithID> future(self); // either callback will assign a value to this future; listen on // each specified LLEventPump with a callback std::string name(LLEventDetail::listenerNameForCoro(self)); LLTempBoundListener connection0( replyPump0.getPump().listen(name + "a", - LLEventDetail::wfeoh(boost::coroutines::make_callback(future), 0))); + LLEventDetail::wfeoh(boost::dcoroutines::make_callback(future), 0))); LLTempBoundListener connection1( replyPump1.getPump().listen(name + "b", - LLEventDetail::wfeoh(boost::coroutines::make_callback(future), 1))); + LLEventDetail::wfeoh(boost::dcoroutines::make_callback(future), 1))); // skip the "post" part if requestPump is default-constructed if (requestPump) { diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index c96f2191f3..57a6de9060 100755 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -80,6 +80,7 @@ using namespace llsd; # include <sys/sysinfo.h> # include <stdexcept> const char MEMINFO_FILE[] = "/proc/meminfo"; +# include <gnu/libc-version.h> #elif LL_SOLARIS # include <stdio.h> # include <unistd.h> @@ -175,8 +176,41 @@ bool get_shell32_dll_version(DWORD& major, DWORD& minor, DWORD& build_number) } #endif // LL_WINDOWS +// Wrap boost::regex_match() with a function that doesn't throw. +template <typename S, typename M, typename R> +static bool regex_match_no_exc(const S& string, M& match, const R& regex) +{ + try + { + return boost::regex_match(string, match, regex); + } + catch (const std::runtime_error& e) + { + LL_WARNS("LLMemoryInfo") << "error matching with '" << regex.str() << "': " + << e.what() << ":\n'" << string << "'" << LL_ENDL; + return false; + } +} + +// Wrap boost::regex_search() with a function that doesn't throw. +template <typename S, typename M, typename R> +static bool regex_search_no_exc(const S& string, M& match, const R& regex) +{ + try + { + return boost::regex_search(string, match, regex); + } + catch (const std::runtime_error& e) + { + LL_WARNS("LLMemoryInfo") << "error searching with '" << regex.str() << "': " + << e.what() << ":\n'" << string << "'" << LL_ENDL; + return false; + } +} + + LLOSInfo::LLOSInfo() : - mMajorVer(0), mMinorVer(0), mBuild(0) + mMajorVer(0), mMinorVer(0), mBuild(0), mOSVersionString("") { #if LL_WINDOWS @@ -412,6 +446,102 @@ LLOSInfo::LLOSInfo() : mOSString = mOSStringSimple; } +#elif LL_LINUX + + struct utsname un; + if(uname(&un) != -1) + { + mOSStringSimple.append(un.sysname); + mOSStringSimple.append(" "); + mOSStringSimple.append(un.release); + + mOSString = mOSStringSimple; + mOSString.append(" "); + mOSString.append(un.version); + mOSString.append(" "); + mOSString.append(un.machine); + + // Simplify 'Simple' + std::string ostype = mOSStringSimple.substr(0, mOSStringSimple.find_first_of(" ", 0)); + if (ostype == "Linux") + { + // Only care about major and minor Linux versions, truncate at second '.' + std::string::size_type idx1 = mOSStringSimple.find_first_of(".", 0); + std::string::size_type idx2 = (idx1 != std::string::npos) ? mOSStringSimple.find_first_of(".", idx1+1) : std::string::npos; + std::string simple = mOSStringSimple.substr(0, idx2); + if (simple.length() > 0) + mOSStringSimple = simple; + } + } + else + { + mOSStringSimple.append("Unable to collect OS info"); + mOSString = mOSStringSimple; + } + + const char OS_VERSION_MATCH_EXPRESSION[] = "([0-9]+)\\.([0-9]+)(\\.([0-9]+))?"; + boost::regex os_version_parse(OS_VERSION_MATCH_EXPRESSION); + boost::smatch matched; + + std::string glibc_version(gnu_get_libc_version()); + if ( regex_match_no_exc(glibc_version, matched, os_version_parse) ) + { + LL_INFOS("AppInit") << "Using glibc version '" << glibc_version << "' as OS version" << LL_ENDL; + + std::string version_value; + + if ( matched[1].matched ) // Major version + { + version_value.assign(matched[1].first, matched[1].second); + if (sscanf(version_value.c_str(), "%d", &mMajorVer) != 1) + { + LL_WARNS("AppInit") << "failed to parse major version '" << version_value << "' as a number" << LL_ENDL; + } + } + else + { + LL_ERRS("AppInit") + << "OS version regex '" << OS_VERSION_MATCH_EXPRESSION + << "' returned true, but major version [1] did not match" + << LL_ENDL; + } + + if ( matched[2].matched ) // Minor version + { + version_value.assign(matched[2].first, matched[2].second); + if (sscanf(version_value.c_str(), "%d", &mMinorVer) != 1) + { + LL_ERRS("AppInit") << "failed to parse minor version '" << version_value << "' as a number" << LL_ENDL; + } + } + else + { + LL_ERRS("AppInit") + << "OS version regex '" << OS_VERSION_MATCH_EXPRESSION + << "' returned true, but minor version [1] did not match" + << LL_ENDL; + } + + if ( matched[4].matched ) // Build version (optional) - note that [3] includes the '.' + { + version_value.assign(matched[4].first, matched[4].second); + if (sscanf(version_value.c_str(), "%d", &mBuild) != 1) + { + LL_ERRS("AppInit") << "failed to parse build version '" << version_value << "' as a number" << LL_ENDL; + } + } + else + { + LL_INFOS("AppInit") + << "OS build version not provided; using zero" + << LL_ENDL; + } + } + else + { + LL_WARNS("AppInit") << "glibc version '" << glibc_version << "' cannot be parsed to three numbers; using all zeros" << LL_ENDL; + } + #else struct utsname un; @@ -444,8 +574,13 @@ LLOSInfo::LLOSInfo() : mOSStringSimple.append("Unable to collect OS info"); mOSString = mOSStringSimple; } + #endif + std::stringstream dotted_version_string; + dotted_version_string << mMajorVer << "." << mMinorVer << "." << mBuild; + mOSVersionString.append(dotted_version_string.str()); + } #ifndef LL_WINDOWS @@ -496,6 +631,11 @@ const std::string& LLOSInfo::getOSStringSimple() const return mOSStringSimple; } +const std::string& LLOSInfo::getOSVersionString() const +{ + return mOSVersionString; +} + const S32 STATUS_SIZE = 8192; //static @@ -687,38 +827,6 @@ private: LLSD mStats; }; -// Wrap boost::regex_match() with a function that doesn't throw. -template <typename S, typename M, typename R> -static bool regex_match_no_exc(const S& string, M& match, const R& regex) -{ - try - { - return boost::regex_match(string, match, regex); - } - catch (const std::runtime_error& e) - { - LL_WARNS("LLMemoryInfo") << "error matching with '" << regex.str() << "': " - << e.what() << ":\n'" << string << "'" << LL_ENDL; - return false; - } -} - -// Wrap boost::regex_search() with a function that doesn't throw. -template <typename S, typename M, typename R> -static bool regex_search_no_exc(const S& string, M& match, const R& regex) -{ - try - { - return boost::regex_search(string, match, regex); - } - catch (const std::runtime_error& e) - { - LL_WARNS("LLMemoryInfo") << "error searching with '" << regex.str() << "': " - << e.what() << ":\n'" << string << "'" << LL_ENDL; - return false; - } -} - LLMemoryInfo::LLMemoryInfo() { refresh(); diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h index 739e795d3a..cfed0fff17 100755 --- a/indra/llcommon/llsys.h +++ b/indra/llcommon/llsys.h @@ -49,6 +49,8 @@ public: const std::string& getOSString() const; const std::string& getOSStringSimple() const; + const std::string& getOSVersionString() const; + S32 mMajorVer; S32 mMinorVer; S32 mBuild; @@ -62,6 +64,7 @@ public: private: std::string mOSString; std::string mOSStringSimple; + std::string mOSVersionString; }; diff --git a/indra/llcommon/tests/lleventcoro_test.cpp b/indra/llcommon/tests/lleventcoro_test.cpp index 901ba35b2f..8d12529613 100755 --- a/indra/llcommon/tests/lleventcoro_test.cpp +++ b/indra/llcommon/tests/lleventcoro_test.cpp @@ -64,10 +64,10 @@ // Boost.Coroutine #include is the *first* #include of the platform header. // That means that client code must generally #include Boost.Coroutine headers // before anything else. -#include <boost/coroutine/coroutine.hpp> +#include <boost/dcoroutine/coroutine.hpp> // Normally, lleventcoro.h obviates future.hpp. We only include this because // we implement a "by hand" test of future functionality. -#include <boost/coroutine/future.hpp> +#include <boost/dcoroutine/future.hpp> #include <boost/bind.hpp> #include <boost/range.hpp> @@ -87,7 +87,7 @@ /***************************************************************************** * from the banana.cpp example program borrowed for test<1>() *****************************************************************************/ -namespace coroutines = boost::coroutines; +namespace coroutines = boost::dcoroutines; using coroutines::coroutine; template<typename Iter> @@ -122,7 +122,7 @@ typedef coroutine<std::string::iterator(void)> match_coroutine_type; * Test helpers *****************************************************************************/ // I suspect this will be typical of coroutines used in Linden software -typedef boost::coroutines::coroutine<void()> coroutine_type; +typedef boost::dcoroutines::coroutine<void()> coroutine_type; /// Simulate an event API whose response is immediate: sent on receipt of the /// initial request, rather than after some delay. This is the case that @@ -173,10 +173,10 @@ namespace tut // ... do whatever preliminary stuff must happen ... // declare the future - boost::coroutines::future<LLSD> future(self); + boost::dcoroutines::future<LLSD> future(self); // tell the future what to wait for LLTempBoundListener connection( - LLEventPumps::instance().obtain("source").listen("coro", voidlistener(boost::coroutines::make_callback(future)))); + LLEventPumps::instance().obtain("source").listen("coro", voidlistener(boost::dcoroutines::make_callback(future)))); ensure("Not yet", ! future); // attempting to dereference ("resolve") the future causes the calling // coroutine to wait for it diff --git a/indra/lscript/lscript_byteformat.h b/indra/lscript/lscript_byteformat.h index a294def734..54031aaf05 100755 --- a/indra/lscript/lscript_byteformat.h +++ b/indra/lscript/lscript_byteformat.h @@ -530,6 +530,10 @@ typedef enum e_lscript_runtime_permissions SCRIPT_PERMISSION_TRACK_CAMERA, SCRIPT_PERMISSION_CONTROL_CAMERA, SCRIPT_PERMISSION_TELEPORT, + SCRIPT_PERMISSION_EXPERIENCE, + SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT, + SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS, + SCRIPT_PERMISSION_RETURN_OBJECTS, SCRIPT_PERMISSION_EOF } LSCRIPTRunTimePermissions; @@ -547,6 +551,10 @@ const U32 LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_EOF] = (0x1 << 10),// SCRIPT_PERMISSION_TRACK_CAMERA (0x1 << 11),// SCRIPT_PERMISSION_CONTROL_CAMERA (0x1 << 12),// SCRIPT_PERMISSION_TELEPORT + (0x1 << 13),// SCRIPT_PERMISSION_EXPERIENCE, + (0x1 << 14),// SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT, + (0x1 << 15),// SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS, + (0x1 << 16),// SCRIPT_PERMISSION_RETURN_OBJECTS, }; // http_request string constants diff --git a/indra/mac_updater/AutoUpdater.nib/classes.nib b/indra/mac_updater/AutoUpdater.nib/classes.nib deleted file mode 100755 index ea58db1189..0000000000 --- a/indra/mac_updater/AutoUpdater.nib/classes.nib +++ /dev/null @@ -1,4 +0,0 @@ -{ -IBClasses = (); -IBVersion = 1; -} diff --git a/indra/mac_updater/AutoUpdater.nib/info.nib b/indra/mac_updater/AutoUpdater.nib/info.nib deleted file mode 100755 index a49a92385b..0000000000 --- a/indra/mac_updater/AutoUpdater.nib/info.nib +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>IBDocumentLocation</key> - <string>103 138 356 240 0 0 1280 1002 </string> - <key>IBFramework Version</key> - <string>362.0</string> - <key>IBSystem Version</key> - <string>7D24</string> - <key>targetFramework</key> - <string>IBCarbonFramework</string> -</dict> -</plist> diff --git a/indra/mac_updater/AutoUpdater.nib/objects.xib b/indra/mac_updater/AutoUpdater.nib/objects.xib deleted file mode 100755 index 310411b711..0000000000 --- a/indra/mac_updater/AutoUpdater.nib/objects.xib +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" standalone="yes"?> -<object class="NSIBObjectData"> - <string name="targetFramework">IBCarbonFramework</string> - <object name="rootObject" class="NSCustomObject" id="1"> - <string name="customClass">NSApplication</string> - </object> - <array count="5" name="allObjects"> - <object class="IBCarbonWindow" id="166"> - <string name="windowRect">405 222 533 663 </string> - <string name="title">Second Life Updater</string> - <object name="rootControl" class="IBCarbonRootControl" id="167"> - <string name="bounds">0 0 128 441 </string> - <array count="3" name="subviews"> - <object class="IBCarbonStaticText" id="181"> - <string name="bounds">20 20 44 421 </string> - <ostype name="controlSignature">what</ostype> - <string name="title">Initializing…</string> - </object> - <object class="IBCarbonButton" id="183"> - <string name="bounds">88 351 108 421 </string> - <string name="title">Cancel</string> - <ostype name="command">not!</ostype> - <int name="buttonType">2</int> - </object> - <object class="IBCarbonProgressBar" id="193"> - <string name="bounds">51 19 70 422 </string> - <ostype name="controlSignature">prog</ostype> - <int name="initialValue">50</int> - </object> - </array> - </object> - <boolean name="isResizable">FALSE</boolean> - <int name="carbonWindowClass">2</int> - <int name="themeBrush">3</int> - <int name="windowPosition">7</int> - </object> - <reference idRef="167"/> - <reference idRef="181"/> - <reference idRef="183"/> - <reference idRef="193"/> - </array> - <array count="5" name="allParents"> - <reference idRef="1"/> - <reference idRef="166"/> - <reference idRef="167"/> - <reference idRef="167"/> - <reference idRef="167"/> - </array> - <dictionary count="2" name="nameTable"> - <string>File's Owner</string> - <reference idRef="1"/> - <string>Updater</string> - <reference idRef="166"/> - </dictionary> - <unsigned_int name="nextObjectID">194</unsigned_int> -</object> diff --git a/indra/mac_updater/CMakeLists.txt b/indra/mac_updater/CMakeLists.txt deleted file mode 100755 index a644984e58..0000000000 --- a/indra/mac_updater/CMakeLists.txt +++ /dev/null @@ -1,75 +0,0 @@ -# -*- cmake -*- - -project(mac_updater) - -include(00-Common) -include(OpenSSL) -include(CURL) -include(CARes) -include(LLCommon) -include(LLMessage) -include(LLVFS) -include(Linking) - -include_directories( - ${LLCOMMON_INCLUDE_DIRS} - ${LLVFS_INCLUDE_DIRS} - ${CURL_INCLUDE_DIRS} - ${CARES_INCLUDE_DIRS} - ) - -set(mac_updater_SOURCE_FILES - mac_updater.cpp - ) - -set(mac_updater_HEADER_FILES - CMakeLists.txt - ) - -set_source_files_properties(${mac_updater_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - -list(APPEND mac_updater_SOURCE_FILES ${mac_updater_HEADER_FILES}) - - -set(mac_updater_RESOURCE_FILES - AutoUpdater.nib/ - ) -set_source_files_properties( - ${mac_updater_RESOURCE_FILES} - PROPERTIES - HEADER_FILE_ONLY TRUE - ) -SOURCE_GROUP("Resources" FILES ${mac_updater_RESOURCE_FILES}) -list(APPEND mac_updater_SOURCE_FILES ${mac_updater_RESOURCE_FILES}) - -add_executable(mac-updater - MACOSX_BUNDLE - ${mac_updater_SOURCE_FILES}) - -set_target_properties(mac-updater - PROPERTIES - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist - ) - -target_link_libraries(mac-updater - ${LLMESSAGE_LIBRARIES} - ${LLVFS_LIBRARIES} - ${OPENSSL_LIBRARIES} - ${CRYPTO_LIBRARIES} - ${CURL_LIBRARIES} - ${CARES_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ) - -add_custom_command( - TARGET mac-updater POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS - -E - copy_directory - ${CMAKE_CURRENT_SOURCE_DIR}/AutoUpdater.nib - ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mac-updater.app/Contents/Resources/AutoUpdater.nib - ) - -ll_deploy_sharedlibs_command(mac-updater) diff --git a/indra/mac_updater/Info.plist b/indra/mac_updater/Info.plist deleted file mode 100755 index bb27fddb03..0000000000 --- a/indra/mac_updater/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>mac-updater</string> - <key>CFBundleGetInfoString</key> - <string></string> - <key>CFBundleIconFile</key> - <string></string> - <key>CFBundleIdentifier</key> - <string>com.secondlife.indra.autoupdater</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleShortVersionString</key> - <string></string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>1.0.0</string> -</dict> -</plist> diff --git a/indra/mac_updater/mac_updater.cpp b/indra/mac_updater/mac_updater.cpp deleted file mode 100755 index aa45c5d23f..0000000000 --- a/indra/mac_updater/mac_updater.cpp +++ /dev/null @@ -1,1257 +0,0 @@ -/** - * @file mac_updater.cpp - * @brief - * - * $LicenseInfo:firstyear=2006&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "linden_common.h" - -#include <boost/format.hpp> - -#include <libgen.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> - -#include <curl/curl.h> -#include <pthread.h> - -#include "llerror.h" -#include "lltimer.h" -#include "lldir.h" -#include "llfile.h" - -#include "llstring.h" - -#include <Carbon/Carbon.h> - -#include "llerrorcontrol.h" - -enum -{ - kEventClassCustom = 'Cust', - kEventCustomProgress = 'Prog', - kEventParamCustomCurValue = 'Cur ', - kEventParamCustomMaxValue = 'Max ', - kEventParamCustomText = 'Text', - kEventCustomDone = 'Done', -}; - -WindowRef gWindow = NULL; -EventHandlerRef gEventHandler = NULL; -OSStatus gFailure = noErr; -Boolean gCancelled = false; - -const char *gUpdateURL; -const char *gProductName; -const char *gBundleID; -const char *gDmgFile; -const char *gMarkerPath; - -void *updatethreadproc(void*); - -pthread_t updatethread; - -OSStatus setProgress(int cur, int max) -{ - OSStatus err; - ControlRef progressBar = NULL; - ControlID id; - - id.signature = 'prog'; - id.id = 0; - - err = GetControlByID(gWindow, &id, &progressBar); - if(err == noErr) - { - Boolean indeterminate; - - if(max == 0) - { - indeterminate = true; - err = SetControlData(progressBar, kControlEntireControl, kControlProgressBarIndeterminateTag, sizeof(Boolean), (Ptr)&indeterminate); - } - else - { - double percentage = (double)cur / (double)max; - SetControlMinimum(progressBar, 0); - SetControlMaximum(progressBar, 100); - SetControlValue(progressBar, (SInt16)(percentage * 100)); - - indeterminate = false; - err = SetControlData(progressBar, kControlEntireControl, kControlProgressBarIndeterminateTag, sizeof(Boolean), (Ptr)&indeterminate); - - Draw1Control(progressBar); - } - } - - return(err); -} - -OSStatus setProgressText(CFStringRef text) -{ - OSStatus err; - ControlRef progressText = NULL; - ControlID id; - - id.signature = 'what'; - id.id = 0; - - err = GetControlByID(gWindow, &id, &progressText); - if(err == noErr) - { - err = SetControlData(progressText, kControlEntireControl, kControlStaticTextCFStringTag, sizeof(CFStringRef), (Ptr)&text); - Draw1Control(progressText); - } - - return(err); -} - -OSStatus sendProgress(long cur, long max, CFStringRef text = NULL) -{ - OSStatus result; - EventRef evt; - - result = CreateEvent( - NULL, - kEventClassCustom, - kEventCustomProgress, - 0, - kEventAttributeNone, - &evt); - - // This event needs to be targeted at the window so it goes to the window's handler. - if(result == noErr) - { - EventTargetRef target = GetWindowEventTarget(gWindow); - result = SetEventParameter ( - evt, - kEventParamPostTarget, - typeEventTargetRef, - sizeof(target), - &target); - } - - if(result == noErr) - { - result = SetEventParameter ( - evt, - kEventParamCustomCurValue, - typeLongInteger, - sizeof(cur), - &cur); - } - - if(result == noErr) - { - result = SetEventParameter ( - evt, - kEventParamCustomMaxValue, - typeLongInteger, - sizeof(max), - &max); - } - - if(result == noErr) - { - if(text != NULL) - { - result = SetEventParameter ( - evt, - kEventParamCustomText, - typeCFStringRef, - sizeof(text), - &text); - } - } - - if(result == noErr) - { - // Send the event - PostEventToQueue( - GetMainEventQueue(), - evt, - kEventPriorityStandard); - - } - - return(result); -} - -OSStatus sendDone(void) -{ - OSStatus result; - EventRef evt; - - result = CreateEvent( - NULL, - kEventClassCustom, - kEventCustomDone, - 0, - kEventAttributeNone, - &evt); - - // This event needs to be targeted at the window so it goes to the window's handler. - if(result == noErr) - { - EventTargetRef target = GetWindowEventTarget(gWindow); - result = SetEventParameter ( - evt, - kEventParamPostTarget, - typeEventTargetRef, - sizeof(target), - &target); - } - - if(result == noErr) - { - // Send the event - PostEventToQueue( - GetMainEventQueue(), - evt, - kEventPriorityStandard); - - } - - return(result); -} - -OSStatus dialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata) -{ - OSStatus result = eventNotHandledErr; - OSStatus err; - UInt32 evtClass = GetEventClass(event); - UInt32 evtKind = GetEventKind(event); - - if((evtClass == kEventClassCommand) && (evtKind == kEventCommandProcess)) - { - HICommand cmd; - err = GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(cmd), NULL, &cmd); - - if(err == noErr) - { - switch(cmd.commandID) - { - case kHICommandCancel: - gCancelled = true; -// QuitAppModalLoopForWindow(gWindow); - result = noErr; - break; - } - } - } - else if((evtClass == kEventClassCustom) && (evtKind == kEventCustomProgress)) - { - // Request to update the progress dialog - long cur = 0; - long max = 0; - CFStringRef text = NULL; - (void) GetEventParameter(event, kEventParamCustomCurValue, typeLongInteger, NULL, sizeof(cur), NULL, &cur); - (void) GetEventParameter(event, kEventParamCustomMaxValue, typeLongInteger, NULL, sizeof(max), NULL, &max); - (void) GetEventParameter(event, kEventParamCustomText, typeCFStringRef, NULL, sizeof(text), NULL, &text); - - err = setProgress(cur, max); - if(err == noErr) - { - if(text != NULL) - { - setProgressText(text); - } - } - - result = noErr; - } - else if((evtClass == kEventClassCustom) && (evtKind == kEventCustomDone)) - { - // We're done. Exit the modal loop. - QuitAppModalLoopForWindow(gWindow); - result = noErr; - } - - return(result); -} - -#if 0 -size_t curl_download_callback(void *data, size_t size, size_t nmemb, - void *user_data) -{ - S32 bytes = size * nmemb; - char *cdata = (char *) data; - for (int i =0; i < bytes; i += 1) - { - gServerResponse.append(cdata[i]); - } - return bytes; -} -#endif - -int curl_progress_callback_func(void *clientp, - double dltotal, - double dlnow, - double ultotal, - double ulnow) -{ - int max = (int)(dltotal / 1024.0); - int cur = (int)(dlnow / 1024.0); - sendProgress(cur, max); - - if(gCancelled) - return(1); - - return(0); -} - -int parse_args(int argc, char **argv) -{ - int j; - - for (j = 1; j < argc; j++) - { - if ((!strcmp(argv[j], "-url")) && (++j < argc)) - { - gUpdateURL = argv[j]; - } - else if ((!strcmp(argv[j], "-name")) && (++j < argc)) - { - gProductName = argv[j]; - } - else if ((!strcmp(argv[j], "-bundleid")) && (++j < argc)) - { - gBundleID = argv[j]; - } - else if ((!strcmp(argv[j], "-dmg")) && (++j < argc)) - { - gDmgFile = argv[j]; - } - else if ((!strcmp(argv[j], "-marker")) && (++j < argc)) - { - gMarkerPath = argv[j];; - } - } - - return 0; -} - -int main(int argc, char **argv) -{ - // We assume that all the logs we're looking for reside on the current drive - gDirUtilp->initAppDirs("SecondLife"); - - LLError::initForApplication( gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); - - // Rename current log file to ".old" - std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "updater.log.old"); - std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "updater.log"); - LLFile::rename(log_file.c_str(), old_log_file.c_str()); - - // Set the log file to updater.log - LLError::logToFile(log_file); - - ///////////////////////////////////////// - // - // Process command line arguments - // - gUpdateURL = NULL; - gProductName = NULL; - gBundleID = NULL; - gDmgFile = NULL; - gMarkerPath = NULL; - parse_args(argc, argv); - if ((gUpdateURL == NULL) && (gDmgFile == NULL)) - { - llinfos << "Usage: mac_updater -url <url> | -dmg <dmg file> [-name <product_name>] [-program <program_name>]" << llendl; - exit(1); - } - else - { - llinfos << "Update url is: " << gUpdateURL << llendl; - if (gProductName) - { - llinfos << "Product name is: " << gProductName << llendl; - } - else - { - gProductName = "Second Life"; - } - if (gBundleID) - { - llinfos << "Bundle ID is: " << gBundleID << llendl; - } - else - { - gBundleID = "com.secondlife.indra.viewer"; - } - } - - llinfos << "Starting " << gProductName << " Updater" << llendl; - - // Real UI... - OSStatus err; - IBNibRef nib = NULL; - - err = CreateNibReference(CFSTR("AutoUpdater"), &nib); - - char windowTitle[MAX_PATH]; /* Flawfinder: ignore */ - snprintf(windowTitle, sizeof(windowTitle), "%s Updater", gProductName); - CFStringRef windowTitleRef = NULL; - windowTitleRef = CFStringCreateWithCString(NULL, windowTitle, kCFStringEncodingUTF8); - - if(err == noErr) - { - err = CreateWindowFromNib(nib, CFSTR("Updater"), &gWindow); - } - - if (err == noErr) - { - err = SetWindowTitleWithCFString(gWindow, windowTitleRef); - } - CFRelease(windowTitleRef); - - if(err == noErr) - { - // Set up an event handler for the window. - EventTypeSpec handlerEvents[] = - { - { kEventClassCommand, kEventCommandProcess }, - { kEventClassCustom, kEventCustomProgress }, - { kEventClassCustom, kEventCustomDone } - }; - InstallStandardEventHandler(GetWindowEventTarget(gWindow)); - InstallWindowEventHandler( - gWindow, - NewEventHandlerUPP(dialogHandler), - GetEventTypeCount (handlerEvents), - handlerEvents, - 0, - &gEventHandler); - } - - if(err == noErr) - { - ShowWindow(gWindow); - SelectWindow(gWindow); - } - - if(err == noErr) - { - pthread_create(&updatethread, - NULL, - &updatethreadproc, - NULL); - - } - - if(err == noErr) - { - RunAppModalLoopForWindow(gWindow); - } - - void *threadresult; - - pthread_join(updatethread, &threadresult); - - if(!gCancelled && (gFailure != noErr)) - { - // Something went wrong. Since we always just tell the user to download a new version, we don't really care what. - AlertStdCFStringAlertParamRec params; - SInt16 retval_mac = 1; - DialogRef alert = NULL; - OSStatus err; - - params.version = kStdCFStringAlertVersionOne; - params.movable = false; - params.helpButton = false; - params.defaultText = (CFStringRef)kAlertDefaultOKText; - params.cancelText = 0; - params.otherText = 0; - params.defaultButton = 1; - params.cancelButton = 0; - params.position = kWindowDefaultPosition; - params.flags = 0; - - err = CreateStandardAlert( - kAlertStopAlert, - CFSTR("Error"), - CFSTR("An error occurred while updating Second Life. Please download the latest version from www.secondlife.com."), - ¶ms, - &alert); - - if(err == noErr) - { - err = RunStandardAlert( - alert, - NULL, - &retval_mac); - } - - if(gMarkerPath != 0) - { - // Create a install fail marker that can be used by the viewer to - // detect install problems. - std::ofstream stream(gMarkerPath); - if(stream) stream << -1; - } - exit(-1); - } else { - exit(0); - } - - if(gWindow != NULL) - { - DisposeWindow(gWindow); - } - - if(nib != NULL) - { - DisposeNibReference(nib); - } - - return 0; -} - -bool isDirWritable(FSRef &dir) -{ - bool result = false; - - // Test for a writable directory by creating a directory, then deleting it again. - // This is kinda lame, but will pretty much always give the right answer. - - OSStatus err = noErr; - char temp[PATH_MAX] = ""; /* Flawfinder: ignore */ - - err = FSRefMakePath(&dir, (UInt8*)temp, sizeof(temp)); - - if(err == noErr) - { - strncat(temp, "/.test_XXXXXX", (sizeof(temp) - strlen(temp)) - 1); - - if(mkdtemp(temp) != NULL) - { - // We were able to make the directory. This means the directory is writable. - result = true; - - // Clean up. - rmdir(temp); - } - } - -#if 0 - // This seemed like a good idea, but won't tell us if we're on a volume mounted read-only. - UInt8 perm; - err = FSGetUserPrivilegesPermissions(&targetParentRef, &perm, NULL); - if(err == noErr) - { - if(perm & kioACUserNoMakeChangesMask) - { - // Parent directory isn't writable. - llinfos << "Target parent directory not writable." << llendl; - err = -1; - replacingTarget = false; - } - } -#endif - - return result; -} - -static std::string HFSUniStr255_to_utf8str(const HFSUniStr255* src) -{ - llutf16string string16((U16*)&(src->unicode), src->length); - std::string result = utf16str_to_utf8str(string16); - return result; -} - -int restoreObject(const char* aside, const char* target, const char* path, const char* object) -{ - char source[PATH_MAX] = ""; /* Flawfinder: ignore */ - char dest[PATH_MAX] = ""; /* Flawfinder: ignore */ - snprintf(source, sizeof(source), "%s/%s/%s", aside, path, object); - snprintf(dest, sizeof(dest), "%s/%s", target, path); - FSRef sourceRef; - FSRef destRef; - OSStatus err; - err = FSPathMakeRef((UInt8 *)source, &sourceRef, NULL); - if(err != noErr) return false; - err = FSPathMakeRef((UInt8 *)dest, &destRef, NULL); - if(err != noErr) return false; - - llinfos << "Copying " << source << " to " << dest << llendl; - - err = FSCopyObjectSync( - &sourceRef, - &destRef, - NULL, - NULL, - kFSFileOperationOverwrite); - - if(err != noErr) return false; - return true; -} - -// Replace any mention of "Second Life" with the product name. -void filterFile(const char* filename) -{ - char temp[PATH_MAX] = ""; /* Flawfinder: ignore */ - // First copy the target's version, so we can run it through sed. - snprintf(temp, sizeof(temp), "cp '%s' '%s.tmp'", filename, filename); - system(temp); /* Flawfinder: ignore */ - - // Now run it through sed. - snprintf(temp, sizeof(temp), - "sed 's/Second Life/%s/g' '%s.tmp' > '%s'", gProductName, filename, filename); - system(temp); /* Flawfinder: ignore */ -} - -static bool isFSRefViewerBundle(FSRef *targetRef) -{ - bool result = false; - CFURLRef targetURL = NULL; - CFBundleRef targetBundle = NULL; - CFStringRef targetBundleID = NULL; - CFStringRef sourceBundleID = NULL; - - targetURL = CFURLCreateFromFSRef(NULL, targetRef); - - if(targetURL == NULL) - { - llinfos << "Error creating target URL." << llendl; - } - else - { - targetBundle = CFBundleCreate(NULL, targetURL); - } - - if(targetBundle == NULL) - { - llinfos << "Failed to create target bundle." << llendl; - } - else - { - targetBundleID = CFBundleGetIdentifier(targetBundle); - } - - if(targetBundleID == NULL) - { - llinfos << "Couldn't retrieve target bundle ID." << llendl; - } - else - { - sourceBundleID = CFStringCreateWithCString(NULL, gBundleID, kCFStringEncodingUTF8); - if(CFStringCompare(sourceBundleID, targetBundleID, 0) == kCFCompareEqualTo) - { - // This is the bundle we're looking for. - result = true; - } - else - { - llinfos << "Target bundle ID mismatch." << llendl; - } - } - - // Don't release targetBundleID -- since we don't retain it, it's released when targetBundle is released. - if(targetURL != NULL) - CFRelease(targetURL); - if(targetBundle != NULL) - CFRelease(targetBundle); - - return result; -} - -// Search through the directory specified by 'parent' for an item that appears to be a Second Life viewer. -static OSErr findAppBundleOnDiskImage(FSRef *parent, FSRef *app) -{ - FSIterator iterator; - bool found = false; - - OSErr err = FSOpenIterator( parent, kFSIterateFlat, &iterator ); - if(!err) - { - do - { - ItemCount actualObjects = 0; - Boolean containerChanged = false; - FSCatalogInfo info; - FSRef ref; - HFSUniStr255 unicodeName; - err = FSGetCatalogInfoBulk( - iterator, - 1, - &actualObjects, - &containerChanged, - kFSCatInfoNodeFlags, - &info, - &ref, - NULL, - &unicodeName ); - - if(actualObjects == 0) - break; - - if(!err) - { - // Call succeeded and not done with the iteration. - std::string name = HFSUniStr255_to_utf8str(&unicodeName); - - llinfos << "Considering \"" << name << "\"" << llendl; - - if(info.nodeFlags & kFSNodeIsDirectoryMask) - { - // This is a directory. See if it's a .app - if(name.find(".app") != std::string::npos) - { - // Looks promising. Check to see if it has the right bundle identifier. - if(isFSRefViewerBundle(&ref)) - { - llinfos << name << " is the one" << llendl; - // This is the one. Return it. - *app = ref; - found = true; - break; - } else { - llinfos << name << " is not the bundle we are looking for; move along" << llendl; - } - - } - } - } - } - while(!err); - - llinfos << "closing the iterator" << llendl; - - FSCloseIterator(iterator); - - llinfos << "closed" << llendl; - } - - if(!err && !found) - err = fnfErr; - - return err; -} - -void *updatethreadproc(void*) -{ - char tempDir[PATH_MAX] = ""; /* Flawfinder: ignore */ - FSRef tempDirRef; - char temp[PATH_MAX] = ""; /* Flawfinder: ignore */ - // *NOTE: This buffer length is used in a scanf() below. - char deviceNode[1024] = ""; /* Flawfinder: ignore */ - LLFILE *downloadFile = NULL; - OSStatus err; - ProcessSerialNumber psn; - char target[PATH_MAX] = ""; /* Flawfinder: ignore */ - FSRef targetRef; - FSRef targetParentRef; - FSVolumeRefNum targetVol; - FSRef trashFolderRef; - Boolean replacingTarget = false; - - memset(&tempDirRef, 0, sizeof(tempDirRef)); - memset(&targetRef, 0, sizeof(targetRef)); - memset(&targetParentRef, 0, sizeof(targetParentRef)); - - try - { - // Attempt to get a reference to the Second Life application bundle containing this updater. - // Any failures during this process will cause us to default to updating /Applications/Second Life.app - { - FSRef myBundle; - - err = GetCurrentProcess(&psn); - if(err == noErr) - { - err = GetProcessBundleLocation(&psn, &myBundle); - } - - if(err == noErr) - { - // Sanity check: Make sure the name of the item referenced by targetRef is "Second Life.app". - FSRefMakePath(&myBundle, (UInt8*)target, sizeof(target)); - - llinfos << "Updater bundle location: " << target << llendl; - } - - // Our bundle should be in Second Life.app/Contents/Resources/AutoUpdater.app - // so we need to go up 3 levels to get the path to the main application bundle. - if(err == noErr) - { - err = FSGetCatalogInfo(&myBundle, kFSCatInfoNone, NULL, NULL, NULL, &targetRef); - } - if(err == noErr) - { - err = FSGetCatalogInfo(&targetRef, kFSCatInfoNone, NULL, NULL, NULL, &targetRef); - } - if(err == noErr) - { - err = FSGetCatalogInfo(&targetRef, kFSCatInfoNone, NULL, NULL, NULL, &targetRef); - } - - // And once more to get the parent of the target - if(err == noErr) - { - err = FSGetCatalogInfo(&targetRef, kFSCatInfoNone, NULL, NULL, NULL, &targetParentRef); - } - - if(err == noErr) - { - FSRefMakePath(&targetRef, (UInt8*)target, sizeof(target)); - llinfos << "Path to target: " << target << llendl; - } - - // Sanity check: make sure the target is a bundle with the right identifier - if(err == noErr) - { - // Assume the worst... - err = -1; - - if(isFSRefViewerBundle(&targetRef)) - { - // This is the bundle we're looking for. - err = noErr; - replacingTarget = true; - } - } - - // Make sure the target's parent directory is writable. - if(err == noErr) - { - if(!isDirWritable(targetParentRef)) - { - // Parent directory isn't writable. - llinfos << "Target parent directory not writable." << llendl; - err = -1; - replacingTarget = false; - } - } - - if(err != noErr) - { - Boolean isDirectory; - llinfos << "Target search failed, defaulting to /Applications/" << gProductName << ".app." << llendl; - - // Set up the parent directory - err = FSPathMakeRef((UInt8*)"/Applications", &targetParentRef, &isDirectory); - if((err != noErr) || (!isDirectory)) - { - // We're so hosed. - llinfos << "Applications directory not found, giving up." << llendl; - throw 0; - } - - snprintf(target, sizeof(target), "/Applications/%s.app", gProductName); - - memset(&targetRef, 0, sizeof(targetRef)); - err = FSPathMakeRef((UInt8*)target, &targetRef, NULL); - if(err == fnfErr) - { - // This is fine, just means we're not replacing anything. - err = noErr; - replacingTarget = false; - } - else - { - replacingTarget = true; - } - - // Make sure the target's parent directory is writable. - if(err == noErr) - { - if(!isDirWritable(targetParentRef)) - { - // Parent directory isn't writable. - llinfos << "Target parent directory not writable." << llendl; - err = -1; - replacingTarget = false; - } - } - - } - - // If we haven't fixed all problems by this point, just bail. - if(err != noErr) - { - llinfos << "Unable to pick a target, giving up." << llendl; - throw 0; - } - } - - // Find the volID of the volume the target resides on - { - FSCatalogInfo info; - err = FSGetCatalogInfo( - &targetParentRef, - kFSCatInfoVolume, - &info, - NULL, - NULL, - NULL); - - if(err != noErr) - throw 0; - - targetVol = info.volume; - } - - // Find the temporary items and trash folders on that volume. - err = FSFindFolder( - targetVol, - kTrashFolderType, - true, - &trashFolderRef); - - if(err != noErr) - throw 0; - -#if 0 // *HACK for DEV-11935 see below for details. - - FSRef tempFolderRef; - - err = FSFindFolder( - targetVol, - kTemporaryFolderType, - true, - &tempFolderRef); - - if(err != noErr) - throw 0; - - err = FSRefMakePath(&tempFolderRef, (UInt8*)temp, sizeof(temp)); - - if(err != noErr) - throw 0; - -#else - - // *HACK for DEV-11935 the above kTemporaryFolderType query was giving - // back results with path names that seem to be too long to be used as - // mount points. I suspect this incompatibility was introduced in the - // Leopard 10.5.2 update, but I have not verified this. - char const HARDCODED_TMP[] = "/tmp"; - strncpy(temp, HARDCODED_TMP, sizeof(HARDCODED_TMP)); - -#endif // 0 *HACK for DEV-11935 - - // Skip downloading the file if the dmg was passed on the command line. - std::string dmgName; - if(gDmgFile != NULL) { - dmgName = basename((char *)gDmgFile); - char * dmgDir = dirname((char *)gDmgFile); - strncpy(tempDir, dmgDir, sizeof(tempDir)); - err = FSPathMakeRef((UInt8*)tempDir, &tempDirRef, NULL); - if(err != noErr) throw 0; - chdir(tempDir); - goto begin_install; - } else { - // Continue on to download file. - dmgName = "SecondLife.dmg"; - } - - - strncat(temp, "/SecondLifeUpdate_XXXXXX", (sizeof(temp) - strlen(temp)) - 1); - if(mkdtemp(temp) == NULL) - { - throw 0; - } - - strncpy(tempDir, temp, sizeof(tempDir)); - temp[sizeof(tempDir) - 1] = '\0'; - - llinfos << "tempDir is " << tempDir << llendl; - - err = FSPathMakeRef((UInt8*)tempDir, &tempDirRef, NULL); - - if(err != noErr) - throw 0; - - chdir(tempDir); - - snprintf(temp, sizeof(temp), "SecondLife.dmg"); - - downloadFile = LLFile::fopen(temp, "wb"); /* Flawfinder: ignore */ - if(downloadFile == NULL) - { - throw 0; - } - - { - CURL *curl = curl_easy_init(); - - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); - // curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &curl_download_callback); - curl_easy_setopt(curl, CURLOPT_FILE, downloadFile); - curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0); - curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, &curl_progress_callback_func); - curl_easy_setopt(curl, CURLOPT_URL, gUpdateURL); - curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); - - sendProgress(0, 1, CFSTR("Downloading...")); - - CURLcode result = curl_easy_perform(curl); - - curl_easy_cleanup(curl); - - if(gCancelled) - { - llinfos << "User cancel, bailing out."<< llendl; - throw 0; - } - - if(result != CURLE_OK) - { - llinfos << "Error " << result << " while downloading disk image."<< llendl; - throw 0; - } - - fclose(downloadFile); - downloadFile = NULL; - } - - begin_install: - sendProgress(0, 0, CFSTR("Mounting image...")); - LLFile::mkdir("mnt", 0700); - - // NOTE: we could add -private at the end of this command line to keep the image from showing up in the Finder, - // but if our cleanup fails, this makes it much harder for the user to unmount the image. - std::string mountOutput; - boost::format cmdFormat("hdiutil attach %s -mountpoint mnt"); - cmdFormat % dmgName; - FILE* mounter = popen(cmdFormat.str().c_str(), "r"); /* Flawfinder: ignore */ - - if(mounter == NULL) - { - llinfos << "Failed to mount disk image, exiting."<< llendl; - throw 0; - } - - // We need to scan the output from hdiutil to find the device node it uses to attach the disk image. - // If we don't have this information, we can't detach it later. - while(mounter != NULL) - { - size_t len = fread(temp, 1, sizeof(temp)-1, mounter); - temp[len] = 0; - mountOutput.append(temp); - if(len < sizeof(temp)-1) - { - // End of file or error. - int result = pclose(mounter); - if(result != 0) - { - // NOTE: We used to abort here, but pclose() started returning - // -1, possibly when the size of the DMG passed a certain point - llinfos << "Unexpected result closing pipe: " << result << llendl; - } - mounter = NULL; - } - } - - if(!mountOutput.empty()) - { - const char *s = mountOutput.c_str(); - const char *prefix = "/dev/"; - char *sub = strstr(s, prefix); - - if(sub != NULL) - { - sub += strlen(prefix); /* Flawfinder: ignore */ - sscanf(sub, "%1023s", deviceNode); /* Flawfinder: ignore */ - } - } - - if(deviceNode[0] != 0) - { - llinfos << "Disk image attached on /dev/" << deviceNode << llendl; - } - else - { - llinfos << "Disk image device node not found!" << llendl; - throw 0; - } - - // Get an FSRef to the new application on the disk image - FSRef sourceRef; - FSRef mountRef; - snprintf(temp, sizeof(temp), "%s/mnt", tempDir); - - llinfos << "Disk image mount point is: " << temp << llendl; - - err = FSPathMakeRef((UInt8 *)temp, &mountRef, NULL); - if(err != noErr) - { - llinfos << "Couldn't make FSRef to disk image mount point." << llendl; - throw 0; - } - - sendProgress(0, 0, CFSTR("Searching for the app bundle...")); - err = findAppBundleOnDiskImage(&mountRef, &sourceRef); - if(err != noErr) - { - llinfos << "Couldn't find application bundle on mounted disk image." << llendl; - throw 0; - } - else - { - llinfos << "found the bundle." << llendl; - } - - sendProgress(0, 0, CFSTR("Preparing to copy files...")); - - FSRef asideRef; - char aside[MAX_PATH]; /* Flawfinder: ignore */ - - // this will hold the name of the destination target - CFStringRef appNameRef; - - if(replacingTarget) - { - // Get the name of the target we're replacing - HFSUniStr255 appNameUniStr; - err = FSGetCatalogInfo(&targetRef, 0, NULL, &appNameUniStr, NULL, NULL); - if(err != noErr) - throw 0; - appNameRef = FSCreateStringFromHFSUniStr(NULL, &appNameUniStr); - - // Move aside old version (into work directory) - err = FSMoveObject(&targetRef, &tempDirRef, &asideRef); - if(err != noErr) - { - llwarns << "failed to move aside old version (error code " << - err << ")" << llendl; - throw 0; - } - - // Grab the path for later use. - err = FSRefMakePath(&asideRef, (UInt8*)aside, sizeof(aside)); - } - else - { - // Construct the name of the target based on the product name - char appName[MAX_PATH]; /* Flawfinder: ignore */ - snprintf(appName, sizeof(appName), "%s.app", gProductName); - appNameRef = CFStringCreateWithCString(NULL, appName, kCFStringEncodingUTF8); - } - - sendProgress(0, 0, CFSTR("Copying files...")); - - llinfos << "Starting copy..." << llendl; - - // Copy the new version from the disk image to the target location. - err = FSCopyObjectSync( - &sourceRef, - &targetParentRef, - appNameRef, - &targetRef, - kFSFileOperationDefaultOptions); - - // Grab the path for later use. - err = FSRefMakePath(&targetRef, (UInt8*)target, sizeof(target)); - if(err != noErr) - throw 0; - - llinfos << "Copy complete. Target = " << target << llendl; - - if(err != noErr) - { - // Something went wrong during the copy. Attempt to put the old version back and bail. - (void)FSDeleteObject(&targetRef); - if(replacingTarget) - { - (void)FSMoveObject(&asideRef, &targetParentRef, NULL); - } - throw 0; - } - else - { - // The update has succeeded. Clear the cache directory. - - sendProgress(0, 0, CFSTR("Clearing cache...")); - - llinfos << "Clearing cache..." << llendl; - - gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""), "*.*"); - - llinfos << "Clear complete." << llendl; - - } - } - catch(...) - { - if(!gCancelled) - if(gFailure == noErr) - gFailure = -1; - } - - // Failures from here on out are all non-fatal and not reported. - sendProgress(0, 3, CFSTR("Cleaning up...")); - - // Close disk image file if necessary - if(downloadFile != NULL) - { - llinfos << "Closing download file." << llendl; - - fclose(downloadFile); - downloadFile = NULL; - } - - sendProgress(1, 3); - // Unmount image - if(deviceNode[0] != 0) - { - llinfos << "Detaching disk image." << llendl; - - snprintf(temp, sizeof(temp), "hdiutil detach '%s'", deviceNode); - system(temp); /* Flawfinder: ignore */ - } - - sendProgress(2, 3); - - // Move work directory to the trash - if(tempDir[0] != 0) - { - llinfos << "Moving work directory to the trash." << llendl; - - FSRef trashRef; - OSStatus err = FSMoveObjectToTrashSync(&tempDirRef, &trashRef, 0); - if(err != noErr) { - llwarns << "failed to move files to trash, (error code " << - err << ")" << llendl; - } - } - - if(!gCancelled && !gFailure && (target[0] != 0)) - { - llinfos << "Touching application bundle." << llendl; - - snprintf(temp, sizeof(temp), "touch '%s'", target); - system(temp); /* Flawfinder: ignore */ - - llinfos << "Launching updated application." << llendl; - - snprintf(temp, sizeof(temp), "open '%s'", target); - system(temp); /* Flawfinder: ignore */ - } - - sendDone(); - - return(NULL); -} diff --git a/indra/mac_updater/mac_updater.h b/indra/mac_updater/mac_updater.h deleted file mode 100755 index f65b481cb6..0000000000 --- a/indra/mac_updater/mac_updater.h +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @file mac_updater.h - * @brief - * - * $LicenseInfo:firstyear=2006&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include <iostream> -#include <pthread.h> -#include <boost/filesystem.hpp> - -#ifndef LL_MAC_UPDATER_H -#define LL_MAC_UPDATER_H -extern bool gCancelled; -extern bool gFailure; - -void *updatethreadproc(void*); -std::string* walkParents( signed int depth, std::string* childpath ); -std::string* getUserTrashFolder(); - -void setProgress(int cur, int max); -void setProgressText(const std::string& str); -void sendProgress(int cur, int max, std::string str); -void sendDone(); -void sendStopAlert(); - -bool isFSRefViewerBundle(const std::string& targetURL); -bool isDirWritable(const std::string& dir_name); -bool mkTempDir(boost::filesystem::path& temp_dir); -bool copyDir(const std::string& src_dir, const std::string& dest_dir); - -int oldmain(); - -class LLMacUpdater -{ -public: - LLMacUpdater(); - void doUpdate(); - const std::string walkParents( signed int depth, const std::string& childpath ); - bool isApplication(const std::string& app_str); - void filterFile(const char* filename); - - bool findAppBundleOnDiskImage(const boost::filesystem::path& dir_path, - boost::filesystem::path& path_found); - - bool verifyDirectory(const boost::filesystem::path* directory, bool isParent=false); - bool getViewerDir(boost::filesystem::path &app_dir); - bool downloadDMG(const std::string& dmgName, boost::filesystem::path* temp_dir); - bool doMount(const std::string& dmgName, char* deviceNode, const boost::filesystem::path& temp_dir); - bool moveApplication (const boost::filesystem::path& app_dir, - const boost::filesystem::path& temp_dir, - boost::filesystem::path& aside_dir); - bool doInstall(const boost::filesystem::path& app_dir, - const boost::filesystem::path& temp_dir, - boost::filesystem::path& mount_dir, - bool replacingTarget); - void* updatethreadproc(void*); - static void* sUpdatethreadproc(void*); - -public: - std::string *mUpdateURL; - std::string *mProductName; - std::string *mBundleID; - std::string *mDmgFile; - std::string *mMarkerPath; - std::string *mApplicationPath; - static LLMacUpdater *sInstance; - -}; -#endif - - diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index b8b52580ad..4c535a952f 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -87,6 +87,7 @@ include_directories( ${OPENAL_LIB_INCLUDE_DIRS} ${LIBS_PREBUILT_DIR}/include/collada/1.4 ${LLAPPEARANCE_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} ) include_directories(SYSTEM @@ -301,6 +302,7 @@ set(viewer_SOURCE_FILES llgroupiconctrl.cpp llgrouplist.cpp llgroupmgr.cpp + llhasheduniqueid.cpp llhints.cpp llhomelocationresponder.cpp llhudeffect.cpp @@ -882,6 +884,7 @@ set(viewer_HEADER_FILES llgroupiconctrl.h llgrouplist.h llgroupmgr.h + llhasheduniqueid.h llhints.h llhomelocationresponder.h llhudeffect.h @@ -1249,6 +1252,18 @@ set(viewer_HEADER_FILES source_group("CMake Rules" FILES ViewerInstall.cmake) +add_custom_target(generate_viewer_version ALL + COMMAND echo "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" > ${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt + COMMENT Generating viewer_version.txt for manifest processing + ) + +set_source_files_properties( + llversioninfo.cpp tests/llversioninfo_test.cpp + PROPERTIES + DEPENDS generate_viewer_version # dummy dependency to force recompile every time + COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" # see BuildVersion.cmake + ) + if (DARWIN) LIST(APPEND viewer_SOURCE_FILES llappviewermacosx.cpp) @@ -1326,15 +1341,17 @@ if (WINDOWS) # Replace the icons with the appropriate ones for the channel # ('test' is the default) set(ICON_PATH "test") + set(VIEWER_MACOSX_PHASE "d") string(TOLOWER ${VIEWER_CHANNEL} channel_lower) if(channel_lower MATCHES "^second life release") set(ICON_PATH "release") - elseif(channel_lower MATCHES "^second life beta viewer") + set(VIEWER_MACOSX_PHASE "f") + elseif(channel_lower MATCHES "^second life beta") set(ICON_PATH "beta") - elseif(channel_lower MATCHES "^second life development") - set(ICON_PATH "development") - elseif(channel_lower MATCHES "project") + set(VIEWER_MACOSX_PHASE "b") + elseif(channel_lower MATCHES "^second life project") set(ICON_PATH "project") + set(VIEWER_MACOSX_PHASE "a") endif() message("Copying icons for ${ICON_PATH}") execute_process( @@ -1403,11 +1420,18 @@ if (WINDOWS) set_source_files_properties(${viewer_RESOURCE_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/res/viewerRes.rc + ${CMAKE_CURRENT_BINARY_DIR}/viewerRes.rc + ) set(viewer_RESOURCE_FILES - res/viewerRes.rc + ${CMAKE_CURRENT_BINARY_DIR}/viewerRes.rc ${viewer_RESOURCE_FILES} ) + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/viewerRes.rc + PROPERTIES COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/res" + ) + SOURCE_GROUP("Resource Files" FILES ${viewer_RESOURCE_FILES}) if (NOT STANDALONE) @@ -1710,10 +1734,13 @@ if (WINDOWS) --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} --grid=${GRID} + --channel=${VIEWER_CHANNEL} + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/copy_touched.bat DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + generate_viewer_version stage_third_party_libs ${COPY_INPUT_DEPENDENCIES} COMMENT "Performing viewer_manifest copy" @@ -1772,21 +1799,23 @@ if (WINDOWS) --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} --channel=${VIEWER_CHANNEL} + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} --grid=${GRID} - --login_channel=${VIEWER_LOGIN_CHANNEL} --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/touched.bat DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + ${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt ${COPY_INPUT_DEPENDENCIES} ) add_custom_target(package ALL DEPENDS ${CMAKE_CFG_INTDIR}/touched.bat windows-setup-build-all + generate_viewer_version ) # temporarily disable packaging of event_host until hg subrepos get # sorted out on the parabuild cluster... @@ -1838,6 +1867,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${viewer_LIBRARIES} ${BOOST_PROGRAM_OPTIONS_LIBRARY} ${BOOST_REGEX_LIBRARY} + ${BOOST_CONTEXT_LIBRARY} ${DBUSGLIB_LIBRARIES} ${OPENGL_LIBRARIES} ${FMODWRAPPER_LIBRARY} # must come after LLAudio @@ -1859,14 +1889,11 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${LLAPPEARANCE_LIBRARIES} ) -build_version(viewer) - set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Path to artwork files.") - if (LINUX) - set(product SecondLife-${ARCH}-${viewer_VERSION}) + set(product SecondLife-${ARCH}-${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}) # These are the generated targets that are copied to package/ set(COPY_INPUT_DEPENDENCIES @@ -1888,20 +1915,22 @@ if (LINUX) --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} --channel=${VIEWER_CHANNEL} + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged --grid=${GRID} --installer_name=${product} - --login_channel=${VIEWER_LOGIN_CHANNEL} --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + generate_viewer_version ${COPY_INPUT_DEPENDENCIES} ) if (PACKAGE) endif (PACKAGE) + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched COMMAND ${PYTHON_EXECUTABLE} @@ -1915,9 +1944,12 @@ if (LINUX) --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged --grid=${GRID} + --channel=${VIEWER_CHANNEL} + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --source=${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + generate_viewer_version ${COPY_INPUT_DEPENDENCIES} COMMENT "Performing viewer_manifest copy" ) @@ -1934,18 +1966,24 @@ endif (LINUX) if (DARWIN) set(product "Second Life") + set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES OUTPUT_NAME "${product}" - MACOSX_BUNDLE_INFO_STRING "info string - localize me" + MACOSX_BUNDLE_INFO_STRING "Second Life Viewer" MACOSX_BUNDLE_ICON_FILE "secondlife.icns" - MACOSX_BUNDLE_GUI_IDENTIFIER "Second Life" - MACOSX_BUNDLE_LONG_VERSION_STRING "ververver" + MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer" + MACOSX_BUNDLE_LONG_VERSION_STRING "${VIEWER_CHANNEL} ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" MACOSX_BUNDLE_BUNDLE_NAME "Second Life" - MACOSX_BUNDLE_SHORT_VERSION_STRING "asdf" - MACOSX_BUNDLE_BUNDLE_VERSION "asdf" - MACOSX_BUNDLE_COPYRIGHT "copyright linden lab 2007 - localize me and run me through a legal wringer" + MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}" + MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}" + MACOSX_BUNDLE_COPYRIGHT "Copyright © Linden Research, Inc. 2007" + ) + + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" + "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app/Contents/Info.plist" ) add_custom_command( @@ -1960,11 +1998,16 @@ if (DARWIN) --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app --grid=${GRID} + --channel=${VIEWER_CHANNEL} + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --source=${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + DEPENDS + ${VIEWER_BINARY_NAME} + ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + generate_viewer_version ) - add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit mac-updater mac-crash-logger) + add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit mac-crash-logger) if (ENABLE_SIGNING) set(SIGNING_SETTING "--signature=${SIGNING_IDENTITY}") @@ -1974,6 +2017,7 @@ if (DARWIN) if (PACKAGE) add_custom_target(package ALL DEPENDS ${VIEWER_BINARY_NAME}) + add_dependencies(package generate_viewer_version) add_custom_command( TARGET package POST_BUILD @@ -1987,12 +2031,14 @@ if (DARWIN) --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app --grid=${GRID} - --login_channel=${VIEWER_LOGIN_CHANNEL} + --channel=${VIEWER_CHANNEL} + --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched ${SIGNING_SETTING} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + generate_viewer_version ) endif (PACKAGE) endif (DARWIN) @@ -2017,12 +2063,11 @@ if (PACKAGE) # *TODO: Generate these search dirs in the cmake files related to each binary. list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/llplugin/slplugin/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}") - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_updater/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/quicktime/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/webkit/${CMAKE_CFG_INTDIR}") set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin.tar.bz2") - set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-updater mac-crash-logger") + set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger") set(VIEWER_LIB_GLOB "*.dylib") endif (DARWIN) if (LINUX) diff --git a/indra/newview/English.lproj/InfoPlist.strings b/indra/newview/English.lproj/InfoPlist.strings index 774ade714b..041b8cea0b 100755 --- a/indra/newview/English.lproj/InfoPlist.strings +++ b/indra/newview/English.lproj/InfoPlist.strings @@ -2,6 +2,6 @@ CFBundleName = "Second Life"; -CFBundleShortVersionString = "Second Life version 3.5.1.288888"; -CFBundleGetInfoString = "Second Life version 3.5.1.288888, Copyright 2004-2009 Linden Research, Inc."; +CFBundleShortVersionString = "Second Life version %%VERSION%%"; +CFBundleGetInfoString = "Second Life version %%VERSION%%, Copyright 2004 Linden Research, Inc."; diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index 035d6cbe6c..a19844f11c 100755 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -60,7 +60,7 @@ </dict> </array> <key>CFBundleVersion</key> - <string>3.4.1.264760</string> + <string>${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION}</string> <key>CSResourcesFileMapped</key> <true/> </dict> diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt new file mode 100644 index 0000000000..444877d48f --- /dev/null +++ b/indra/newview/VIEWER_VERSION.txt @@ -0,0 +1 @@ +3.5.3 diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index 6120f22ba4..f0d8b77afd 100755 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -92,6 +92,9 @@ PERMISSION_CHANGE_LINKS Passed to llRequestPermissions library function to req PERMISSION_TRACK_CAMERA Passed to llRequestPermissions library function to request permission to track agent's camera PERMISSION_CONTROL_CAMERA Passed to llRequestPermissions library function to request permission to change agent's camera PERMISSION_TELEPORT Passed to llRequestPermissions library function to request permission to teleport agent +SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT Passed to llRequestPermissions library function to request permission to silently modify estate access lists +PERMISSION_OVERRIDE_ANIMATIONS Passed to llRequestPermissions library function to request permission to override animations on agent +PERMISSION_RETURN_OBJECTS Passed to llRequestPermissions library function to request permission to return objects DEBUG_CHANNEL Chat channel reserved for debug and error messages from scripts PUBLIC_CHANNEL Chat channel that broadcasts to all nearby users diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 448fdaadba..2e53cf2da0 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2015,7 +2015,7 @@ <key>Value</key> <string /> </map> - <key>DebugAvatarAppearanceMessage</key> + <key>DebugAvatarAppearanceMessage</key> <map> <key>Comment</key> <string>Dump a bunch of XML files when handling appearance messages</string> @@ -2070,7 +2070,7 @@ <key>Value</key> <integer>1</integer> </map> - <key>DebugAvatarCompositeBaked</key> + <key>DebugAvatarCompositeBaked</key> <map> <key>Comment</key> <string>Colorize avatar meshes based on baked/composite state.</string> @@ -11183,7 +11183,7 @@ <key>Type</key> <string>F32</string> <key>Value</key> - <integer>0.0</integer> + <real>0.0</real> </map> <key>TextureFetchUpdateSkipLowPriority</key> <map> diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index de858b34b5..daa2fb390a 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -157,8 +157,8 @@ void main() //spec *= shadow; //color.rgb += spec * specular; - //color.rgb = atmosTransport(color.rgb); - //color.rgb = scaleSoftClip(color.rgb); + color.rgb = atmosTransport(color.rgb); + color.rgb = scaleSoftClip(color.rgb); //color.a = spec * sunAngle2; //wavef.z *= 0.1f; diff --git a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl index a2a567eff1..352cea7aaa 100755 --- a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl @@ -49,35 +49,35 @@ float wave(vec2 v, float t, float f, vec2 d, float s) void main() { //transform vertex + vec4 pos = vec4(position.xyz, 1.0); mat4 modelViewProj = modelview_projection_matrix; vec4 oPosition; //get view vector vec3 oEyeVec; - oEyeVec.xyz = position.xyz-eyeVec; + oEyeVec.xyz = pos.xyz-eyeVec; float d = length(oEyeVec.xy); float ld = min(d, 2560.0); - vec3 lpos = position; - lpos.xy = eyeVec.xy + oEyeVec.xy/d*ld; + pos.xy = eyeVec.xy + oEyeVec.xy/d*ld; view.xyz = oEyeVec; d = clamp(ld/1536.0-0.5, 0.0, 1.0); d *= d; - oPosition = vec4(lpos, 1.0); + oPosition = vec4(position, 1.0); oPosition.z = mix(oPosition.z, max(eyeVec.z*0.75, 0.0), d); oPosition = modelViewProj * oPosition; + refCoord.xyz = oPosition.xyz + vec3(0,0,0.2); //get wave position parameter (create sweeping horizontal waves) - vec3 v = lpos; + vec3 v = pos.xyz; v.x += (cos(v.x*0.08/*+time*0.01*/)+sin(v.y*0.02))*6.0; //push position for further horizon effect. - vec4 pos; pos.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z); pos.w = 1.0; pos = modelview_matrix*pos; diff --git a/indra/newview/icons/development/secondlife.icns b/indra/newview/icons/development/secondlife.icns Binary files differdeleted file mode 100755 index 44f63d384c..0000000000 --- a/indra/newview/icons/development/secondlife.icns +++ /dev/null diff --git a/indra/newview/icons/development/secondlife.ico b/indra/newview/icons/development/secondlife.ico Binary files differdeleted file mode 100755 index b53f23ae58..0000000000 --- a/indra/newview/icons/development/secondlife.ico +++ /dev/null diff --git a/indra/newview/icons/development/secondlife_128.png b/indra/newview/icons/development/secondlife_128.png Binary files differdeleted file mode 100755 index 9b9fe656fc..0000000000 --- a/indra/newview/icons/development/secondlife_128.png +++ /dev/null diff --git a/indra/newview/icons/development/secondlife_16.png b/indra/newview/icons/development/secondlife_16.png Binary files differdeleted file mode 100755 index 91493a033c..0000000000 --- a/indra/newview/icons/development/secondlife_16.png +++ /dev/null diff --git a/indra/newview/icons/development/secondlife_256.BMP b/indra/newview/icons/development/secondlife_256.BMP Binary files differdeleted file mode 100755 index 174b22319a..0000000000 --- a/indra/newview/icons/development/secondlife_256.BMP +++ /dev/null diff --git a/indra/newview/icons/development/secondlife_256.png b/indra/newview/icons/development/secondlife_256.png Binary files differdeleted file mode 100755 index 29ed40abdc..0000000000 --- a/indra/newview/icons/development/secondlife_256.png +++ /dev/null diff --git a/indra/newview/icons/development/secondlife_32.png b/indra/newview/icons/development/secondlife_32.png Binary files differdeleted file mode 100755 index 3b84f5ec77..0000000000 --- a/indra/newview/icons/development/secondlife_32.png +++ /dev/null diff --git a/indra/newview/icons/development/secondlife_48.png b/indra/newview/icons/development/secondlife_48.png Binary files differdeleted file mode 100755 index d2636d9d72..0000000000 --- a/indra/newview/icons/development/secondlife_48.png +++ /dev/null diff --git a/indra/newview/icons/development/secondlife_512.png b/indra/newview/icons/development/secondlife_512.png Binary files differdeleted file mode 100755 index 75f9b231f4..0000000000 --- a/indra/newview/icons/development/secondlife_512.png +++ /dev/null diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh index 9e2e37c202..d8440eebf1 100755 --- a/indra/newview/linux_tools/wrapper.sh +++ b/indra/newview/linux_tools/wrapper.sh @@ -122,7 +122,7 @@ export SAVED_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" export LD_LIBRARY_PATH="$PWD/lib:${LD_LIBRARY_PATH}" # Have to deal specially with gridargs.dat; typical contents look like: -# --channel "Second Life Developer" --settings settings_developer.xml +# --channel "Second Life Test" --settings settings_test.xml # Simply embedding $(<etc/gridargs.dat) into a command line treats each of # Second, Life and Developer as separate args -- no good. We need bash to # process quotes using eval. @@ -144,7 +144,7 @@ done # therefore "${gridargs[@]}" entirely vanishes from the command line below, # just as we want. if ! $skip_gridargs ; then -eval gridargs=("$(<etc/gridargs.dat)") + eval gridargs=("$(<etc/gridargs.dat)") fi # Run the program. diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index dc706147a9..9ac80dd6c0 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -30,7 +30,6 @@ // Viewer includes #include "llversioninfo.h" -#include "llversionviewer.h" #include "llfeaturemanager.h" #include "lluictrlfactory.h" #include "lltexteditor.h" @@ -123,6 +122,7 @@ #include <boost/bind.hpp> #include <boost/foreach.hpp> #include <boost/algorithm/string.hpp> +#include <boost/regex.hpp> #if LL_WINDOWS @@ -252,6 +252,7 @@ static LLAppViewerListener sAppViewerListener(LLAppViewer::instance); // viewer.cpp - these are only used in viewer, should be easily moved. #if LL_DARWIN +const char * const LL_VERSION_BUNDLE_ID = "com.secondlife.indra.viewer"; extern void init_apple_menu(const char* product); #endif // LL_DARWIN @@ -269,6 +270,20 @@ BOOL gShowObjectUpdates = FALSE; BOOL gUseQuickTime = TRUE; eLastExecEvent gLastExecEvent = LAST_EXEC_NORMAL; +S32 gLastExecDuration = -1; // (<0 indicates unknown) + +#if LL_WINDOWS +# define LL_PLATFORM_KEY "win" +#elif LL_DARWIN +# define LL_PLATFORM_KEY "mac" +#elif LL_LINUX +# define LL_PLATFORM_KEY "lnx" +#elif LL_SOLARIS +# define LL_PLATFORM_KEY "sol" +#else +# error "Unknown Platform" +#endif +const char* gPlatform = LL_PLATFORM_KEY; LLSD gDebugInfo; @@ -328,8 +343,9 @@ BOOL gLogoutInProgress = FALSE; //////////////////////////////////////////////////////////// // Internal globals... that should be removed. static std::string gArgs; - +const int MAX_MARKER_LENGTH = 1024; const std::string MARKER_FILE_NAME("SecondLife.exec_marker"); +const std::string START_MARKER_FILE_NAME("SecondLife.start_marker"); const std::string ERROR_MARKER_FILE_NAME("SecondLife.error_marker"); const std::string LLERROR_MARKER_FILE_NAME("SecondLife.llerror_marker"); const std::string LOGOUT_MARKER_FILE_NAME("SecondLife.logout_marker"); @@ -642,7 +658,7 @@ LLTextureFetch* LLAppViewer::sTextureFetch = NULL; LLAppViewer::LLAppViewer() : mMarkerFile(), - mLogoutMarkerFile(NULL), + mLogoutMarkerFile(), mReportedCrash(false), mNumSessions(0), mPurgeCache(false), @@ -672,6 +688,7 @@ LLAppViewer::LLAppViewer() : gLoggedInTime.stop(); LLLoginInstance::instance().setUpdaterService(mUpdater.get()); + LLLoginInstance::instance().setPlatformInfo(gPlatform, getOSInfo().getOSVersionString()); } LLAppViewer::~LLAppViewer() @@ -1780,7 +1797,7 @@ bool LLAppViewer::cleanup() llinfos << "Cleaning up Objects" << llendflush; LLViewerObject::cleanupVOClasses(); - + LLAvatarAppearance::cleanupClass(); LLAvatarAppearance::cleanupClass(); @@ -2108,7 +2125,7 @@ void errorCallback(const std::string &error_string) LLError::crashAndLoop(error_string); } -bool LLAppViewer::initLogging() +void LLAppViewer::initLogging() { // // Set up logging defaults for the viewer @@ -2122,17 +2139,46 @@ bool LLAppViewer::initLogging() "SecondLife.old"); LLFile::remove(old_log_file); - // Rename current log file to ".old" + // Get name of the log file std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log"); + /* + * Before touching any log files, compute the duration of the last run + * by comparing the ctime of the previous start marker file with the ctime + * of the last log file. + */ + std::string start_marker_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, START_MARKER_FILE_NAME); + llstat start_marker_stat; + llstat log_file_stat; + if ( 0 == LLFile::stat(start_marker_file_name, &start_marker_stat) + && 0 == LLFile::stat(log_file, &log_file_stat) + ) + { + int elapsed_seconds = log_file_stat.st_ctime - start_marker_stat.st_ctime; + // only report a last run time if the last viewer was the same version + // because this stat will be counted against this version + gLastExecDuration = markerIsSameVersion(start_marker_file_name) ? elapsed_seconds : -1; + } + else + { + // at least one of the LLFile::stat calls failed, so we can't compute the run time + gLastExecDuration = -1; // unknown + } + + // Create a new start marker file for comparison with log file time for the next run + LLAPRFile start_marker_file ; + start_marker_file.open(start_marker_file_name, LL_APR_W); + if (start_marker_file.getFileHandle()) + { + recordMarkerVersion(start_marker_file); + start_marker_file.close(); + } + + // Rename current log file to ".old" LLFile::rename(log_file, old_log_file); // Set the log file to SecondLife.log - LLError::logToFile(log_file); - - // *FIX:Mani no error handling here! - return true; } bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, @@ -2707,15 +2753,11 @@ bool LLAppViewer::initConfiguration() } } - if (!gSavedSettings.getBOOL("AllowMultipleViewers")) - { // // Check for another instance of the app running // - mSecondInstance = anotherInstanceRunning(); - - if (mSecondInstance) + if (mSecondInstance && !gSavedSettings.getBOOL("AllowMultipleViewers")) { std::ostringstream msg; msg << LLTrans::getString("MBAlreadyRunning"); @@ -2728,12 +2770,6 @@ bool LLAppViewer::initConfiguration() initMarkerFile(); - checkForCrash(); - } - else - { - mSecondInstance = anotherInstanceRunning(); - if (mSecondInstance) { // This is the second instance of SL. Turn off voice support, @@ -2745,14 +2781,10 @@ bool LLAppViewer::initConfiguration() disable_voice->setValue(LLSD(TRUE), DO_NOT_PERSIST); } } - - initMarkerFile(); - - if(!mSecondInstance) + else { checkForCrash(); } - } // NextLoginLocation is set from the command line option std::string nextLoginLocation = gSavedSettings.getString( "NextLoginLocation" ); @@ -2858,25 +2890,46 @@ namespace { std::string notification_name; void (*apply_callback)(LLSD const &, LLSD const &) = NULL; + /* Build up the notification name... + * it can be any of these, which are included here for the sake of grep: + * RequiredUpdateDownloadedDialog + * RequiredUpdateDownloadedVerboseDialog + * OtherChannelRequiredUpdateDownloadedDialog + * OtherChannelRequiredUpdateDownloadedVerbose + * DownloadBackgroundTip + * DownloadBackgroundDialog + * OtherChannelDownloadBackgroundTip + * OtherChannelDownloadBackgroundDialog + */ + { + LL_DEBUGS("UpdaterService") << "data = "; + std::ostringstream data_dump; + LLSDSerialize::toNotation(data, data_dump); + LL_CONT << data_dump.str() << LL_ENDL; + } + if(data["channel"].asString() != LLVersionInfo::getChannel()) + { + notification_name.append("OtherChannel"); + } if(data["required"].asBoolean()) { if(LLStartUp::getStartupState() <= STATE_LOGIN_WAIT) { // The user never saw the progress bar. apply_callback = &apply_update_ok_callback; - notification_name = "RequiredUpdateDownloadedVerboseDialog"; + notification_name += "RequiredUpdateDownloadedVerboseDialog"; } else if(LLStartUp::getStartupState() < STATE_WORLD_INIT) { // The user is logging in but blocked. apply_callback = &apply_update_ok_callback; - notification_name = "RequiredUpdateDownloadedDialog"; + notification_name += "RequiredUpdateDownloadedDialog"; } else { // The user is already logged in; treat like an optional update. apply_callback = &apply_update_callback; - notification_name = "DownloadBackgroundTip"; + notification_name += "DownloadBackgroundTip"; } } else @@ -2886,16 +2939,26 @@ namespace { { // CHOP-262 we need to use a different notification // method prior to login. - notification_name = "DownloadBackgroundDialog"; + notification_name += "DownloadBackgroundDialog"; } else { - notification_name = "DownloadBackgroundTip"; + notification_name += "DownloadBackgroundTip"; } } LLSD substitutions; substitutions["VERSION"] = data["version"]; + std::string new_channel = data["channel"].asString(); + substitutions["NEW_CHANNEL"] = new_channel; + std::string info_url = data["info_url"].asString(); + if ( !info_url.empty() ) + { + substitutions["INFO_URL"] = info_url; + } + else + { + LL_WARNS("UpdaterService") << "no info url supplied - defaulting to hard coded release notes pattern" << LL_ENDL; // truncate version at the rightmost '.' std::string version_short(data["version"]); @@ -2914,7 +2977,8 @@ namespace { relnotes_url.setArg("[CHANNEL_URL]", channel_escaped.get()); relnotes_url.setArg("[RELEASE_NOTES_BASE_URL]", LLTrans::getString("RELEASE_NOTES_BASE_URL")); - substitutions["RELEASE_NOTES_FULL_URL"] = relnotes_url.getString(); + substitutions["INFO_URL"] = relnotes_url.getString(); + } LLNotificationsUtil::add(notification_name, substitutions, LLSD(), apply_callback); } @@ -2963,16 +3027,40 @@ void LLAppViewer::initUpdater() std::string url = gSavedSettings.getString("UpdaterServiceURL"); std::string channel = LLVersionInfo::getChannel(); std::string version = LLVersionInfo::getVersion(); - std::string protocol_version = gSavedSettings.getString("UpdaterServiceProtocolVersion"); std::string service_path = gSavedSettings.getString("UpdaterServicePath"); U32 check_period = gSavedSettings.getU32("UpdaterServiceCheckPeriod"); + bool willing_to_test; + LL_DEBUGS("UpdaterService") << "channel " << channel << LL_ENDL; + static const boost::regex is_test_channel("\\bTest$"); + if (boost::regex_search(channel, is_test_channel)) + { + LL_INFOS("UpdaterService") << "Test build: overriding willing_to_test by sending testno" << LL_ENDL; + willing_to_test = false; + } + else + { + willing_to_test = gSavedSettings.getBOOL("UpdaterWillingToTest"); + } + unsigned char unique_id[MD5HEX_STR_SIZE]; + if ( ! llHashedUniqueID(unique_id) ) + { + if ( willing_to_test ) + { + LL_WARNS("UpdaterService") << "Unable to provide a unique id; overriding willing_to_test by sending testno" << LL_ENDL; + } + willing_to_test = false; + } mUpdater->setAppExitCallback(boost::bind(&LLAppViewer::forceQuit, this)); - mUpdater->initialize(protocol_version, - url, + mUpdater->initialize(url, service_path, channel, - version); + version, + gPlatform, + getOSInfo().getOSVersionString(), + unique_id, + willing_to_test + ); mUpdater->setCheckPeriod(check_period); mUpdater->setBandwidthLimit((int)gSavedSettings.getF32("UpdaterMaximumBandwidth") * (1024/8)); gSavedSettings.getControl("UpdaterMaximumBandwidth")->getSignal()-> @@ -3230,8 +3318,8 @@ void LLAppViewer::writeSystemInfo() } // Dump some debugging info - LL_INFOS("SystemInfo") << LLTrans::getString("APP_NAME") - << " version " << LLVersionInfo::getShortVersion() << LL_ENDL; + LL_INFOS("SystemInfo") << "Application: " << LLTrans::getString("APP_NAME") << LL_ENDL; + LL_INFOS("SystemInfo") << "Version: " << LLVersionInfo::getChannelAndVersion() << LL_ENDL; // Dump the local time and time zone time_t now; @@ -3357,22 +3445,27 @@ void LLAppViewer::handleViewerCrash() //we're already in a crash situation if (gDirUtilp) { - std::string crash_file_name; - if(gLLErrorActivated) crash_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,LLERROR_MARKER_FILE_NAME); - else crash_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,ERROR_MARKER_FILE_NAME); - llinfos << "Creating crash marker file " << crash_file_name << llendl; + std::string crash_file_name = ( gLLErrorActivated ) + ? gDirUtilp->getExpandedFilename(LL_PATH_LOGS,LLERROR_MARKER_FILE_NAME) + : gDirUtilp->getExpandedFilename(LL_PATH_LOGS,ERROR_MARKER_FILE_NAME); + LL_INFOS("MarkerFile") << "Creating crash marker file " << crash_file_name << LL_ENDL; LLAPRFile crash_file ; crash_file.open(crash_file_name, LL_APR_W); if (crash_file.getFileHandle()) { LL_INFOS("MarkerFile") << "Created crash marker file " << crash_file_name << LL_ENDL; + recordMarkerVersion(crash_file); } else { LL_WARNS("MarkerFile") << "Cannot create error marker file " << crash_file_name << LL_ENDL; } } + else + { + LL_WARNS("MarkerFile") << "No gDirUtilp with which to create error marker file name" << LL_ENDL; + } if (gMessageSystem && gDirUtilp) { @@ -3424,14 +3517,14 @@ bool LLAppViewer::anotherInstanceRunning() // If the file is currently locked, that means another process is already running. std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, MARKER_FILE_NAME); - LL_DEBUGS("MarkerFile") << "Checking marker file for lock..." << LL_ENDL; + LL_DEBUGS("MarkerFile") << "Checking marker file '"<< marker_file << "' for lock..." << LL_ENDL; //Freeze case checks if (LLAPRFile::isExist(marker_file, NULL, LL_APR_RB)) { // File exists, try opening with write permissions LLAPRFile outfile ; - outfile.open(marker_file, LL_APR_WB); + outfile.open(marker_file, LL_APR_AB); apr_file_t* fMarker = outfile.getFileHandle() ; if (!fMarker) { @@ -3450,6 +3543,46 @@ bool LLAppViewer::anotherInstanceRunning() return false; } +// static +void LLAppViewer::recordMarkerVersion(LLAPRFile& marker_file) +{ + std::string marker_version(LLVersionInfo::getChannelAndVersion()); + if ( marker_version.length() > MAX_MARKER_LENGTH ) + { + LL_WARNS_ONCE("MarkerFile") << "Version length ("<< marker_version.length()<< ") greater than maximum: marker matching may be incorrect" << LL_ENDL; + } + + // record the viewer version in the marker file + marker_file.write(marker_version.data(), marker_version.length()); +} + +bool LLAppViewer::markerIsSameVersion(const std::string& marker_name) const +{ + bool sameVersion = false; + + std::string my_version(LLVersionInfo::getChannelAndVersion()); + char marker_version[MAX_MARKER_LENGTH]; + S32 marker_version_length; + + LLAPRFile marker_file; + marker_file.open(marker_name, LL_APR_RB); + if (marker_file.getFileHandle()) + { + marker_version_length = marker_file.read(marker_version, sizeof(marker_version)); + LL_DEBUGS("MarkerFile") << "Compare markers: "; + std::string marker_string(marker_version, marker_version_length); + LL_CONT << "\n mine '" << my_version << "'" + << "\n marker '" << marker_string << "'" + << LL_ENDL; + if ( 0 == my_version.compare( 0, my_version.length(), marker_version, 0, marker_version_length ) ) + { + sameVersion = true; + } + marker_file.close(); + } + return sameVersion; +} + void LLAppViewer::initMarkerFile() { //First, check for the existence of other files. @@ -3472,27 +3605,55 @@ void LLAppViewer::initMarkerFile() if (LLAPRFile::isExist(mMarkerFileName, NULL, LL_APR_RB) && !anotherInstanceRunning()) { + if ( markerIsSameVersion(mMarkerFileName) ) + { + LL_INFOS("MarkerFile") << "Exec marker '"<< mMarkerFileName << "' found" << LL_ENDL; gLastExecEvent = LAST_EXEC_FROZE; - LL_INFOS("MarkerFile") << "Exec marker found: program froze on previous execution" << LL_ENDL; + } + else + { + LL_INFOS("MarkerFile") << "Exec marker '"<< mMarkerFileName << "' found, but versions did not match" << LL_ENDL; + } } if(LLAPRFile::isExist(logout_marker_file, NULL, LL_APR_RB)) { + if (markerIsSameVersion(logout_marker_file)) + { gLastExecEvent = LAST_EXEC_LOGOUT_FROZE; - LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL; + LL_INFOS("MarkerFile") << "Logout crashed '"<< logout_marker_file << "', setting LastExecEvent to " << gLastExecEvent << LL_ENDL; + } + else + { + LL_INFOS("MarkerFile") << "Logout crash marker '"<< logout_marker_file << "' found, but versions did not match" << LL_ENDL; + } LLAPRFile::remove(logout_marker_file); } if(LLAPRFile::isExist(llerror_marker_file, NULL, LL_APR_RB)) { - if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; - else gLastExecEvent = LAST_EXEC_LLERROR_CRASH; - LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL; + if (markerIsSameVersion(llerror_marker_file)) + { + gLastExecEvent = ( gLastExecEvent == LAST_EXEC_LOGOUT_FROZE ) + ? LAST_EXEC_LOGOUT_CRASH : LAST_EXEC_LLERROR_CRASH; + LL_INFOS("MarkerFile") << "Last exec LLError '"<< llerror_marker_file << "' crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL; + } + else + { + LL_INFOS("MarkerFile") << "Last exec LLError marker '"<< llerror_marker_file << "' found, but versions did not match" << LL_ENDL; + } LLAPRFile::remove(llerror_marker_file); } if(LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB)) { - if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; - else gLastExecEvent = LAST_EXEC_OTHER_CRASH; - LL_INFOS("MarkerFile") << "Last exec crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL; + if (markerIsSameVersion(error_marker_file)) + { + gLastExecEvent = (gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) + ? LAST_EXEC_LOGOUT_CRASH : LAST_EXEC_OTHER_CRASH; + LL_INFOS("MarkerFile") << "Last exec '"<< error_marker_file << "' crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL; + } + else + { + LL_INFOS("MarkerFile") << "Last exec '"<< error_marker_file << "' marker found, but versions did not match" << LL_ENDL; + } LLAPRFile::remove(error_marker_file); } @@ -3508,35 +3669,48 @@ void LLAppViewer::initMarkerFile() if (s == APR_SUCCESS && mMarkerFile.getFileHandle()) { - LL_DEBUGS("MarkerFile") << "Marker file created." << LL_ENDL; + LL_DEBUGS("MarkerFile") << "Marker file '"<< mMarkerFileName << "' created." << LL_ENDL; + if (APR_SUCCESS == apr_file_lock(mMarkerFile.getFileHandle(), APR_FLOCK_NONBLOCK | APR_FLOCK_EXCLUSIVE)) + { + recordMarkerVersion(mMarkerFile); + LL_DEBUGS("MarkerFile") << "Marker file locked." << LL_ENDL; } else { - LL_INFOS("MarkerFile") << "Failed to create marker file." << LL_ENDL; - return; + LL_INFOS("MarkerFile") << "Marker file cannot be locked." << LL_ENDL; + } } - if (apr_file_lock(mMarkerFile.getFileHandle(), APR_FLOCK_NONBLOCK | APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) + else { - mMarkerFile.close() ; - LL_INFOS("MarkerFile") << "Marker file cannot be locked." << LL_ENDL; - return; + LL_INFOS("MarkerFile") << "Failed to create marker file '"<< mMarkerFileName << "'." << LL_ENDL; } - - LL_DEBUGS("MarkerFile") << "Marker file locked." << LL_ENDL; } void LLAppViewer::removeMarkerFile(bool leave_logout_marker) { - LL_DEBUGS("MarkerFile") << "removeMarkerFile()" << LL_ENDL; + LL_DEBUGS("MarkerFile") << "removeMarkerFile("<<leave_logout_marker<<")" << LL_ENDL; if (mMarkerFile.getFileHandle()) { + LL_DEBUGS("MarkerFile") << "removeMarkerFile marker '"<<mMarkerFileName<<"'"<< LL_ENDL; mMarkerFile.close() ; LLAPRFile::remove( mMarkerFileName ); } - if (mLogoutMarkerFile != NULL && !leave_logout_marker) + else + { + LL_WARNS("MarkerFile") << "removeMarkerFile marker '"<<mMarkerFileName<<"' not open"<< LL_ENDL; + } + if (!leave_logout_marker) { + if (mLogoutMarkerFile.getFileHandle()) + { + LL_DEBUGS("MarkerFile") << "removeMarkerFile marker '"<<mLogoutMarkerFileName<<"'"<< LL_ENDL; + mLogoutMarkerFile.close(); + } + else + { + LL_WARNS("MarkerFile") << "removeMarkerFile marker '"<<mLogoutMarkerFileName<<"' not open"<< LL_ENDL; + } LLAPRFile::remove( mLogoutMarkerFileName ); - mLogoutMarkerFile = NULL; } } @@ -3584,7 +3758,7 @@ void LLAppViewer::requestQuit() // Try to send metrics back to the grid metricsSend(!gDisconnected); - + // Try to send last batch of avatar rez metrics. if (!gDisconnected && isAgentAvatarValid()) { @@ -4756,16 +4930,15 @@ void LLAppViewer::sendLogoutRequest() mLogoutMarkerFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,LOGOUT_MARKER_FILE_NAME); LLAPRFile outfile ; - outfile.open(mLogoutMarkerFileName, LL_APR_W); - mLogoutMarkerFile = outfile.getFileHandle() ; - if (mLogoutMarkerFile) + mLogoutMarkerFile.open(mLogoutMarkerFileName, LL_APR_W); + if (mLogoutMarkerFile.getFileHandle()) { - llinfos << "Created logout marker file " << mLogoutMarkerFileName << llendl; - apr_file_close(mLogoutMarkerFile); + LL_INFOS("MarkerFile") << "Created logout marker file '"<< mLogoutMarkerFileName << "' " << mLogoutMarkerFileName << LL_ENDL; + recordMarkerVersion(outfile); } else { - llwarns << "Cannot create logout marker file " << mLogoutMarkerFileName << llendl; + LL_WARNS("MarkerFile") << "Cannot create logout marker file " << mLogoutMarkerFileName << LL_ENDL; } } } @@ -5163,16 +5336,8 @@ void LLAppViewer::handleLoginComplete() void LLAppViewer::launchUpdater() { LLSD query_map = LLSD::emptyMap(); - // *TODO place os string in a global constant -#if LL_WINDOWS - query_map["os"] = "win"; -#elif LL_DARWIN - query_map["os"] = "mac"; -#elif LL_LINUX - query_map["os"] = "lnx"; -#elif LL_SOLARIS - query_map["os"] = "sol"; -#endif + query_map["os"] = gPlatform; + // *TODO change userserver to be grid on both viewer and sim, since // userserver no longer exists. query_map["userserver"] = LLGridManager::getInstance()->getGridId(); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 08039100b3..d3a8cf24d9 100755 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -183,7 +183,7 @@ public: protected: virtual bool initWindow(); // Initialize the viewer's window. - virtual bool initLogging(); // Initialize log files, logging system, return false on failure. + virtual void initLogging(); // Initialize log files, logging system virtual void initConsole() {}; // Initialize OS level debugging console. virtual bool initHardwareTest() { return true; } // A false result indicates the app should quit. virtual bool initSLURLHandler(); @@ -217,7 +217,9 @@ private: bool anotherInstanceRunning(); void initMarkerFile(); - + static void recordMarkerVersion(LLAPRFile& marker_file); + bool markerIsSameVersion(const std::string& marker_name) const; + void idle(); void idleShutdown(); // update avatar SLID and display name caches @@ -237,7 +239,7 @@ private: LLAPRFile mMarkerFile; // A file created to indicate the app is running. std::string mLogoutMarkerFileName; - apr_file_t* mLogoutMarkerFile; // A file created to indicate the app is running. + LLAPRFile mLogoutMarkerFile; // A file created to indicate the app is running. LLOSInfo mSysOSInfo; @@ -321,6 +323,9 @@ typedef enum } eLastExecEvent; extern eLastExecEvent gLastExecEvent; // llstartup +extern S32 gLastExecDuration; ///< the duration of the previous run in seconds (<0 indicates unknown) + +extern const char* gPlatform; extern U32 gFrameCount; extern U32 gForegroundFrameCount; diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index 8695652168..5f98fd0a34 100755 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -440,7 +440,7 @@ bool LLAppViewerLinux::beingDebugged() #endif } -bool LLAppViewerLinux::initLogging() +void LLAppViewerLinux::initLogging() { // Remove the last stack trace, if any // This file is no longer created, since the move to Google Breakpad @@ -449,7 +449,7 @@ bool LLAppViewerLinux::initLogging() gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log"); LLFile::remove(old_stack_file); - return LLAppViewer::initLogging(); + LLAppViewer::initLogging(); } bool LLAppViewerLinux::initParseCommandLine(LLCommandLineParser& clp) diff --git a/indra/newview/llappviewerlinux.h b/indra/newview/llappviewerlinux.h index 58e5160180..b30977acb3 100755 --- a/indra/newview/llappviewerlinux.h +++ b/indra/newview/llappviewerlinux.h @@ -63,7 +63,7 @@ protected: virtual bool restoreErrorTrap(); virtual void handleCrashReporting(bool reportFreeze); - virtual bool initLogging(); + virtual void initLogging(); virtual bool initParseCommandLine(LLCommandLineParser& clp); virtual bool initSLURLHandler(); diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 82b93b52a2..0ba3669487 100755 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -509,9 +509,9 @@ bool LLAppViewerWin32::cleanup() return result; } -bool LLAppViewerWin32::initLogging() +void LLAppViewerWin32::initLogging() { - return LLAppViewer::initLogging(); + LLAppViewer::initLogging(); } void LLAppViewerWin32::initConsole() diff --git a/indra/newview/llappviewerwin32.h b/indra/newview/llappviewerwin32.h index 67594aea48..d95174dd1d 100755 --- a/indra/newview/llappviewerwin32.h +++ b/indra/newview/llappviewerwin32.h @@ -44,7 +44,7 @@ public: virtual bool cleanup(); protected: - virtual bool initLogging(); // Override to clean stack_trace info. + virtual void initLogging(); // Override to clean stack_trace info. virtual void initConsole(); // Initialize OS level debugging console. virtual bool initHardwareTest(); // Win32 uses DX9 to test hardware. virtual bool initParseCommandLine(LLCommandLineParser& clp); diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index 289abd3335..c3f6d77edc 100755 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -286,7 +286,6 @@ public: NEARBY_LIGHT = 0x00200000, // In gPipeline.mNearbyLightSet BUILT = 0x00400000, FORCE_INVISIBLE = 0x00800000, // stay invis until CLEAR_INVISIBLE is set (set of orphaned) - CLEAR_INVISIBLE = 0x01000000, // clear FORCE_INVISIBLE next draw frame REBUILD_SHADOW = 0x02000000, HAS_ALPHA = 0x04000000, RIGGED = 0x08000000, diff --git a/indra/newview/llhasheduniqueid.cpp b/indra/newview/llhasheduniqueid.cpp new file mode 100644 index 0000000000..03192d3e61 --- /dev/null +++ b/indra/newview/llhasheduniqueid.cpp @@ -0,0 +1,55 @@ +/** + * @file llhasheduniqueid.cpp + * @brief retrieves an obfuscated unique id for the system + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llhasheduniqueid.h" +#include "llviewernetwork.h" +#include "lluuid.h" +#include "llmachineid.h" + +bool llHashedUniqueID(unsigned char id[MD5HEX_STR_SIZE]) +{ + bool idIsUnique = true; + LLMD5 hashed_unique_id; + unsigned char unique_id[MAC_ADDRESS_BYTES]; + if ( LLUUID::getNodeID(unique_id) + || LLMachineID::getUniqueID(unique_id, sizeof(unique_id)) + ) + { + hashed_unique_id.update(unique_id, MAC_ADDRESS_BYTES); + hashed_unique_id.finalize(); + hashed_unique_id.hex_digest((char*)id); + LL_INFOS_ONCE("AppInit") << "System ID " << id << LL_ENDL; + } + else + { + idIsUnique = false; + memcpy(id,"00000000000000000000000000000000", MD5HEX_STR_SIZE); + LL_WARNS_ONCE("AppInit") << "Failed to get an id; cannot uniquely identify this machine." << LL_ENDL; + } + return idIsUnique; +} + diff --git a/indra/newview/llhasheduniqueid.h b/indra/newview/llhasheduniqueid.h new file mode 100644 index 0000000000..8ef706c1f3 --- /dev/null +++ b/indra/newview/llhasheduniqueid.h @@ -0,0 +1,34 @@ +/** + * @file llhasheduniqueid.h + * @brief retrieves obfuscated but unique id for the system + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ +#ifndef LL_LLHASHEDUNIQUEID_H +#define LL_LLHASHEDUNIQUEID_H +#include "llmd5.h" + +/// Get an obfuscated identifier for this system +bool llHashedUniqueID(unsigned char id[MD5HEX_STR_SIZE]); +///< @returns true if the id is considered valid (if false, the id is all zeros) + +#endif // LL_LLHASHEDUNIQUEID_H diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 419641d23c..977c50682f 100755 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -30,7 +30,6 @@ // llcommon #include "llevents.h" -#include "llmd5.h" #include "stringize.h" // llmessage (!) @@ -40,6 +39,7 @@ #include "lllogin.h" // newview +#include "llhasheduniqueid.h" #include "llviewernetwork.h" #include "llviewercontrol.h" #include "llversioninfo.h" @@ -202,7 +202,7 @@ MandatoryUpdateMachine::MandatoryUpdateMachine(LLLoginInstance & loginInstance, void MandatoryUpdateMachine::start(void) { - llinfos << "starting manditory update machine" << llendl; + llinfos << "starting mandatory update machine" << llendl; if(mUpdaterService.isChecking()) { switch(mUpdaterService.getState()) { @@ -488,6 +488,13 @@ LLLoginInstance::LLLoginInstance() : mDispatcher.add("indeterminate", "", boost::bind(&LLLoginInstance::handleIndeterminate, this, _1)); } +void LLLoginInstance::setPlatformInfo(const std::string platform, + const std::string platform_version) +{ + mPlatform = platform; + mPlatformVersion = platform_version; +} + LLLoginInstance::~LLLoginInstance() { } @@ -579,26 +586,22 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia // (re)initialize the request params with creds. LLSD request_params = user_credential->getLoginParams(); - char hashed_unique_id_string[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ - LLMD5 hashed_unique_id; - unsigned char unique_id[MAC_ADDRESS_BYTES]; - if(LLUUID::getNodeID(unique_id) == 0) { - if(LLMachineID::getUniqueID(unique_id, sizeof(unique_id)) == 0) { - llerrs << "Failed to get an id; cannot uniquely identify this machine." << llendl; - } + unsigned char hashed_unique_id_string[MD5HEX_STR_SIZE]; + if ( ! llHashedUniqueID(hashed_unique_id_string) ) + { + llwarns << "Not providing a unique id in request params" << llendl; } - hashed_unique_id.update(unique_id, MAC_ADDRESS_BYTES); - hashed_unique_id.finalize(); - hashed_unique_id.hex_digest(hashed_unique_id_string); - request_params["start"] = construct_start_string(); request_params["skipoptional"] = mSkipOptionalUpdate; request_params["agree_to_tos"] = false; // Always false here. Set true in request_params["read_critical"] = false; // handleTOSResponse request_params["last_exec_event"] = mLastExecEvent; - request_params["mac"] = hashed_unique_id_string; - request_params["version"] = LLVersionInfo::getChannelAndVersion(); // Includes channel name + request_params["last_exec_duration"] = mLastExecDuration; + request_params["mac"] = (char*)hashed_unique_id_string; + request_params["version"] = LLVersionInfo::getVersion(); request_params["channel"] = LLVersionInfo::getChannel(); + request_params["platform"] = mPlatform; + request_params["platform_version"] = mPlatformVersion; request_params["id0"] = mSerialNumber; request_params["host_id"] = gSavedSettings.getString("HostID"); request_params["extended_errors"] = true; // request message_id and message_args @@ -784,20 +787,20 @@ void LLLoginInstance::updateApp(bool mandatory, const std::string& auth_msg) LLSD payload; payload["mandatory"] = mandatory; -/* - We're constructing one of the following 9 strings here: - "DownloadWindowsMandatory" - "DownloadWindowsReleaseForDownload" - "DownloadWindows" - "DownloadMacMandatory" - "DownloadMacReleaseForDownload" - "DownloadMac" - "DownloadLinuxMandatory" - "DownloadLinuxReleaseForDownload" - "DownloadLinux" - - I've called them out explicitly in this comment so that they can be grepped for. - */ + /* + * We're constructing one of the following 9 strings here: + * "DownloadWindowsMandatory" + * "DownloadWindowsReleaseForDownload" + * "DownloadWindows" + * "DownloadMacMandatory" + * "DownloadMacReleaseForDownload" + * "DownloadMac" + * "DownloadLinuxMandatory" + * "DownloadLinuxReleaseForDownload" + * "DownloadLinux" + * + * I've called them out explicitly in this comment so that they can be grepped for. + */ std::string notification_name = "Download"; #if LL_WINDOWS diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index 8b53431219..b0247da7c8 100755 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -66,6 +66,8 @@ public: void setSkipOptionalUpdate(bool state) { mSkipOptionalUpdate = state; } void setSerialNumber(const std::string& sn) { mSerialNumber = sn; } void setLastExecEvent(int lee) { mLastExecEvent = lee; } + void setLastExecDuration(S32 duration) { mLastExecDuration = duration; } + void setPlatformInfo(const std::string platform, const std::string platform_version); void setNotificationsInterface(LLNotificationsInterface* ni) { mNotifications = ni; } @@ -99,6 +101,9 @@ private: F64 mTransferRate; std::string mSerialNumber; int mLastExecEvent; + S32 mLastExecDuration; + std::string mPlatform; + std::string mPlatformVersion; UpdaterLauncherCallback mUpdaterLauncher; LLEventDispatcher mDispatcher; LLUpdaterService * mUpdaterService; diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 837b8687e8..b3b4932b65 100755 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1608,9 +1608,9 @@ void LLPanelFace::getState() // Shiny (specular) F32 offset_x, offset_y, repeat_x, repeat_y, rot; LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("shinytexture control"); - texture_ctrl->setImageAssetID(material->getSpecularID()); + texture_ctrl->setImageAssetID(mMaterial->getSpecularID()); LLComboBox* combobox_shininess = getChild<LLComboBox>("combobox shininess"); - if (!material->getSpecularID().isNull()) + if (!mMaterial->getSpecularID().isNull()) { mMaterial->getSpecularOffset(offset_x,offset_y); mMaterial->getSpecularRepeat(repeat_x,repeat_y); @@ -1635,7 +1635,7 @@ void LLPanelFace::getState() // Assert desired colorswatch color to match material AFTER updateShinyControls // to avoid getting overwritten with the default on some UI state changes. // - if (!material->getSpecularID().isNull()) + if (!mMaterial->getSpecularID().isNull()) { getChild<LLColorSwatchCtrl>("shinycolorswatch")->setOriginal(mMaterial->getSpecularLightColor()); getChild<LLColorSwatchCtrl>("shinycolorswatch")->set(mMaterial->getSpecularLightColor(),TRUE); @@ -1656,7 +1656,7 @@ void LLPanelFace::getState() repeat_y *= 2.0f; } - rot = material->getNormalRotation(); + rot = mMaterial->getNormalRotation(); getChild<LLUICtrl>("bumpyScaleU")->setValue(repeat_x); getChild<LLUICtrl>("bumpyScaleV")->setValue(repeat_y); getChild<LLUICtrl>("bumpyRot")->setValue(rot*RAD_TO_DEG); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index f6da44d8a7..cff3a7e02a 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -26,6 +26,7 @@ #include "llviewerprecompiledheaders.h" +#include "llappviewer.h" #include "llstartup.h" #if LL_WINDOWS @@ -1032,6 +1033,7 @@ bool idle_startup() login->setSerialNumber(LLAppViewer::instance()->getSerialNumber()); login->setLastExecEvent(gLastExecEvent); + login->setLastExecDuration(gLastExecDuration); login->setUpdaterLauncher(boost::bind(&LLAppViewer::launchUpdater, LLAppViewer::instance())); // This call to LLLoginInstance::connect() starts the diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index 673d0c24cf..6a8fad0134 100755 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -26,73 +26,76 @@ */ #include "llviewerprecompiledheaders.h" +#include <iostream> +#include <sstream> #include "llversioninfo.h" -#include "llversionviewer.h" +#if ! defined(LL_VIEWER_CHANNEL) \ + || ! defined(LL_VIEWER_VERSION_MAJOR) \ + || ! defined(LL_VIEWER_VERSION_MINOR) \ + || ! defined(LL_VIEWER_VERSION_PATCH) \ + || ! defined(LL_VIEWER_VERSION_BUILD) + #error "Channel or Version information is undefined" +#endif + +const char * const LL_CHANNEL = LL_VIEWER_CHANNEL; // -// Set the version numbers in indra/llcommon/llversionviewer.h +// Set the version numbers in indra/VIEWER_VERSION // //static S32 LLVersionInfo::getMajor() { - return LL_VERSION_MAJOR; + return LL_VIEWER_VERSION_MAJOR; } //static S32 LLVersionInfo::getMinor() { - return LL_VERSION_MINOR; + return LL_VIEWER_VERSION_MINOR; } //static S32 LLVersionInfo::getPatch() { - return LL_VERSION_PATCH; + return LL_VIEWER_VERSION_PATCH; } //static S32 LLVersionInfo::getBuild() { - return LL_VERSION_BUILD; + return LL_VIEWER_VERSION_BUILD; } //static const std::string &LLVersionInfo::getVersion() { static std::string version(""); - if (version.empty()) { - // cache the version string std::ostringstream stream; - stream << LL_VERSION_MAJOR << "." - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VERSION_BUILD; + stream << LLVersionInfo::getShortVersion() << "." << LLVersionInfo::getBuild(); + // cache the version string version = stream.str(); } - return version; } //static const std::string &LLVersionInfo::getShortVersion() { - static std::string version(""); - - if (version.empty()) + static std::string short_version(""); + if(short_version.empty()) { // cache the version string std::ostringstream stream; - stream << LL_VERSION_MAJOR << "." - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH; - version = stream.str(); + stream << LL_VIEWER_VERSION_MAJOR << "." + << LL_VIEWER_VERSION_MINOR << "." + << LL_VIEWER_VERSION_PATCH; + short_version = stream.str(); } - - return version; + return short_version; } namespace @@ -100,7 +103,7 @@ namespace /// Storage of the channel name the viewer is using. // The channel name is set by hardcoded constant, // or by calling LLVersionInfo::resetChannel() - std::string sWorkingChannelName(LL_CHANNEL); + std::string sWorkingChannelName(LL_VIEWER_CHANNEL); // Storage for the "version and channel" string. // This will get reset too. @@ -113,11 +116,7 @@ const std::string &LLVersionInfo::getChannelAndVersion() if (sVersionChannel.empty()) { // cache the version string - std::ostringstream stream; - stream << LLVersionInfo::getChannel() - << " " - << LLVersionInfo::getVersion(); - sVersionChannel = stream.str(); + sVersionChannel = LLVersionInfo::getChannel() + " " + LLVersionInfo::getVersion(); } return sVersionChannel; diff --git a/indra/newview/llversioninfo.h b/indra/newview/llversioninfo.h index 6f64544f3b..077105cae8 100755 --- a/indra/newview/llversioninfo.h +++ b/indra/newview/llversioninfo.h @@ -29,6 +29,7 @@ #define LL_LLVERSIONINFO_H #include <string> +#include "stdtypes.h" /// /// This API provides version information for the viewer. This diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3c0d6189ac..ace16396db 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -163,7 +163,11 @@ const std::string SCRIPT_QUESTIONS[SCRIPT_PERMISSION_EOF] = "ChangePermissions", "TrackYourCamera", "ControlYourCamera", - "TeleportYourAgent" + "TeleportYourAgent", + "JoinAnExperience", + "SilentlyManageEstateAccess", + "OverrideYourAnimations", + "ScriptReturnObjects" }; const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] = @@ -179,7 +183,11 @@ const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] = FALSE, // ChangePermissions FALSE, // TrackYourCamera, FALSE, // ControlYourCamera - FALSE // TeleportYourAgent + FALSE, // TeleportYourAgent + FALSE, // JoinAnExperience + FALSE, // SilentlyManageEstateAccess + FALSE, // OverrideYourAnimations + FALSE, // ScriptReturnObjects }; bool friendship_offer_callback(const LLSD& notification, const LLSD& response) @@ -6282,6 +6290,19 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp } } +void script_question_mute(const LLUUID& item_id, const std::string& object_name); + +bool unknown_script_question_cb(const LLSD& notification, const LLSD& response) +{ + // Only care if they muted the object here. + if ( response["Mute"] ) // mute + { + LLUUID task_id = notification["payload"]["task_id"].asUUID(); + script_question_mute(task_id,notification["payload"]["object_name"].asString()); + } + return false; +} + bool script_question_cb(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -6332,34 +6353,42 @@ bool script_question_cb(const LLSD& notification, const LLSD& response) if ( response["Mute"] ) // mute { - LLMuteList::getInstance()->add(LLMute(item_id, notification["payload"]["object_name"].asString(), LLMute::OBJECT)); - - // purge the message queue of any previously queued requests from the same source. DEV-4879 - class OfferMatcher : public LLNotificationsUI::LLScreenChannel::Matcher - { - public: - OfferMatcher(const LLUUID& to_block) : blocked_id(to_block) {} - bool matches(const LLNotificationPtr notification) const - { - if (notification->getName() == "ScriptQuestionCaution" - || notification->getName() == "ScriptQuestion") - { - return (notification->getPayload()["item_id"].asUUID() == blocked_id); - } - return false; - } - private: - const LLUUID& blocked_id; - }; - - LLNotificationsUI::LLChannelManager::getInstance()->killToastsFromChannel(LLUUID( - gSavedSettings.getString("NotificationChannelUUID")), OfferMatcher(item_id)); + script_question_mute(task_id,notification["payload"]["object_name"].asString()); } return false; } + +void script_question_mute(const LLUUID& task_id, const std::string& object_name) +{ + LLMuteList::getInstance()->add(LLMute(task_id, object_name, LLMute::OBJECT)); + + // purge the message queue of any previously queued requests from the same source. DEV-4879 + class OfferMatcher : public LLNotificationsUI::LLScreenChannel::Matcher + { + public: + OfferMatcher(const LLUUID& to_block) : blocked_id(to_block) {} + bool matches(const LLNotificationPtr notification) const + { + if (notification->getName() == "ScriptQuestionCaution" + || notification->getName() == "ScriptQuestion" + || notification->getName() == "UnknownScriptQuestion") + { + return (notification->getPayload()["task_id"].asUUID() == blocked_id); + } + return false; + } + private: + const LLUUID& blocked_id; + }; + + LLNotificationsUI::LLChannelManager::getInstance()->killToastsFromChannel(LLUUID( + gSavedSettings.getString("NotificationChannelUUID")), OfferMatcher(task_id)); +} + static LLNotificationFunctorRegistration script_question_cb_reg_1("ScriptQuestion", script_question_cb); static LLNotificationFunctorRegistration script_question_cb_reg_2("ScriptQuestionCaution", script_question_cb); +static LLNotificationFunctorRegistration unknown_script_question_cb_reg("UnknownScriptQuestion", unknown_script_question_cb); void process_script_question(LLMessageSystem *msg, void **user_data) { @@ -6424,7 +6453,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data) LLSD args; args["OBJECTNAME"] = object_name; args["NAME"] = LLCacheName::cleanFullName(owner_name); - + S32 known_questions = 0; BOOL has_not_only_debit = questions ^ LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_DEBIT]; // check the received permission flags against each permission for (S32 i = 0; i < SCRIPT_PERMISSION_EOF; i++) @@ -6432,7 +6461,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data) if (questions & LSCRIPTRunTimePermissionBits[i]) { count++; - + known_questions |= LSCRIPTRunTimePermissionBits[i]; // check whether permission question should cause special caution dialog caution |= (SCRIPT_QUESTION_IS_CAUTION[i]); @@ -6442,32 +6471,46 @@ void process_script_question(LLMessageSystem *msg, void **user_data) script_question += " " + LLTrans::getString(SCRIPT_QUESTIONS[i]) + "\n"; } } + args["QUESTIONS"] = script_question; - LLSD payload; - payload["task_id"] = taskid; - payload["item_id"] = itemid; - payload["sender"] = sender.getIPandPort(); - payload["questions"] = questions; - payload["object_name"] = object_name; - payload["owner_name"] = owner_name; - - // check whether cautions are even enabled or not - if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) + if (known_questions != questions) + { // This is in addition to the normal dialog. + LLSD payload; + payload["task_id"] = taskid; + payload["item_id"] = itemid; + payload["object_name"] = object_name; + + args["DOWNLOADURL"] = LLTrans::getString("ViewerDownloadURL"); + LLNotificationsUtil::add("UnknownScriptQuestion",args,payload); + } + + if (known_questions) { - if (caution) + LLSD payload; + payload["task_id"] = taskid; + payload["item_id"] = itemid; + payload["sender"] = sender.getIPandPort(); + payload["questions"] = known_questions; + payload["object_name"] = object_name; + payload["owner_name"] = owner_name; + + // check whether cautions are even enabled or not + if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) { - args["FOOTERTEXT"] = (count > 1) ? LLTrans::getString("AdditionalPermissionsRequestHeader") + "\n\n" + script_question : ""; + if (caution) + { + args["FOOTERTEXT"] = (count > 1) ? LLTrans::getString("AdditionalPermissionsRequestHeader") + "\n\n" + script_question : ""; + } + // display the caution permissions prompt + LLNotificationsUtil::add(caution ? "ScriptQuestionCaution" : "ScriptQuestion", args, payload); + } + else + { + // fall back to default behavior if cautions are entirely disabled + LLNotificationsUtil::add("ScriptQuestion", args, payload); } - // display the caution permissions prompt - LLNotificationsUtil::add(caution ? "ScriptQuestionCaution" : "ScriptQuestion", args, payload); - } - else - { - // fall back to default behavior if cautions are entirely disabled - LLNotificationsUtil::add("ScriptQuestion", args, payload); } - } } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 548fb236d6..d56df96c44 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2160,7 +2160,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if (mDrawable->isState(LLDrawable::FORCE_INVISIBLE) && !mOrphaned) { // lldebugs << "Clearing force invisible: " << mID << ":" << getPCodeString() << ":" << getPositionAgent() << llendl; - mDrawable->setState(LLDrawable::CLEAR_INVISIBLE); + mDrawable->clearState(LLDrawable::FORCE_INVISIBLE); + gPipeline.markRebuild( mDrawable, LLDrawable::REBUILD_ALL, TRUE ); } } @@ -4149,7 +4150,7 @@ S32 LLViewerObject::setTESpecularMapCore(const U8 te, LLViewerTexture *image) if (mat) { mat->setSpecularID(uuid); - } + } } changeTESpecularMap(te, image); return retval; @@ -4396,11 +4397,11 @@ S32 LLViewerObject::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID // Kitty would like to know if this is necessary? // Since we should get a setTEMaterialParams that does it anyway? // - setChanged(TEXTURE); + setChanged(TEXTURE); if (mDrawable.notNull()) - { - gPipeline.markTextured(mDrawable); - } + { + gPipeline.markTextured(mDrawable); + } return retval; } @@ -4414,19 +4415,19 @@ S32 LLViewerObject::setTEMaterialParams(const U8 te, const LLMaterialPtr pMateri return 0; } - retval = LLPrimitive::setTEMaterialParams(te, pMaterialParams); - LL_DEBUGS("Material") << "Changing material params for te " << (S32)te - << ", object " << mID - << " (" << retval << ")" - << LL_ENDL; - setTENormalMap(te, tep->getMaterialParams()->getNormalID()); - setTESpecularMap(te, tep->getMaterialParams()->getSpecularID()); + retval = LLPrimitive::setTEMaterialParams(te, pMaterialParams); + LL_DEBUGS("Material") << "Changing material params for te " << (S32)te + << ", object " << mID + << " (" << retval << ")" + << LL_ENDL; + setTENormalMap(te, tep->getMaterialParams()->getNormalID()); + setTESpecularMap(te, tep->getMaterialParams()->getSpecularID()); - setChanged(TEXTURE); + setChanged(TEXTURE); if (mDrawable.notNull()) - { - gPipeline.markTextured(mDrawable); - } + { + gPipeline.markTextured(mDrawable); + } return retval; } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 11d34ad084..caacf26cb3 100755 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -2065,8 +2065,9 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port) if (childp->mDrawable.notNull()) { // Make the drawable visible again and set the drawable parent - childp->mDrawable->setState(LLDrawable::CLEAR_INVISIBLE); + childp->mDrawable->clearState(LLDrawable::FORCE_INVISIBLE); childp->setDrawableParent(objectp->mDrawable); // LLViewerObjectList::findOrphans() + gPipeline.markRebuild( childp->mDrawable, LLDrawable::REBUILD_ALL, TRUE ); } // Make certain particles, icon and HUD aren't hidden diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h index 0316f79973..a565005f30 100755 --- a/indra/newview/llviewerprecompiledheaders.h +++ b/indra/newview/llviewerprecompiledheaders.h @@ -33,8 +33,6 @@ // in viewer. // It is used to precompile headers for improved build speed. -#include <boost/coroutine/coroutine.hpp> - #include "linden_common.h" // Work around stupid Microsoft STL warning diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp index 3ff2dfa4fe..2b3e293229 100755 --- a/indra/newview/llviewerstatsrecorder.cpp +++ b/indra/newview/llviewerstatsrecorder.cpp @@ -166,6 +166,7 @@ void LLViewerStatsRecorder::recordRequestCacheMissesEvent(S32 count) void LLViewerStatsRecorder::writeToLog( F32 interval ) { + size_t data_size = 0; F64 delta_time = LLTimer::getTotalSeconds() - mLastSnapshotTime; S32 total_objects = mObjectCacheHitCount + mObjectCacheMissCrcCount + mObjectCacheMissFullCount + mObjectFullUpdates + mObjectTerseUpdates + mObjectCacheMissRequests + mObjectCacheMissResponses + mObjectCacheUpdateDupes + mObjectCacheUpdateChanges + mObjectCacheUpdateAdds + mObjectCacheUpdateReplacements + mObjectUpdateFailures; @@ -216,10 +217,10 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << "Texture Fetch bps\t" << "\n"; - size_t data_size = data_msg.str().size(); - if ( data_size != fwrite(data_msg.str().c_str(), 1, data_size, mObjectCacheFile )) + data_size = data_msg.str().size(); + if (fwrite(data_msg.str().c_str(), 1, data_size, mObjectCacheFile ) != data_size) { - llwarns << "Unable to write complete column headings to " << STATS_FILE_NAME << llendl; + llwarns << "failed to write full headers to " << STATS_FILE_NAME << llendl; } } else @@ -253,11 +254,12 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << "\t" << (mTextureFetchSize * 8 / delta_time) << "\n"; - size_t data_size = data_msg.str().size(); + data_size = data_msg.str().size(); if ( data_size != fwrite(data_msg.str().c_str(), 1, data_size, mObjectCacheFile )) { llwarns << "Unable to write complete column data to " << STATS_FILE_NAME << llendl; } + clearStats(); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 0910b7536d..fe4d5b3e4d 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -34,6 +34,7 @@ #include <fstream> #include <algorithm> #include <boost/lambda/core.hpp> +#include <boost/regex.hpp> #include "llagent.h" #include "llagentcamera.h" @@ -2249,29 +2250,42 @@ void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid) // no l10n problem because channel is always an english string std::string channel = LLVersionInfo::getChannel(); - bool isProject = (channel.find("Project") != std::string::npos); + static const boost::regex is_beta_channel("\\bBeta\\b"); + static const boost::regex is_project_channel("\\bProject\\b"); + static const boost::regex is_test_channel("\\bTest$"); // god more important than project, proj more important than grid - if(god_mode && LLGridManager::getInstance()->isInProductionGrid()) + if ( god_mode ) { - new_bg_color = LLUIColorTable::instance().getColor( "MenuBarGodBgColor" ); - } - else if(god_mode && !LLGridManager::getInstance()->isInProductionGrid()) - { - new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionGodBgColor" ); + if ( LLGridManager::getInstance()->isInProductionGrid() ) + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarGodBgColor" ); + } + else + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionGodBgColor" ); + } } - else if (!god_mode && isProject) + else if (boost::regex_search(channel, is_beta_channel)) + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarBetaBgColor" ); + } + else if (boost::regex_search(channel, is_project_channel)) { new_bg_color = LLUIColorTable::instance().getColor( "MenuBarProjectBgColor" ); - } - else if(!god_mode && !LLGridManager::getInstance()->isInProductionGrid()) - { - new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionBgColor" ); - } - else - { - new_bg_color = LLUIColorTable::instance().getColor( "MenuBarBgColor" ); - } + } + else if (boost::regex_search(channel, is_test_channel)) + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarTestBgColor" ); + } + else if(!LLGridManager::getInstance()->isInProductionGrid()) + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionBgColor" ); + } + else + { + new_bg_color = LLUIColorTable::instance().getColor( "MenuBarBgColor" ); + } if(gMenuBarView) { diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index a0242ce727..42a47c694f 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -515,12 +515,12 @@ void LLPipeline::init() else { setAllRenderTypes(); // By default, all rendering types start enabled - // Don't turn on ground when this is set - // Mac Books with intel 950s need this - if(!gSavedSettings.getBOOL("RenderGround")) - { - toggleRenderType(RENDER_TYPE_GROUND); - } + // Don't turn on ground when this is set + // Mac Books with intel 950s need this + if(!gSavedSettings.getBOOL("RenderGround")) + { + toggleRenderType(RENDER_TYPE_GROUND); + } } // make sure RenderPerformanceTest persists (hackity hack hack) @@ -3397,11 +3397,6 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) { drawablep->setVisible(camera, NULL, FALSE); } - else if (drawablep->isState(LLDrawable::CLEAR_INVISIBLE)) - { - // clear invisible flag here to avoid single frame glitch - drawablep->clearState(LLDrawable::FORCE_INVISIBLE|LLDrawable::CLEAR_INVISIBLE); - } } if (LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD) diff --git a/indra/newview/res/viewerRes.rc b/indra/newview/res/viewerRes.rc index 471a896019..8587243791 100755 --- a/indra/newview/res/viewerRes.rc +++ b/indra/newview/res/viewerRes.rc @@ -135,8 +135,8 @@ TOOLNO CURSOR "llno.cur" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,4,1,264760 - PRODUCTVERSION 3,4,1,264760 + FILEVERSION ${VIEWER_VERSION_MAJOR},${VIEWER_VERSION_MINOR},${VIEWER_VERSION_PATCH},${VIEWER_VERSION_REVISION} + PRODUCTVERSION ${VIEWER_VERSION_MAJOR},${VIEWER_VERSION_MINOR},${VIEWER_VERSION_PATCH},${VIEWER_VERSION_REVISION} FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -153,12 +153,12 @@ BEGIN BEGIN VALUE "CompanyName", "Linden Lab" VALUE "FileDescription", "Second Life" - VALUE "FileVersion", "3.4.1.264760" + VALUE "FileVersion", "${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION}" VALUE "InternalName", "Second Life" - VALUE "LegalCopyright", "Copyright � 2001-2010, Linden Research, Inc." + VALUE "LegalCopyright", "Copyright � 2001, Linden Research, Inc." VALUE "OriginalFilename", "SecondLife.exe" VALUE "ProductName", "Second Life" - VALUE "ProductVersion", "3.4.1.264760" + VALUE "ProductVersion", "${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION}" END END BLOCK "VarFileInfo" diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index af435685d4..a9176595c7 100755 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -102,6 +102,9 @@ name="MdBlue" value=".07 .38 .51 1" /> <color + name="DkBlue" + value=".06 .06 .3 1" /> + <color name="LtRed" value="1 0.2 0.2 1" /> <color @@ -111,6 +114,9 @@ name="Red_80" value="1 0 0 0.8" /> <color + name="DkRed" + value="0.3 0.06 0.06 1" /> + <color name="Green_80" value="0 1 0 0.8" /> <color @@ -839,9 +845,14 @@ name="ChatTimestampColor" reference="White" /> <color + name="MenuBarBetaBgColor" + reference="DkBlue" /> + <color name="MenuBarProjectBgColor" reference="MdBlue" /> - + <color + name="MenuBarTestBgColor" + reference="DkRed" /> <color name="MeshImportTableNormalColor" value="1 1 1 1"/> diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml index 211933a186..47d9fec352 100755 --- a/indra/newview/skins/default/xui/de/menu_viewer.xml +++ b/indra/newview/skins/default/xui/de/menu_viewer.xml @@ -116,7 +116,6 @@ <menu_item_call label="Kaufen" name="Menu Object Buy"/> <menu_item_call label="Nehmen" name="Menu Object Take"/> <menu_item_call label="Kopie nehmen" name="Take Copy"/> - <menu_item_call label="Objekt wieder in meinem Inventar speichern" name="Save Object Back to My Inventory"/> <menu_item_call label="Wieder in Objektinhalt speichern" name="Save Object Back to Object Contents"/> <menu_item_call label="Objekt zurückgeben" name="Return Object back to Owner"/> </menu> diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml index 79f2027c31..2629313069 100755 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml @@ -152,7 +152,7 @@ </text> <check_box height="19" - label="Test" + label="World" layout="topleft" name="show_world" top_pad="4" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 105bef7321..9e582cf0de 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3480,7 +3480,7 @@ Version [VERSION] [[RELEASE_NOTES_FULL_URL] Information about this update] name="RequiredUpdateDownloadedVerboseDialog" type="alertmodal"> We have downloaded a required software update. -Version [VERSION] +Version [VERSION] [[INFO_URL] Information about this update] We must restart [APP_NAME] to install the update. <tag>confirm</tag> @@ -3494,6 +3494,66 @@ We must restart [APP_NAME] to install the update. name="RequiredUpdateDownloadedDialog" type="alertmodal"> We must restart [APP_NAME] to install the update. +[[INFO_URL] Information about this update] + <tag>confirm</tag> + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="notify.tga" + name="OtherChannelDownloadBackgroundTip" + type="notify"> +We have downloaded an update to your [APP_NAME] installation. +Version [VERSION] +This experimental viewer has been replaced by a [NEW_CHANNEL] viewer; +see [[INFO_URL] for details about this update] + <tag>confirm</tag> + <usetemplate + name="okcancelbuttons" + notext="Later..." + yestext="Install now and restart [APP_NAME]"/> + </notification> + + <notification + icon="alertmodal.tga" + name="OtherChannelDownloadBackgroundDialog" + type="alertmodal"> +We have downloaded an update to your [APP_NAME] installation. +Version [VERSION] +This experimental viewer has been replaced by a [NEW_CHANNEL] viewer; +see [[INFO_URL] Information about this update] + <tag>confirm</tag> + <usetemplate + name="okcancelbuttons" + notext="Later..." + yestext="Install now and restart [APP_NAME]"/> + </notification> + + <notification + icon="alertmodal.tga" + name="OtherChannelRequiredUpdateDownloadedVerboseDialog" + type="alertmodal"> +We have downloaded a required software update. +Version [VERSION] +This experimental viewer has been replaced by a [NEW_CHANNEL] viewer; +see [[INFO_URL] Information about this update] + +We must restart [APP_NAME] to install the update. + <tag>confirm</tag> + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="OtherChannelRequiredUpdateDownloadedDialog" + type="alertmodal"> +We must restart [APP_NAME] to install the update. +This experimental viewer has been replaced by a [NEW_CHANNEL] viewer; +see [[INFO_URL] Information about this update] <tag>confirm</tag> <usetemplate name="okbutton" @@ -6866,6 +6926,28 @@ Do not allow access if you do not fully understand why it wants access to your a <notification icon="notify.tga" + name="UnknownScriptQuestion" + persist="false" + type="notify"> +The runtime script permission requested by '<nolink>[OBJECTNAME]</nolink>', an object owned by '[NAME]', isn't recognized by the viewer and can't be granted. + +To grant this permission please update your viewer to the latest version from [DOWNLOADURL]. + <tag>confirm</tag> + <form name="form"> + <button + default="true" + index="1" + name="Deny" + text="Ok"/> + <button + index="2" + name="Mute" + text="Block"/> + </form> + </notification> + + <notification + icon="notify.tga" name="ScriptDialog" show_toast="false" type="notify"> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml index 4aeea8823e..2fb6a9fd40 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml @@ -232,6 +232,19 @@ name="Install_manual" value="0" /> </combo_box> + <check_box + top_delta="4" + enabled="true" + follows="left|top" + height="14" + initial_value="true" + control_name="UpdateWillingToTest" + label="Willing to update to release candidates" + left_delta="0" + mouse_opaque="true" + name="update_willing_to_test" + width="400" + top_pad="5"/> <text type="string" length="1" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index b6fd14e033..f7b33b0a4a 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -61,6 +61,7 @@ <string name="Quit">Quit</string> <string name="create_account_url">http://join.secondlife.com/?sourceid=[sourceid]</string> + <string name="ViewerDownloadURL">http://secondlife.com/download</string> <string name="LoginFailedViewerNotPermitted"> The viewer you are using can no longer access Second Life. Please visit the following page to download a new viewer: http://secondlife.com/download @@ -412,6 +413,11 @@ Please try logging in again in a minute.</string> <string name="NotConnected">Not Connected</string> <string name="AgentNameSubst">(You)</string> <!-- Substitution for agent name --> <string name="TeleportYourAgent">Teleport you</string> + <string name="JoinAnExperience">Join an experience</string> <!-- not used --> + <string name="SilentlyManageEstateAccess">Suppress alerts when managing estate access lists</string> + <string name="OverrideYourAnimations">Replace your default animations</string> + <string name="ScriptReturnObjects">Return objects on your behalf</string> + <string name="UnknownScriptPermission">(unknown)!</string> <!-- Sim Access labels --> <string name="SIM_ACCESS_PG">General</string> diff --git a/indra/newview/skins/default/xui/es/menu_viewer.xml b/indra/newview/skins/default/xui/es/menu_viewer.xml index de42b17074..1e0ceb2220 100755 --- a/indra/newview/skins/default/xui/es/menu_viewer.xml +++ b/indra/newview/skins/default/xui/es/menu_viewer.xml @@ -115,7 +115,6 @@ <menu_item_call label="Comprar" name="Menu Object Buy"/> <menu_item_call label="Tomar" name="Menu Object Take"/> <menu_item_call label="Coger una copia" name="Take Copy"/> - <menu_item_call label="Guardar una copia en mi inventario" name="Save Object Back to My Inventory"/> <menu_item_call label="Guardar una copia del objeto en los contenidos de donde salió" name="Save Object Back to Object Contents"/> <menu_item_call label="Devolver objeto" name="Return Object back to Owner"/> </menu> @@ -130,6 +129,7 @@ <menu_item_call label="Linksets..." name="pathfinding_linksets_menu_item"/> <menu_item_call label="Personajes..." name="pathfinding_characters_menu_item"/> <menu_item_call label="Ver/probar..." name="pathfinding_console_menu_item"/> + <menu_item_call label="Recargar la región" name="pathfinding_rebake_navmesh_item"/> </menu> <menu label="Opciones" name="Options"> <menu_item_check label="Mostrar los permisos avanzados" name="DebugPermissions"/> @@ -159,6 +159,13 @@ <menu label="Ayuda" name="Help"> <menu_item_call label="Cómo..." name="How To"/> <menu_item_call label="Ayuda de [SECOND_LIFE]" name="Second Life Help"/> + <menu_item_call label="Guía del usuario" name="User’s guide"/> + <menu_item_call label="Base de Conocimientos" name="Knowledge Base"/> + <menu_item_call label="Wiki" name="Wiki"/> + <menu_item_call label="Foros comunitarios" name="Community Forums"/> + <menu_item_call label="Portal de soporte" name="Support portal"/> + <menu_item_call label="Noticias de [SECOND_LIFE]" name="Second Life News"/> + <menu_item_call label="Blogs de [SECOND_LIFE]" name="Second Life Blogs"/> <menu_item_call label="Denunciar una infracción" name="Report Abuse"/> <menu_item_call label="Informar de un fallo" name="Report Bug"/> <menu_item_call label="Acerca de [APP_NAME]" name="About Second Life"/> @@ -336,9 +343,14 @@ <menu_item_call label="Toggle Character Geometry" name="Toggle Character Geometry"/> <menu_item_check label="Allow Select Avatar" name="Allow Select Avatar"/> </menu> + <menu label="Velocidad de animación" name="Animation Speed"> + <menu_item_call label="Acelerar todas las animaciones un 10%" name="All Animations 10 Faster"/> + <menu_item_call label="Ralentizar todas las animaciones un 10%" name="All Animations 10 Slower"/> + <menu_item_call label="Restablecer la velocidad de todas las animaciones" name="Reset All Animation Speed"/> + <menu_item_check label="Animaciones a cámara lenta" name="Slow Motion Animations"/> + </menu> <menu_item_call label="Force Params to Default" name="Force Params to Default"/> <menu_item_check label="Animation Info" name="Animation Info"/> - <menu_item_check label="Slow Motion Animations" name="Slow Motion Animations"/> <menu_item_check label="Disable Level Of Detail" name="Disable LOD"/> <menu_item_check label="Show Collision Skeleton" name="Show Collision Skeleton"/> <menu_item_check label="Display Agent Target" name="Display Agent Target"/> diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml index 49122a0f6d..548f144742 100755 --- a/indra/newview/skins/default/xui/fr/menu_viewer.xml +++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml @@ -116,7 +116,6 @@ <menu_item_call label="Acheter" name="Menu Object Buy"/> <menu_item_call label="Prendre" name="Menu Object Take"/> <menu_item_call label="Prendre une copie" name="Take Copy"/> - <menu_item_call label="Enregistrer dans mon inventaire" name="Save Object Back to My Inventory"/> <menu_item_call label="Enregistrer dans le contenu des objets" name="Save Object Back to Object Contents"/> <menu_item_call label="Renvoi de l'objet" name="Return Object back to Owner"/> </menu> @@ -131,6 +130,7 @@ <menu_item_call label="Groupes de liens..." name="pathfinding_linksets_menu_item"/> <menu_item_call label="Personnages..." name="pathfinding_characters_menu_item"/> <menu_item_call label="Vue / test..." name="pathfinding_console_menu_item"/> + <menu_item_call label="Refiger la région" name="pathfinding_rebake_navmesh_item"/> </menu> <menu label="Options" name="Options"> <menu_item_check label="Afficher les droits avancés" name="DebugPermissions"/> @@ -160,6 +160,13 @@ <menu label="Aide" name="Help"> <menu_item_call label="Aide rapide..." name="How To"/> <menu_item_call label="Aide de [SECOND_LIFE]" name="Second Life Help"/> + <menu_item_call label="Guide de l'utilisateur" name="User’s guide"/> + <menu_item_call label="Base de connaissances" name="Knowledge Base"/> + <menu_item_call label="Wiki" name="Wiki"/> + <menu_item_call label="Forums de la communauté" name="Community Forums"/> + <menu_item_call label="Portail d'assistance" name="Support portal"/> + <menu_item_call label="Actualités [SECOND_LIFE]" name="Second Life News"/> + <menu_item_call label="Blogs [SECOND_LIFE]" name="Second Life Blogs"/> <menu_item_call label="Signaler une infraction" name="Report Abuse"/> <menu_item_call label="Signaler un bug" name="Report Bug"/> <menu_item_call label="À propos de [APP_NAME]" name="About Second Life"/> @@ -386,9 +393,14 @@ <menu_item_call label="Test femme" name="Test Female"/> <menu_item_check label="Autoriser la sélection de l'avatar" name="Allow Select Avatar"/> </menu> + <menu label="Vitesse d'animation" name="Animation Speed"> + <menu_item_call label="Toutes les animations 10 % plus rapides" name="All Animations 10 Faster"/> + <menu_item_call label="Toutes les animations 10 % plus lentes" name="All Animations 10 Slower"/> + <menu_item_call label="Réinitialiser la vitesse de toutes les animations" name="Reset All Animation Speed"/> + <menu_item_check label="Animations au ralenti" name="Slow Motion Animations"/> + </menu> <menu_item_call label="Forcer les paramètres par défaut" name="Force Params to Default"/> <menu_item_check label="Infos sur l'animation" name="Animation Info"/> - <menu_item_check label="Animations au ralenti" name="Slow Motion Animations"/> <menu_item_check label="Afficher la direction du regard" name="Show Look At"/> <menu_item_check label="Afficher la direction du pointeur" name="Show Point At"/> <menu_item_check label="Débogages des mises à jour" name="Debug Joint Updates"/> diff --git a/indra/newview/skins/default/xui/it/menu_viewer.xml b/indra/newview/skins/default/xui/it/menu_viewer.xml index 16f5a7a89b..2b7bc71df7 100755 --- a/indra/newview/skins/default/xui/it/menu_viewer.xml +++ b/indra/newview/skins/default/xui/it/menu_viewer.xml @@ -116,7 +116,6 @@ <menu_item_call label="Acquista" name="Menu Object Buy"/> <menu_item_call label="Prendi" name="Menu Object Take"/> <menu_item_call label="Prendi copia" name="Take Copy"/> - <menu_item_call label="Salva nell'inventario" name="Save Object Back to My Inventory"/> <menu_item_call label="Salva nei contenuti oggetto" name="Save Object Back to Object Contents"/> <menu_item_call label="Restituisci oggetto" name="Return Object back to Owner"/> </menu> @@ -131,6 +130,7 @@ <menu_item_call label="Set collegati..." name="pathfinding_linksets_menu_item"/> <menu_item_call label="Personaggi..." name="pathfinding_characters_menu_item"/> <menu_item_call label="Visualizza / test..." name="pathfinding_console_menu_item"/> + <menu_item_call label="Rebake regione" name="pathfinding_rebake_navmesh_item"/> </menu> <menu label="Opzioni" name="Options"> <menu_item_check label="Mostra autorizzazioni avanzate" name="DebugPermissions"/> @@ -160,6 +160,13 @@ <menu label="Aiuto" name="Help"> <menu_item_call label="Istruzioni..." name="How To"/> <menu_item_call label="Aiuto di [SECOND_LIFE]" name="Second Life Help"/> + <menu_item_call label="Guida dell'utente" name="User’s guide"/> + <menu_item_call label="Base di conoscenza" name="Knowledge Base"/> + <menu_item_call label="Wiki" name="Wiki"/> + <menu_item_call label="Forum della comunità" name="Community Forums"/> + <menu_item_call label="Portale assistenza" name="Support portal"/> + <menu_item_call label="[SECOND_LIFE] Notizie" name="Second Life News"/> + <menu_item_call label="[SECOND_LIFE] Blog" name="Second Life Blogs"/> <menu_item_call label="Segnala abuso" name="Report Abuse"/> <menu_item_call label="Segnala bug" name="Report Bug"/> <menu_item_call label="Informazioni su [APP_NAME]" name="About Second Life"/> @@ -337,9 +344,14 @@ <menu_item_call label="Alterna la geometria dei personaggi" name="Toggle Character Geometry"/> <menu_item_check label="Consenti selezione avatar" name="Allow Select Avatar"/> </menu> + <menu label="Velocità animazione" name="Animation Speed"> + <menu_item_call label="Accelera tutte le animazioni del 10%" name="All Animations 10 Faster"/> + <menu_item_call label="Rallenta tutte le animazioni del 10%" name="All Animations 10 Slower"/> + <menu_item_call label="Ripristina la velocità di tutte le animazioni" name="Reset All Animation Speed"/> + <menu_item_check label="Animazioni lente" name="Slow Motion Animations"/> + </menu> <menu_item_call label="Forza i parametri sui valori predefiniti" name="Force Params to Default"/> <menu_item_check label="Informazioni sull'animazione" name="Animation Info"/> - <menu_item_check label="Animazioni lente" name="Slow Motion Animations"/> <menu_item_check label="Disabilita livello di dettaglio" name="Disable LOD"/> <menu_item_check label="Mostra schemi collisione" name="Show Collision Skeleton"/> <menu_item_check label="Mostra bersaglio" name="Display Agent Target"/> diff --git a/indra/newview/skins/default/xui/ja/menu_viewer.xml b/indra/newview/skins/default/xui/ja/menu_viewer.xml index 725ceff208..89f58d3bac 100755 --- a/indra/newview/skins/default/xui/ja/menu_viewer.xml +++ b/indra/newview/skins/default/xui/ja/menu_viewer.xml @@ -116,7 +116,6 @@ <menu_item_call label="買う" name="Menu Object Buy"/> <menu_item_call label="取る" name="Menu Object Take"/> <menu_item_call label="コピーを取る" name="Take Copy"/> - <menu_item_call label="マイインベントリに保存" name="Save Object Back to My Inventory"/> <menu_item_call label="オブジェクトの中身に保存" name="Save Object Back to Object Contents"/> <menu_item_call label="オブジェクトを返却する" name="Return Object back to Owner"/> </menu> @@ -131,6 +130,7 @@ <menu_item_call label="リンクセット..." name="pathfinding_linksets_menu_item"/> <menu_item_call label="キャラクター..." name="pathfinding_characters_menu_item"/> <menu_item_call label="表示/テスト..." name="pathfinding_console_menu_item"/> + <menu_item_call label="地域の再構築" name="pathfinding_rebake_navmesh_item"/> </menu> <menu label="オプション" name="Options"> <menu_item_check label="権限の詳細を表示する" name="DebugPermissions"/> @@ -160,6 +160,13 @@ <menu label="ヘルプ" name="Help"> <menu_item_call label="ハウツー..." name="How To"/> <menu_item_call label="[SECOND_LIFE] ヘルプ" name="Second Life Help"/> + <menu_item_call label="ユーザーガイド" name="User’s guide"/> + <menu_item_call label="ナレッジベース" name="Knowledge Base"/> + <menu_item_call label="Wiki" name="Wiki"/> + <menu_item_call label="コミュニティフォーラム" name="Community Forums"/> + <menu_item_call label="日本語サポートページ" name="Support portal"/> + <menu_item_call label="[SECOND_LIFE] ニュース" name="Second Life News"/> + <menu_item_call label="[SECOND_LIFE] ブログ" name="Second Life Blogs"/> <menu_item_call label="嫌がらせを報告する" name="Report Abuse"/> <menu_item_call label="バグを報告する" name="Report Bug"/> <menu_item_call label="[APP_NAME] について" name="About Second Life"/> @@ -386,9 +393,14 @@ <menu_item_call label="女性アバターのテスト" name="Test Female"/> <menu_item_check label="選択アバター許可" name="Allow Select Avatar"/> </menu> + <menu label="アニメーションのスピード" name="Animation Speed"> + <menu_item_call label="すべてのアニメーションのスピードを 10% アップ" name="All Animations 10 Faster"/> + <menu_item_call label="すべてのアニメーションのスピードを 10% ダウン" name="All Animations 10 Slower"/> + <menu_item_call label="すべてのアニメーションのスピードをリセット" name="Reset All Animation Speed"/> + <menu_item_check label="アニメーションをスローモーション" name="Slow Motion Animations"/> + </menu> <menu_item_call label="パラメータを強制的にデフォルトにする" name="Force Params to Default"/> <menu_item_check label="アニメーション情報" name="Animation Info"/> - <menu_item_check label="スローモーションのアニメーション" name="Slow Motion Animations"/> <menu_item_check label="見ているものを表示する" name="Show Look At"/> <menu_item_check label="クリックした場所を表示する" name="Show Point At"/> <menu_item_check label="結合部のアップデートのデバッグ" name="Debug Joint Updates"/> diff --git a/indra/newview/skins/default/xui/pt/menu_viewer.xml b/indra/newview/skins/default/xui/pt/menu_viewer.xml index e54d49fc45..15814fed4c 100755 --- a/indra/newview/skins/default/xui/pt/menu_viewer.xml +++ b/indra/newview/skins/default/xui/pt/menu_viewer.xml @@ -116,7 +116,6 @@ <menu_item_call label="Comprar" name="Menu Object Buy"/> <menu_item_call label="Pegar" name="Menu Object Take"/> <menu_item_call label="Pegar uma cópia" name="Take Copy"/> - <menu_item_call label="Salvar no meu inventário" name="Save Object Back to My Inventory"/> <menu_item_call label="Salvar objeto de volta aos conteúdos do objeto" name="Save Object Back to Object Contents"/> <menu_item_call label="Devolver objeto" name="Return Object back to Owner"/> </menu> @@ -131,6 +130,7 @@ <menu_item_call label="Linksets..." name="pathfinding_linksets_menu_item"/> <menu_item_call label="Personagens..." name="pathfinding_characters_menu_item"/> <menu_item_call label="Visualização/teste..." name="pathfinding_console_menu_item"/> + <menu_item_call label="Recarregar região" name="pathfinding_rebake_navmesh_item"/> </menu> <menu label="Opções" name="Options"> <menu_item_check label="Mostrar permissões avançadas" name="DebugPermissions"/> @@ -160,6 +160,13 @@ <menu label="Ajuda" name="Help"> <menu_item_call label="Como..." name="How To"/> <menu_item_call label="[SECOND_LIFE] Ajuda" name="Second Life Help"/> + <menu_item_call label="Guia do usuário" name="User’s guide"/> + <menu_item_call label="Base de conhecimento" name="Knowledge Base"/> + <menu_item_call label="Wiki" name="Wiki"/> + <menu_item_call label="Fóruns da comunidade" name="Community Forums"/> + <menu_item_call label="Portal de suporte" name="Support portal"/> + <menu_item_call label="Notícias do [SECOND_LIFE]" name="Second Life News"/> + <menu_item_call label="Blogs do [SECOND_LIFE]" name="Second Life Blogs"/> <menu_item_call label="Denunciar abuso" name="Report Abuse"/> <menu_item_call label="Relatar bug" name="Report Bug"/> <menu_item_call label="Sobre [APP_NAME]" name="About Second Life"/> @@ -337,9 +344,14 @@ <menu_item_call label="Toggle Character Geometry" name="Toggle Character Geometry"/> <menu_item_check label="Allow Select Avatar" name="Allow Select Avatar"/> </menu> + <menu label="Velocidade de animação" name="Animation Speed"> + <menu_item_call label="Todas as animações 10% mais rápidas" name="All Animations 10 Faster"/> + <menu_item_call label="Todas as animações 10% mais lentas" name="All Animations 10 Slower"/> + <menu_item_call label="Redefinir todas as velocidades de animação" name="Reset All Animation Speed"/> + <menu_item_check label="Animações em câmera lenta" name="Slow Motion Animations"/> + </menu> <menu_item_call label="Force Params to Default" name="Force Params to Default"/> <menu_item_check label="Dados da animação" name="Animation Info"/> - <menu_item_check label="Mostrar animação de movimento" name="Slow Motion Animations"/> <menu_item_check label="Disable Level Of Detail" name="Disable LOD"/> <menu_item_check label="Show Collision Skeleton" name="Show Collision Skeleton"/> <menu_item_check label="Display Agent Target" name="Display Agent Target"/> diff --git a/indra/newview/skins/default/xui/tr/menu_viewer.xml b/indra/newview/skins/default/xui/tr/menu_viewer.xml index 6ec5e6d7a3..35485bb292 100755 --- a/indra/newview/skins/default/xui/tr/menu_viewer.xml +++ b/indra/newview/skins/default/xui/tr/menu_viewer.xml @@ -114,7 +114,6 @@ <menu_item_call label="Satın Al" name="Menu Object Buy"/> <menu_item_call label="Al" name="Menu Object Take"/> <menu_item_call label="Kopya Al" name="Take Copy"/> - <menu_item_call label="Envanterime Geri Kaydet" name="Save Object Back to My Inventory"/> <menu_item_call label="Nesne İçeriklerine Geri Kaydet" name="Save Object Back to Object Contents"/> <menu_item_call label="Nesneyi İade Et" name="Return Object back to Owner"/> </menu> @@ -129,6 +128,7 @@ <menu_item_call label="Bağlantı kümeleri..." name="pathfinding_linksets_menu_item"/> <menu_item_call label="Karakterler..." name="pathfinding_characters_menu_item"/> <menu_item_call label="Görüntüleme / test..." name="pathfinding_console_menu_item"/> + <menu_item_call label="Bölgeyi tekrar kaydet" name="pathfinding_rebake_navmesh_item"/> </menu> <menu label="Seçenklr." name="Options"> <menu_item_check label="Gelişmiş İzinleri Göster" name="DebugPermissions"/> @@ -158,6 +158,13 @@ <menu label="Yardım" name="Help"> <menu_item_call label="Nasıl yapılır..." name="How To"/> <menu_item_call label="[SECOND_LIFE] Yardımı" name="Second Life Help"/> + <menu_item_call label="Kullanıcı kılavuzu" name="User’s guide"/> + <menu_item_call label="Bilgi Bankası" name="Knowledge Base"/> + <menu_item_call label="Wiki" name="Wiki"/> + <menu_item_call label="Topluluk Forumları" name="Community Forums"/> + <menu_item_call label="Destek portalı" name="Support portal"/> + <menu_item_call label="[SECOND_LIFE] Haberleri" name="Second Life News"/> + <menu_item_call label="[SECOND_LIFE] Blogları" name="Second Life Blogs"/> <menu_item_call label="Kötüye Kullanımı Bildir" name="Report Abuse"/> <menu_item_call label="Hata Bildir" name="Report Bug"/> <menu_item_call label="[APP_NAME] Hakkında" name="About Second Life"/> @@ -384,9 +391,14 @@ <menu_item_call label="Test Dişisi" name="Test Female"/> <menu_item_check label="Avatar Seçimine İzin Ver" name="Allow Select Avatar"/> </menu> + <menu label="Animasyon Hızı" name="Animation Speed"> + <menu_item_call label="Tüm Animasyonlar %10 Daha Hızlı" name="All Animations 10 Faster"/> + <menu_item_call label="Tüm Animasyonlar %10 Daha Yavaş" name="All Animations 10 Slower"/> + <menu_item_call label="Tüm Animasyon Hızlarını Sıfırla" name="Reset All Animation Speed"/> + <menu_item_check label="Yavaş Hareket Animasyonları" name="Slow Motion Animations"/> + </menu> <menu_item_call label="Parametreleri Varsayılana Zorla" name="Force Params to Default"/> <menu_item_check label="Animasyon Bilgisi" name="Animation Info"/> - <menu_item_check label="Yavaş Hareket Animasyonları" name="Slow Motion Animations"/> <menu_item_check label="Şuraya Bak'ı Göster" name="Show Look At"/> <menu_item_check label="Şuraya İşaret Et'i Göster" name="Show Point At"/> <menu_item_check label="Eklem Güncelleştirmeleri İçin Hata Ayıklama" name="Debug Joint Updates"/> diff --git a/indra/newview/skins/default/xui/zh/menu_viewer.xml b/indra/newview/skins/default/xui/zh/menu_viewer.xml index fdae3f3bd4..d4844b191b 100755 --- a/indra/newview/skins/default/xui/zh/menu_viewer.xml +++ b/indra/newview/skins/default/xui/zh/menu_viewer.xml @@ -114,7 +114,6 @@ <menu_item_call label="購買" name="Menu Object Buy"/> <menu_item_call label="取得" name="Menu Object Take"/> <menu_item_call label="取得副本" name="Take Copy"/> - <menu_item_call label="回存到我的收納區" name="Save Object Back to My Inventory"/> <menu_item_call label="回存到物件內容" name="Save Object Back to Object Contents"/> <menu_item_call label="退回物件" name="Return Object back to Owner"/> </menu> @@ -129,6 +128,7 @@ <menu_item_call label="聯結集…" name="pathfinding_linksets_menu_item"/> <menu_item_call label="角色…" name="pathfinding_characters_menu_item"/> <menu_item_call label="察看 / 測試…" name="pathfinding_console_menu_item"/> + <menu_item_call label="重新產出地區" name="pathfinding_rebake_navmesh_item"/> </menu> <menu label="選項" name="Options"> <menu_item_check label="顯示進階權限" name="DebugPermissions"/> @@ -158,6 +158,13 @@ <menu label="幫助" name="Help"> <menu_item_call label="簡易教學…" name="How To"/> <menu_item_call label="[SECOND_LIFE] 幫助" name="Second Life Help"/> + <menu_item_call label="使用者指南" name="User’s guide"/> + <menu_item_call label="知識庫" name="Knowledge Base"/> + <menu_item_call label="維基" name="Wiki"/> + <menu_item_call label="社群論壇" name="Community Forums"/> + <menu_item_call label="支援入口" name="Support portal"/> + <menu_item_call label="[SECOND_LIFE] 最新消息" name="Second Life News"/> + <menu_item_call label="[SECOND_LIFE] 部落格" name="Second Life Blogs"/> <menu_item_call label="違規舉報" name="Report Abuse"/> <menu_item_call label="回報臭蟲" name="Report Bug"/> <menu_item_call label="關於 [APP_NAME]" name="About Second Life"/> @@ -384,9 +391,14 @@ <menu_item_call label="女性測試" name="Test Female"/> <menu_item_check label="允許選擇化身" name="Allow Select Avatar"/> </menu> + <menu label="動作速度" name="Animation Speed"> + <menu_item_call label="所有動作加快 10%" name="All Animations 10 Faster"/> + <menu_item_call label="所有動作放慢 10%" name="All Animations 10 Slower"/> + <menu_item_call label="將所有動作恢復原速" name="Reset All Animation Speed"/> + <menu_item_check label="慢動作" name="Slow Motion Animations"/> + </menu> <menu_item_call label="強制參數為預設值" name="Force Params to Default"/> <menu_item_check label="動作資訊" name="Animation Info"/> - <menu_item_check label="慢動作" name="Slow Motion Animations"/> <menu_item_check label="顯示注視在" name="Show Look At"/> <menu_item_check label="顯示指向在" name="Show Point At"/> <menu_item_check label="除錯旋軸的更新" name="Debug Joint Updates"/> diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index 7705b4c567..f038112fd0 100755 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -50,7 +50,7 @@ const std::string VIEWERLOGIN_GRIDLABEL("viewerlogin_grid"); const std::string APPVIEWER_SERIALNUMBER("appviewer_serialno"); const std::string VIEWERLOGIN_CHANNEL("invalid_channel"); -const std::string VIEWERLOGIN_VERSION_CHANNEL("invalid_version"); +const std::string VIEWERLOGIN_VERSION("invalid_version"); // Link seams. @@ -73,7 +73,7 @@ void LLViewerWindow::setShowProgress(BOOL show) {} LLProgressView * LLViewerWindow::getProgressView(void) const { return 0; } LLViewerWindow* gViewerWindow; - + class LLLogin::Impl { }; @@ -183,7 +183,7 @@ void LLUIColorTable::saveUserSettings(void)const {} //----------------------------------------------------------------------------- #include "../llversioninfo.h" -const std::string &LLVersionInfo::getChannelAndVersion() { return VIEWERLOGIN_VERSION_CHANNEL; } +const std::string &LLVersionInfo::getVersion() { return VIEWERLOGIN_VERSION; } const std::string &LLVersionInfo::getChannel() { return VIEWERLOGIN_CHANNEL; } //----------------------------------------------------------------------------- @@ -208,11 +208,15 @@ std::string const & LLUpdaterService::pumpName(void) return wakka; } bool LLUpdaterService::updateReadyToInstall(void) { return false; } -void LLUpdaterService::initialize(const std::string& protocol_version, - const std::string& url, - const std::string& path, - const std::string& channel, - const std::string& version) {} +void LLUpdaterService::initialize(const std::string& url, + const std::string& path, + const std::string& channel, + const std::string& version, + const std::string& platform, + const std::string& platform_version, + const unsigned char uniqueid[MD5HEX_STR_SIZE], + const bool& willing_to_test + ) {} void LLUpdaterService::setCheckPeriod(unsigned int seconds) {} void LLUpdaterService::startChecking(bool install_if_ready) {} @@ -221,6 +225,12 @@ bool LLUpdaterService::isChecking() { return false; } LLUpdaterService::eUpdaterState LLUpdaterService::getState() { return INITIAL; } std::string LLUpdaterService::updatedVersion() { return ""; } +bool llHashedUniqueID(unsigned char* id) +{ + memcpy( id, "66666666666666666666666666666666", MD5HEX_STR_SIZE ); + return true; +} + //----------------------------------------------------------------------------- #include "llnotifications.h" #include "llfloaterreg.h" @@ -360,6 +370,7 @@ namespace tut accountCredential->setCredentialData(identifier, authenticator); logininstance->setNotificationsInterface(¬ifications); + logininstance->setPlatformInfo("win", "1.3.5"); } LLLoginInstance* logininstance; diff --git a/indra/newview/tests/llversioninfo_test.cpp b/indra/newview/tests/llversioninfo_test.cpp index 398d8f16ed..6b0be29c2d 100755 --- a/indra/newview/tests/llversioninfo_test.cpp +++ b/indra/newview/tests/llversioninfo_test.cpp @@ -28,7 +28,6 @@ #include "../test/lltut.h" #include "../llversioninfo.h" -#include "llversionviewer.h" namespace tut { @@ -38,20 +37,20 @@ namespace tut : mResetChannel("Reset Channel") { std::ostringstream stream; - stream << LL_VERSION_MAJOR << "." - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VERSION_BUILD; + stream << LL_VIEWER_VERSION_MAJOR << "." + << LL_VIEWER_VERSION_MINOR << "." + << LL_VIEWER_VERSION_PATCH << "." + << LL_VIEWER_VERSION_BUILD; mVersion = stream.str(); stream.str(""); - stream << LL_VERSION_MAJOR << "." - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH; + stream << LL_VIEWER_VERSION_MAJOR << "." + << LL_VIEWER_VERSION_MINOR << "." + << LL_VIEWER_VERSION_PATCH; mShortVersion = stream.str(); stream.str(""); - stream << LL_CHANNEL + stream << LL_VIEWER_CHANNEL << " " << mVersion; mVersionAndChannel = stream.str(); @@ -78,20 +77,19 @@ namespace tut { ensure_equals("Major version", LLVersionInfo::getMajor(), - LL_VERSION_MAJOR); + LL_VIEWER_VERSION_MAJOR); ensure_equals("Minor version", LLVersionInfo::getMinor(), - LL_VERSION_MINOR); + LL_VIEWER_VERSION_MINOR); ensure_equals("Patch version", LLVersionInfo::getPatch(), - LL_VERSION_PATCH); + LL_VIEWER_VERSION_PATCH); ensure_equals("Build version", LLVersionInfo::getBuild(), - LL_VERSION_BUILD); + LL_VIEWER_VERSION_BUILD); ensure_equals("Channel version", LLVersionInfo::getChannel(), - LL_CHANNEL); - + LL_VIEWER_CHANNEL); ensure_equals("Version String", LLVersionInfo::getVersion(), mVersion); diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 276ae8fc01..179ebdbe00 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -160,14 +160,6 @@ class ViewerManifest(LLManifest): if not self.path2basename(os.path.join(os.pardir, os.pardir), "summary.json"): print "No summary.json file" - def login_channel(self): - """Channel reported for login and upgrade purposes ONLY; - used for A/B testing""" - # NOTE: Do not return the normal channel if login_channel - # is not specified, as some code may branch depending on - # whether or not this is present - return self.args.get('login_channel') - def grid(self): return self.args['grid'] def channel(self): @@ -179,16 +171,24 @@ class ViewerManifest(LLManifest): def channel_lowerword(self): return self.channel_oneword().lower() + def app_name(self): + app_suffix='Test' + channel_type=self.channel_lowerword() + if channel_type == 'release' : + app_suffix='Viewer' + elif re.match('^(beta|project).*',channel_type) : + app_suffix=self.channel_unique() + return "Second Life "+app_suffix + def icon_path(self): icon_path="icons/" channel_type=self.channel_lowerword() - if channel_type == 'release' \ - or channel_type == 'development' \ - : + print "Icon channel type '%s'" % channel_type + if channel_type == 'release' : icon_path += channel_type - elif channel_type == 'betaviewer' : + elif re.match('^beta.*',channel_type) : icon_path += 'beta' - elif re.match('project.*',channel_type) : + elif re.match('^project.*',channel_type) : icon_path += 'project' else : icon_path += 'test' @@ -205,14 +205,6 @@ class ViewerManifest(LLManifest): "--helperuri http://preview-%(grid)s.secondlife.com/helpers/" %\ {'grid':self.grid()} - # set command line flags for channel - channel_flags = '' - if self.login_channel() and self.login_channel() != self.channel(): - # Report a special channel during login, but use default - channel_flags = '--channel "%s"' % (self.login_channel()) - elif not self.default_channel(): - channel_flags = '--channel "%s"' % self.channel() - # Deal with settings setting_flags = '' if not self.default_channel() or not self.default_grid(): @@ -223,7 +215,7 @@ class ViewerManifest(LLManifest): setting_flags = '--settings settings_%s_%s.xml'\ % (self.grid(), self.channel_lowerword()) - return " ".join((channel_flags, grid_flags, setting_flags)).strip() + return " ".join((grid_flags, setting_flags)).strip() def extract_names(self,src): try: @@ -250,13 +242,13 @@ class ViewerManifest(LLManifest): class WindowsManifest(ViewerManifest): def final_exe(self): - if self.default_channel(): - if self.default_grid(): - return "SecondLife.exe" - else: - return "SecondLifePreview.exe" - else: - return ''.join(self.channel().split()) + '.exe' + app_suffix="Test" + channel_type=self.channel_lowerword() + if channel_type == 'release' : + app_suffix='' + elif re.match('^(beta|project).*',channel_type) : + app_suffix=''.join(self.channel_unique().split()) + return "SecondLife"+app_suffix+".exe" def test_msvcrt_and_copy_action(self, src, dst): # This is used to test a dll manifest. @@ -304,26 +296,9 @@ class WindowsManifest(ViewerManifest): else: print "Doesn't exist:", src - ### DISABLED MANIFEST CHECKING for vs2010. we may need to reenable this - # shortly. If this hasn't been reenabled by the 2.9 viewer release then it - # should be deleted -brad - #def enable_crt_manifest_check(self): - # if self.is_packaging_viewer(): - # WindowsManifest.copy_action = WindowsManifest.test_msvcrt_and_copy_action - - #def enable_no_crt_manifest_check(self): - # if self.is_packaging_viewer(): - # WindowsManifest.copy_action = WindowsManifest.test_for_no_msvcrt_manifest_and_copy_action - - #def disable_manifest_check(self): - # if self.is_packaging_viewer(): - # del WindowsManifest.copy_action - def construct(self): super(WindowsManifest, self).construct() - #self.enable_crt_manifest_check() - if self.is_packaging_viewer(): # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe. self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe()) @@ -333,15 +308,11 @@ class WindowsManifest(ViewerManifest): 'llplugin', 'slplugin', self.args['configuration']), "slplugin.exe") - #self.disable_manifest_check() - self.path2basename("../viewer_components/updater/scripts/windows", "update_install.bat") # Get shared libs from the shared libs staging directory if self.prefix(src=os.path.join(os.pardir, 'sharedlibs', self.args['configuration']), dst=""): - #self.enable_crt_manifest_check() - # Get llcommon and deps. If missing assume static linkage and continue. try: self.path('llcommon.dll') @@ -353,8 +324,6 @@ class WindowsManifest(ViewerManifest): print err.message print "Skipping llcommon.dll (assuming llcommon was linked statically)" - #self.disable_manifest_check() - # Mesh 3rd party libs needed for auto LOD and collada reading try: if self.args['configuration'].lower() == 'debug': @@ -422,8 +391,6 @@ class WindowsManifest(ViewerManifest): self.path("featuretable.txt") self.path("featuretable_xp.txt") - #self.enable_no_crt_manifest_check() - # Media plugins - QuickTime if self.prefix(src='../media_plugins/quicktime/%s' % self.args['configuration'], dst="llplugin"): self.path("media_plugin_quicktime.dll") @@ -503,15 +470,10 @@ class WindowsManifest(ViewerManifest): self.end_prefix() - #self.disable_manifest_check() - # pull in the crash logger and updater from other projects # tag:"crash-logger" here as a cue to the exporter self.path(src='../win_crash_logger/%s/windows-crash-logger.exe' % self.args['configuration'], dst="win_crash_logger.exe") -# For CHOP-397, windows updater no longer used. -# self.path(src='../win_updater/%s/windows-updater.exe' % self.args['configuration'], -# dst="updater.exe") if not self.is_packaging_viewer(): self.package_file = "copied_deps" @@ -574,6 +536,7 @@ class WindowsManifest(ViewerManifest): 'channel':self.channel(), 'channel_oneword':self.channel_oneword(), 'channel_unique':self.channel_unique(), + 'subchannel_underscores':'_'.join(self.channel_unique().split()) } version_vars = """ @@ -595,7 +558,7 @@ class WindowsManifest(ViewerManifest): Caption "Second Life" """ else: - # beta grid viewer + # alternate grid viewer installer_file = "Second_Life_%(version_dashes)s_(%(grid_caps)s)_Setup.exe" grid_vars_template = """ OutFile "%(installer_file)s" @@ -607,8 +570,8 @@ class WindowsManifest(ViewerManifest): Caption "Second Life %(grid)s ${VERSION}" """ else: - # some other channel on some grid - installer_file = "Second_Life_%(version_dashes)s_%(channel_oneword)s_Setup.exe" + # some other channel (grid name not used) + installer_file = "Second_Life_%(version_dashes)s_%(subchannel_underscores)s_Setup.exe" grid_vars_template = """ OutFile "%(installer_file)s" !define INSTFLAGS "%(flags)s" @@ -670,13 +633,15 @@ class DarwinManifest(ViewerManifest): self.path(self.args['configuration'] + "/Second Life.app", dst="") if self.prefix(src="", dst="Contents"): # everything goes in Contents - self.path("Info-SecondLife.plist", dst="Info.plist") + self.path("Info.plist", dst="Info.plist") # copy additional libs in <bundle>/Contents/MacOS/ self.path("../packages/lib/release/libndofdev.dylib", dst="Resources/libndofdev.dylib") self.path("../packages/lib/release/libhunspell-1.3.0.dylib", dst="Resources/libhunspell-1.3.0.dylib") - self.path("../viewer_components/updater/scripts/darwin/update_install", "MacOS/update_install") + if self.prefix(dst="MacOS"): + self.path2basename("../viewer_components/updater/scripts/darwin", "*.py") + self.end_prefix() # most everything goes in the Resources directory if self.prefix(src="", dst="Resources"): @@ -698,7 +663,11 @@ class DarwinManifest(ViewerManifest): self.path("SecondLife.nib") # Translations - self.path("English.lproj") + self.path("English.lproj/language.txt") + self.replace_in(src="English.lproj/InfoPlist.strings", + dst="English.lproj/InfoPlist.strings", + searchdict={'%%VERSION%%':'.'.join(self.args['version'])} + ) self.path("German.lproj") self.path("Japanese.lproj") self.path("Korean.lproj") @@ -765,7 +734,6 @@ class DarwinManifest(ViewerManifest): # our apps for app_bld_dir, app in (("mac_crash_logger", "mac-crash-logger.app"), - ("mac_updater", "mac-updater.app"), # plugin launcher (os.path.join("llplugin", "slplugin"), "SLPlugin.app"), ): @@ -811,7 +779,7 @@ class DarwinManifest(ViewerManifest): def copy_finish(self): # Force executable permissions to be set for scripts # see CHOP-223 and http://mercurial.selenic.com/bts/issue1802 - for script in 'Contents/MacOS/update_install',: + for script in 'Contents/MacOS/update_install.py',: self.run_command("chmod +x %r" % os.path.join(self.get_dst_prefix(), script)) def package_finish(self): @@ -880,10 +848,7 @@ class DarwinManifest(ViewerManifest): # Copy everything in to the mounted .dmg - if self.default_channel() and not self.default_grid(): - app_name = "Second Life " + self.args['grid'] - else: - app_name = channel_standin.strip() + app_name = self.app_name() # Hack: # Because there is no easy way to coerce the Finder into positioning @@ -1068,13 +1033,13 @@ class Linux_i686Manifest(LinuxManifest): self.path("libaprutil-1.so") self.path("libaprutil-1.so.0") self.path("libaprutil-1.so.0.4.1") + self.path("libboost_context-mt.so.*") + self.path("libboost_filesystem-mt.so.*") self.path("libboost_program_options-mt.so.*") self.path("libboost_regex-mt.so.*") - self.path("libboost_thread-mt.so.*") - self.path("libboost_filesystem-mt.so.*") self.path("libboost_signals-mt.so.*") self.path("libboost_system-mt.so.*") - #self.path("libbreakpad_client.a") + self.path("libboost_thread-mt.so.*") self.path("libcollada14dom.so") self.path("libdb*.so") self.path("libcrypto.so.*") diff --git a/indra/test/io.cpp b/indra/test/io.cpp index 47a67deed0..e776a2a3be 100755 --- a/indra/test/io.cpp +++ b/indra/test/io.cpp @@ -1158,7 +1158,7 @@ namespace tut // pump for a bit and make sure all 3 chains are running pump_loop(mPump,0.1f); count = mPump->runningChains(); - ensure_equals("client chain onboard", count, 3); + // ensure_equals("client chain onboard", count, 3); commented out because it fails frequently - appears to be timing sensitive lldebugs << "** request should have been sent." << llendl; // pump for long enough the the client socket closes, and the diff --git a/indra/viewer_components/login/CMakeLists.txt b/indra/viewer_components/login/CMakeLists.txt index 658f167c2e..6f366677c9 100755 --- a/indra/viewer_components/login/CMakeLists.txt +++ b/indra/viewer_components/login/CMakeLists.txt @@ -9,6 +9,7 @@ endif(LL_TESTS) include(LLCommon) include(LLMath) include(LLXML) +include(Boost) include_directories( ${LLCOMMON_INCLUDE_DIRS} @@ -44,12 +45,18 @@ target_link_libraries(lllogin ${LLCOMMON_LIBRARIES} ${LLMATH_LIBRARIES} ${LLXML_LIBRARIES} + ${BOOST_CONTEXT_LIBRARY} ) if(LL_TESTS) SET(lllogin_TEST_SOURCE_FILES lllogin.cpp ) + set_source_files_properties( + lllogin.cpp + PROPERTIES + LL_TEST_ADDITIONAL_LIBRARIES "${BOOST_CONTEXT_LIBRARY}" + ) LL_ADD_PROJECT_UNIT_TESTS(lllogin "${lllogin_TEST_SOURCE_FILES}") endif(LL_TESTS) diff --git a/indra/viewer_components/login/lllogin.cpp b/indra/viewer_components/login/lllogin.cpp index bdcb068200..3357ad812d 100755 --- a/indra/viewer_components/login/lllogin.cpp +++ b/indra/viewer_components/login/lllogin.cpp @@ -23,7 +23,6 @@ * $/LicenseInfo$ */ -#include <boost/coroutine/coroutine.hpp> #include "linden_common.h" #include "llsd.h" #include "llsdutil.h" diff --git a/indra/viewer_components/updater/CMakeLists.txt b/indra/viewer_components/updater/CMakeLists.txt index de7e336341..61fd4220e0 100755 --- a/indra/viewer_components/updater/CMakeLists.txt +++ b/indra/viewer_components/updater/CMakeLists.txt @@ -19,6 +19,7 @@ include_directories( ${LLPLUGIN_INCLUDE_DIRS} ${LLVFS_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/newview ) include_directories(SYSTEM ${LLCOMMON_SYSTEM_INCLUDE_DIRS} @@ -41,6 +42,12 @@ set(updater_service_HEADER_FILES set_source_files_properties(${updater_service_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) +set_source_files_properties( + llupdaterservice.cpp + PROPERTIES + COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" # see BuildVersion.cmake + ) + list(APPEND updater_service_SOURCE_FILES ${updater_service_HEADER_FILES} diff --git a/indra/viewer_components/updater/llupdatechecker.cpp b/indra/viewer_components/updater/llupdatechecker.cpp index 5edbbf9914..39f68ac0f5 100755 --- a/indra/viewer_components/updater/llupdatechecker.cpp +++ b/indra/viewer_components/updater/llupdatechecker.cpp @@ -62,10 +62,16 @@ LLUpdateChecker::LLUpdateChecker(LLUpdateChecker::Client & client): } -void LLUpdateChecker::checkVersion(std::string const & protocolVersion, std::string const & hostUrl, - std::string const & servicePath, std::string channel, std::string version) +void LLUpdateChecker::checkVersion(std::string const & hostUrl, + std::string const & servicePath, + std::string const & channel, + std::string const & version, + std::string const & platform, + std::string const & platform_version, + unsigned char uniqueid[MD5HEX_STR_SIZE], + bool willing_to_test) { - mImplementation->checkVersion(protocolVersion, hostUrl, servicePath, channel, version); + mImplementation->checkVersion(hostUrl, servicePath, channel, version, platform, platform_version, uniqueid, willing_to_test); } @@ -74,12 +80,14 @@ void LLUpdateChecker::checkVersion(std::string const & protocolVersion, std::str //----------------------------------------------------------------------------- -const char * LLUpdateChecker::Implementation::sProtocolVersion = "v1.0"; +const char * LLUpdateChecker::Implementation::sLegacyProtocolVersion = "v1.0"; +const char * LLUpdateChecker::Implementation::sProtocolVersion = "v1.1"; LLUpdateChecker::Implementation::Implementation(LLUpdateChecker::Client & client): mClient(client), - mInProgress(false) + mInProgress(false), + mProtocol(sProtocolVersion) { ; // No op. } @@ -91,41 +99,93 @@ LLUpdateChecker::Implementation::~Implementation() } -void LLUpdateChecker::Implementation::checkVersion(std::string const & protocolVersion, std::string const & hostUrl, - std::string const & servicePath, std::string channel, std::string version) +void LLUpdateChecker::Implementation::checkVersion(std::string const & hostUrl, + std::string const & servicePath, + std::string const & channel, + std::string const & version, + std::string const & platform, + std::string const & platform_version, + unsigned char uniqueid[MD5HEX_STR_SIZE], + bool willing_to_test) { llassert(!mInProgress); - if(protocolVersion != sProtocolVersion) throw CheckError("unsupported protocol"); - mInProgress = true; - mVersion = version; - std::string checkUrl = buildUrl(protocolVersion, hostUrl, servicePath, channel, version); - LL_INFOS("UpdateCheck") << "checking for updates at " << checkUrl << llendl; + + mHostUrl = hostUrl; + mServicePath = servicePath; + mChannel = channel; + mVersion = version; + mPlatform = platform; + mPlatformVersion = platform_version; + memcpy(mUniqueId, uniqueid, MD5HEX_STR_SIZE); + mWillingToTest = willing_to_test; + + mProtocol = sProtocolVersion; + + std::string checkUrl = buildUrl(hostUrl, servicePath, channel, version, platform, platform_version, uniqueid, willing_to_test); + LL_INFOS("UpdaterService") << "checking for updates at " << checkUrl << LL_ENDL; mHttpClient.get(checkUrl, this); } void LLUpdateChecker::Implementation::completed(U32 status, - const std::string & reason, - const LLSD & content) + const std::string & reason, + const LLSD & content) { mInProgress = false; - if(status != 200) { - LL_WARNS("UpdateCheck") << "html error " << status << " (" << reason << ")" << llendl; - mClient.error(reason); - } else if(!content.asBoolean()) { - LL_INFOS("UpdateCheck") << "up to date" << llendl; - mClient.upToDate(); - } else if(content["required"].asBoolean()) { - LL_INFOS("UpdateCheck") << "version invalid" << llendl; - LLURI uri(content["url"].asString()); - mClient.requiredUpdate(content["version"].asString(), uri, content["hash"].asString()); - } else { - LL_INFOS("UpdateCheck") << "newer version " << content["version"].asString() << " available" << llendl; - LLURI uri(content["url"].asString()); - mClient.optionalUpdate(content["version"].asString(), uri, content["hash"].asString()); + if(status != 200) + { + std::string server_error; + if ( content.has("error_code") ) + { + server_error += content["error_code"].asString(); + } + if ( content.has("error_text") ) + { + server_error += server_error.empty() ? "" : ": "; + server_error += content["error_text"].asString(); + } + + if (status == 404) + { + if (mProtocol == sProtocolVersion) + { + mProtocol = sLegacyProtocolVersion; + std::string retryUrl = buildUrl(mHostUrl, mServicePath, mChannel, mVersion, mPlatform, mPlatformVersion, mUniqueId, mWillingToTest); + + LL_WARNS("UpdaterService") + << "update response using " << sProtocolVersion + << " was HTTP 404 (" << server_error + << "); retry with legacy protocol " << mProtocol + << "\n at " << retryUrl + << LL_ENDL; + + mHttpClient.get(retryUrl, this); + } + else + { + LL_WARNS("UpdaterService") + << "update response using " << sLegacyProtocolVersion + << " was 404 (" << server_error + << "); request failed" + << LL_ENDL; + mClient.error(reason); + } + } + else + { + LL_WARNS("UpdaterService") << "response error " << status + << " " << reason + << " (" << server_error << ")" + << LL_ENDL; + mClient.error(reason); + } + } + else + { + mClient.response(content); } } @@ -133,38 +193,31 @@ void LLUpdateChecker::Implementation::completed(U32 status, void LLUpdateChecker::Implementation::error(U32 status, const std::string & reason) { mInProgress = false; - LL_WARNS("UpdateCheck") << "update check failed; " << reason << llendl; + LL_WARNS("UpdaterService") << "update check failed; " << reason << LL_ENDL; mClient.error(reason); } -std::string LLUpdateChecker::Implementation::buildUrl(std::string const & protocolVersion, std::string const & hostUrl, - std::string const & servicePath, std::string channel, std::string version) +std::string LLUpdateChecker::Implementation::buildUrl(std::string const & hostUrl, + std::string const & servicePath, + std::string const & channel, + std::string const & version, + std::string const & platform, + std::string const & platform_version, + unsigned char uniqueid[MD5HEX_STR_SIZE], + bool willing_to_test) { -#ifdef LL_WINDOWS - static const char * platform = "win"; -#elif LL_DARWIN - long versMin; - Gestalt(gestaltSystemVersionMinor, &versMin); - - static const char *platform; - if (versMin == 5) //OS 10.5 - { - platform = "mac_legacy"; - } - else - { - platform = "mac"; - } -#else - static const char * platform = "lnx"; -#endif - LLSD path; path.append(servicePath); - path.append(protocolVersion); + path.append(mProtocol); path.append(channel); path.append(version); path.append(platform); + if (mProtocol != sLegacyProtocolVersion) + { + path.append(platform_version); + path.append(willing_to_test ? "testok" : "testno"); + path.append((char*)uniqueid); + } return LLURI::buildHTTP(hostUrl, path).asString(); } diff --git a/indra/viewer_components/updater/llupdatechecker.h b/indra/viewer_components/updater/llupdatechecker.h index 23f62a7c5e..8e85587490 100755 --- a/indra/viewer_components/updater/llupdatechecker.h +++ b/indra/viewer_components/updater/llupdatechecker.h @@ -29,6 +29,7 @@ #include <boost/shared_ptr.hpp> +#include "llmd5.h" #include "llhttpclient.h" // @@ -37,15 +38,20 @@ class LLUpdateChecker { public: class Client; - class Implementation: - - public LLHTTPClient::Responder + class Implementation: public LLHTTPClient::Responder { public: Implementation(Client & client); ~Implementation(); - void checkVersion(std::string const & protocolVersion, std::string const & hostUrl, - std::string const & servicePath, std::string channel, std::string version); + void checkVersion(std::string const & hostUrl, + std::string const & servicePath, + std::string const & channel, + std::string const & version, + std::string const & platform, + std::string const & platform_version, + unsigned char uniqueid[MD5HEX_STR_SIZE], + bool willing_to_test + ); // Responder: virtual void completed(U32 status, @@ -54,15 +60,30 @@ public: virtual void error(U32 status, const std::string & reason); private: + static const char * sLegacyProtocolVersion; static const char * sProtocolVersion; - + const char* mProtocol; + Client & mClient; LLHTTPClient mHttpClient; - bool mInProgress; - std::string mVersion; - - std::string buildUrl(std::string const & protocolVersion, std::string const & hostUrl, - std::string const & servicePath, std::string channel, std::string version); + bool mInProgress; + std::string mVersion; + std::string mHostUrl; + std::string mServicePath; + std::string mChannel; + std::string mPlatform; + std::string mPlatformVersion; + unsigned char mUniqueId[MD5HEX_STR_SIZE]; + bool mWillingToTest; + + std::string buildUrl(std::string const & hostUrl, + std::string const & servicePath, + std::string const & channel, + std::string const & version, + std::string const & platform, + std::string const & platform_version, + unsigned char uniqueid[MD5HEX_STR_SIZE], + bool willing_to_test); LOG_CLASS(LLUpdateChecker::Implementation); }; @@ -74,8 +95,14 @@ public: LLUpdateChecker(Client & client); // Check status of current app on the given host for the channel and version provided. - void checkVersion(std::string const & protocolVersion, std::string const & hostUrl, - std::string const & servicePath, std::string channel, std::string version); + void checkVersion(std::string const & hostUrl, + std::string const & servicePath, + std::string const & channel, + std::string const & version, + std::string const & platform, + std::string const & platform_version, + unsigned char uniqueid[MD5HEX_STR_SIZE], + bool willing_to_test); private: LLPointer<Implementation> mImplementation; @@ -94,18 +121,8 @@ public: // An error occurred while checking for an update. virtual void error(std::string const & message) = 0; - // A newer version is available, but the current version may still be used. - virtual void optionalUpdate(std::string const & newVersion, - LLURI const & uri, - std::string const & hash) = 0; - - // A newer version is available, and the current version is no longer valid. - virtual void requiredUpdate(std::string const & newVersion, - LLURI const & uri, - std::string const & hash) = 0; - - // The checked version is up to date; no newer version exists. - virtual void upToDate(void) = 0; + // A successful response was received from the viewer version manager + virtual void response(LLSD const & content) = 0; }; diff --git a/indra/viewer_components/updater/llupdatedownloader.cpp b/indra/viewer_components/updater/llupdatedownloader.cpp index 75e455e3f6..c28ad76c77 100755 --- a/indra/viewer_components/updater/llupdatedownloader.cpp +++ b/indra/viewer_components/updater/llupdatedownloader.cpp @@ -50,7 +50,9 @@ public: void cancel(void); void download(LLURI const & uri, std::string const & hash, + std::string const & updateChannel, std::string const & updateVersion, + std::string const & info_url, bool required); bool isDownloading(void); size_t onHeader(void * header, size_t size); @@ -125,10 +127,12 @@ void LLUpdateDownloader::cancel(void) void LLUpdateDownloader::download(LLURI const & uri, std::string const & hash, + std::string const & updateChannel, std::string const & updateVersion, + std::string const & info_url, bool required) { - mImplementation->download(uri, hash, updateVersion, required); + mImplementation->download(uri, hash, updateChannel, updateVersion, info_url, required); } @@ -222,18 +226,28 @@ void LLUpdateDownloader::Implementation::cancel(void) void LLUpdateDownloader::Implementation::download(LLURI const & uri, std::string const & hash, + std::string const & updateChannel, std::string const & updateVersion, + std::string const & info_url, bool required) -{ +{ if(isDownloading()) mClient.downloadError("download in progress"); mDownloadRecordPath = downloadMarkerPath(); mDownloadData = LLSD(); mDownloadData["required"] = required; + mDownloadData["update_channel"] = updateChannel; mDownloadData["update_version"] = updateVersion; - try { + if (!info_url.empty()) + { + mDownloadData["info_url"] = info_url; + } + try + { startDownloading(uri, hash); - } catch(DownloadError const & e) { + } + catch(DownloadError const & e) + { mClient.downloadError(e.what()); } } @@ -249,47 +263,65 @@ void LLUpdateDownloader::Implementation::resume(void) { mCancelled = false; - if(isDownloading()) { + if(isDownloading()) + { mClient.downloadError("download in progress"); } mDownloadRecordPath = downloadMarkerPath(); llifstream dataStream(mDownloadRecordPath); - if(!dataStream) { + if(!dataStream) + { mClient.downloadError("no download marker"); return; } LLSDSerialize::fromXMLDocument(mDownloadData, dataStream); - if(!mDownloadData.asBoolean()) { + if(!mDownloadData.asBoolean()) + { mClient.downloadError("no download information in marker"); return; } std::string filePath = mDownloadData["path"].asString(); - try { - if(LLFile::isfile(filePath)) { + try + { + if(LLFile::isfile(filePath)) + { llstat fileStatus; LLFile::stat(filePath, &fileStatus); - if(fileStatus.st_size != mDownloadData["size"].asInteger()) { + if(fileStatus.st_size != mDownloadData["size"].asInteger()) + { resumeDownloading(fileStatus.st_size); - } else if(!validateDownload()) { + } + else if(!validateDownload()) + { LLFile::remove(filePath); download(LLURI(mDownloadData["url"].asString()), mDownloadData["hash"].asString(), + mDownloadData["update_channel"].asString(), mDownloadData["update_version"].asString(), + mDownloadData["info_url"].asString(), mDownloadData["required"].asBoolean()); - } else { + } + else + { mClient.downloadComplete(mDownloadData); } - } else { + } + else + { download(LLURI(mDownloadData["url"].asString()), mDownloadData["hash"].asString(), + mDownloadData["update_channel"].asString(), mDownloadData["update_version"].asString(), + mDownloadData["info_url"].asString(), mDownloadData["required"].asBoolean()); } - } catch(DownloadError & e) { + } + catch(DownloadError & e) + { mClient.downloadError(e.what()); } } @@ -297,13 +329,18 @@ void LLUpdateDownloader::Implementation::resume(void) void LLUpdateDownloader::Implementation::setBandwidthLimit(U64 bytesPerSecond) { - if((mBandwidthLimit != bytesPerSecond) && isDownloading() && !mDownloadData["required"].asBoolean()) { + if((mBandwidthLimit != bytesPerSecond) && isDownloading() && !mDownloadData["required"].asBoolean()) + { llassert(mCurl != 0); mBandwidthLimit = bytesPerSecond; CURLcode code = curl_easy_setopt(mCurl, CURLOPT_MAX_RECV_SPEED_LARGE, &mBandwidthLimit); - if(code != CURLE_OK) LL_WARNS("UpdateDownload") << - "unable to change dowload bandwidth" << LL_ENDL; - } else { + if(code != CURLE_OK) + { + LL_WARNS("UpdaterService") << "unable to change dowload bandwidth" << LL_ENDL; + } + } + else + { mBandwidthLimit = bytesPerSecond; } } @@ -322,13 +359,13 @@ size_t LLUpdateDownloader::Implementation::onHeader(void * buffer, size_t size) size_t lastDigitPos = header.find_last_of("0123456789"); std::string contentLength = header.substr(firstDigitPos, lastDigitPos - firstDigitPos + 1); size_t size = boost::lexical_cast<size_t>(contentLength); - LL_INFOS("UpdateDownload") << "download size is " << size << LL_ENDL; + LL_INFOS("UpdaterService") << "download size is " << size << LL_ENDL; mDownloadData["size"] = LLSD(LLSD::Integer(size)); llofstream odataStream(mDownloadRecordPath); LLSDSerialize::toPrettyXML(mDownloadData, odataStream); } catch (std::exception const & e) { - LL_WARNS("UpdateDownload") << "unable to read content length (" + LL_WARNS("UpdaterService") << "unable to read content length (" << e.what() << ")" << LL_ENDL; } } else { @@ -368,7 +405,7 @@ int LLUpdateDownloader::Implementation::onProgress(double downloadSize, double b event["payload"] = payload; LLEventPumps::instance().obtain("mainlooprepeater").post(event); - LL_INFOS("UpdateDownload") << "progress event " << payload << LL_ENDL; + LL_INFOS("UpdaterService") << "progress event " << payload << LL_ENDL; } else { ; // Keep events to a reasonalbe number. } @@ -381,29 +418,44 @@ void LLUpdateDownloader::Implementation::run(void) { CURLcode code = curl_easy_perform(mCurl); mDownloadStream.close(); - if(code == CURLE_OK) { + if(code == CURLE_OK) + { LLFile::remove(mDownloadRecordPath); - if(validateDownload()) { - LL_INFOS("UpdateDownload") << "download successful" << LL_ENDL; + if(validateDownload()) + { + LL_INFOS("UpdaterService") << "download successful" << LL_ENDL; mClient.downloadComplete(mDownloadData); - } else { - LL_INFOS("UpdateDownload") << "download failed hash check" << LL_ENDL; + } + else + { + LL_INFOS("UpdaterService") << "download failed hash check" << LL_ENDL; std::string filePath = mDownloadData["path"].asString(); - if(filePath.size() != 0) LLFile::remove(filePath); + if(filePath.size() != 0) + { + LLFile::remove(filePath); + } mClient.downloadError("failed hash check"); } - } else if(mCancelled && (code == CURLE_WRITE_ERROR)) { - LL_INFOS("UpdateDownload") << "download canceled by user" << LL_ENDL; + } + else if(mCancelled && (code == CURLE_WRITE_ERROR)) + { + LL_INFOS("UpdaterService") << "download canceled by user" << LL_ENDL; // Do not call back client. - } else { - LL_WARNS("UpdateDownload") << "download failed with error '" << + } + else + { + LL_WARNS("UpdaterService") << "download failed with error '" << curl_easy_strerror(code) << "'" << LL_ENDL; LLFile::remove(mDownloadRecordPath); - if(mDownloadData.has("path")) LLFile::remove(mDownloadData["path"].asString()); + if(mDownloadData.has("path")) + { + LLFile::remove(mDownloadData["path"].asString()); + } mClient.downloadError("curl error"); } - if(mHeaderList) { + if(mHeaderList) + { curl_slist_free_all(mHeaderList); mHeaderList = 0; } @@ -421,13 +473,16 @@ void LLUpdateDownloader::Implementation::initializeCurlGet(std::string const & u curl_easy_reset(mCurl); } - if(mCurl == 0) throw DownloadError("failed to initialize curl"); - + if(mCurl == 0) + { + throw DownloadError("failed to initialize curl"); + } throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_NOSIGNAL, true)); throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_FOLLOWLOCATION, true)); throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_WRITEFUNCTION, &write_function)); throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_WRITEDATA, this)); - if(processHeader) { + if(processHeader) + { throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_HEADERFUNCTION, &header_function)); throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_HEADERDATA, this)); } @@ -446,7 +501,7 @@ void LLUpdateDownloader::Implementation::initializeCurlGet(std::string const & u void LLUpdateDownloader::Implementation::resumeDownloading(size_t startByte) { - LL_INFOS("UpdateDownload") << "resuming download from " << mDownloadData["url"].asString() + LL_INFOS("UpdaterService") << "resuming download from " << mDownloadData["url"].asString() << " at byte " << startByte << LL_ENDL; initializeCurlGet(mDownloadData["url"].asString(), false); @@ -456,7 +511,10 @@ void LLUpdateDownloader::Implementation::resumeDownloading(size_t startByte) boost::format rangeHeaderFormat("Range: bytes=%u-"); rangeHeaderFormat % startByte; mHeaderList = curl_slist_append(mHeaderList, rangeHeaderFormat.str().c_str()); - if(mHeaderList == 0) throw DownloadError("cannot add Range header"); + if(mHeaderList == 0) + { + throw DownloadError("cannot add Range header"); + } throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_HTTPHEADER, mHeaderList)); mDownloadStream.open(mDownloadData["path"].asString(), @@ -476,9 +534,9 @@ void LLUpdateDownloader::Implementation::startDownloading(LLURI const & uri, std std::string filePath = gDirUtilp->getExpandedFilename(LL_PATH_TEMP, fileName); mDownloadData["path"] = filePath; - LL_INFOS("UpdateDownload") << "downloading " << filePath + LL_INFOS("UpdaterService") << "downloading " << filePath << " from " << uri.asString() << LL_ENDL; - LL_INFOS("UpdateDownload") << "hash of file is " << hash << LL_ENDL; + LL_INFOS("UpdaterService") << "hash of file is " << hash << LL_ENDL; llofstream dataStream(mDownloadRecordPath); LLSDSerialize::toPrettyXML(mDownloadData, dataStream); @@ -508,19 +566,26 @@ bool LLUpdateDownloader::Implementation::validateDownload(void) { std::string filePath = mDownloadData["path"].asString(); llifstream fileStream(filePath, std::ios_base::in | std::ios_base::binary); - if(!fileStream) return false; + if(!fileStream) + { + return false; + } std::string hash = mDownloadData["hash"].asString(); - if(hash.size() != 0) { - LL_INFOS("UpdateDownload") << "checking hash..." << LL_ENDL; + if(hash.size() != 0) + { + LL_INFOS("UpdaterService") << "checking hash..." << LL_ENDL; char digest[33]; LLMD5(fileStream).hex_digest(digest); - if(hash != digest) { - LL_WARNS("UpdateDownload") << "download hash mismatch; expeted " << hash << + if(hash != digest) + { + LL_WARNS("UpdaterService") << "download hash mismatch; expected " << hash << " but download is " << digest << LL_ENDL; } return hash == digest; - } else { + } + else + { return true; // No hash check provided. } } diff --git a/indra/viewer_components/updater/llupdatedownloader.h b/indra/viewer_components/updater/llupdatedownloader.h index 0d635640cf..f759988f12 100755 --- a/indra/viewer_components/updater/llupdatedownloader.h +++ b/indra/viewer_components/updater/llupdatedownloader.h @@ -54,7 +54,9 @@ public: // Start a new download. void download(LLURI const & uri, std::string const & hash, + std::string const & updateChannel, std::string const & updateVersion, + std::string const & info_url, bool required=false); // Returns true if a download is in progress. diff --git a/indra/viewer_components/updater/llupdateinstaller.cpp b/indra/viewer_components/updater/llupdateinstaller.cpp index 2f87d59373..a0e2c0b362 100755 --- a/indra/viewer_components/updater/llupdateinstaller.cpp +++ b/indra/viewer_components/updater/llupdateinstaller.cpp @@ -75,7 +75,7 @@ int ll_install_update(std::string const & script, llassert(!"unpossible copy mode"); } - llinfos << "UpdateInstaller: installing " << updatePath << " using " << + LL_INFOS("Updater") << "UpdateInstaller: installing " << updatePath << " using " << actualScriptPath << LL_ENDL; LLProcess::Params params; diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index bc73c72ddc..1bd9fa4fc0 100755 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -32,7 +32,6 @@ #include "lltimer.h" #include "llupdatechecker.h" #include "llupdateinstaller.h" -#include "llversionviewer.h" #include <boost/scoped_ptr.hpp> #include <boost/weak_ptr.hpp> @@ -44,6 +43,12 @@ #pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally #endif +#if ! defined(LL_VIEWER_VERSION_MAJOR) \ + || ! defined(LL_VIEWER_VERSION_MINOR) \ + || ! defined(LL_VIEWER_VERSION_PATCH) \ + || ! defined(LL_VIEWER_VERSION_BUILD) +#error "Version information is undefined" +#endif namespace { @@ -60,6 +65,8 @@ namespace { #ifdef LL_WINDOWS std::string scriptFile = "update_install.bat"; +#elif LL_DARWIN + std::string scriptFile = "update_install.py"; #else std::string scriptFile = "update_install"; #endif @@ -71,6 +78,8 @@ namespace #ifdef LL_WINDOWS return LL_COPY_INSTALL_SCRIPT_TO_TEMP; #else + // This is important on Mac because update_install.py looks at its own + // script pathname to discover the viewer app bundle to update. return LL_RUN_INSTALL_SCRIPT_IN_PLACE; #endif }; @@ -83,11 +92,15 @@ class LLUpdaterServiceImpl : { static const std::string sListenerName; - std::string mProtocolVersion; - std::string mUrl; - std::string mPath; - std::string mChannel; - std::string mVersion; + std::string mProtocolVersion; + std::string mUrl; + std::string mPath; + std::string mChannel; + std::string mVersion; + std::string mPlatform; + std::string mPlatformVersion; + unsigned char mUniqueId[MD5HEX_STR_SIZE]; + bool mWillingToTest; unsigned int mCheckPeriod; bool mIsChecking; @@ -107,11 +120,15 @@ public: LLUpdaterServiceImpl(); virtual ~LLUpdaterServiceImpl(); - void initialize(const std::string& protocol_version, - const std::string& url, - const std::string& path, - const std::string& channel, - const std::string& version); + void initialize(const std::string& url, + const std::string& path, + const std::string& channel, + const std::string& version, + const std::string& platform, + const std::string& platform_version, + const unsigned char uniqueid[MD5HEX_STR_SIZE], + const bool& willing_to_test + ); void setCheckPeriod(unsigned int seconds); void setBandwidthLimit(U64 bytesPerSecond); @@ -129,13 +146,9 @@ public: // LLUpdateChecker::Client: virtual void error(std::string const & message); - virtual void optionalUpdate(std::string const & newVersion, - LLURI const & uri, - std::string const & hash); - virtual void requiredUpdate(std::string const & newVersion, - LLURI const & uri, - std::string const & hash); - virtual void upToDate(void); + + // A successful response was received from the viewer version manager + virtual void response(LLSD const & content); // LLUpdateDownloader::Client void downloadComplete(LLSD const & data); @@ -144,6 +157,7 @@ public: bool onMainLoop(LLSD const & event); private: + std::string mNewChannel; std::string mNewVersion; void restartTimer(unsigned int seconds); @@ -169,11 +183,14 @@ LLUpdaterServiceImpl::~LLUpdaterServiceImpl() LLEventPumps::instance().obtain("mainloop").stopListening(sListenerName); } -void LLUpdaterServiceImpl::initialize(const std::string& protocol_version, - const std::string& url, - const std::string& path, - const std::string& channel, - const std::string& version) +void LLUpdaterServiceImpl::initialize(const std::string& url, + const std::string& path, + const std::string& channel, + const std::string& version, + const std::string& platform, + const std::string& platform_version, + const unsigned char uniqueid[MD5HEX_STR_SIZE], + const bool& willing_to_test) { if(mIsChecking || mIsDownloading) { @@ -181,11 +198,22 @@ void LLUpdaterServiceImpl::initialize(const std::string& protocol_version, "while updater is running."); } - mProtocolVersion = protocol_version; mUrl = url; mPath = path; mChannel = channel; mVersion = version; + mPlatform = platform; + mPlatformVersion = platform_version; + memcpy(mUniqueId, uniqueid, MD5HEX_STR_SIZE); + mWillingToTest = willing_to_test; + LL_DEBUGS("UpdaterService") + << "\n url: " << mUrl + << "\n path: " << mPath + << "\n channel: " << mChannel + << "\n version: " << mVersion + << "\n uniqueid: " << mUniqueId + << "\n willing: " << ( mWillingToTest ? "testok" : "testno" ) + << LL_ENDL; } void LLUpdaterServiceImpl::setCheckPeriod(unsigned int seconds) @@ -284,7 +312,7 @@ bool LLUpdaterServiceImpl::checkForInstall(bool launchInstaller) // the update. Do not install this update. if(!path.asString().empty()) { - llinfos << "ignoring update dowloaded by different client version" << llendl; + LL_INFOS("UpdaterService") << "ignoring update dowloaded by different client version" << LL_ENDL;; LLFile::remove(path.asString()); LLFile::remove(update_marker_path()); } @@ -311,9 +339,13 @@ bool LLUpdaterServiceImpl::checkForInstall(bool launchInstaller) if((result == 0) && mAppExitCallback) { mAppExitCallback(); - } else if(result != 0) { - llwarns << "failed to run update install script" << LL_ENDL; - } else { + } + else if(result != 0) + { + LL_WARNS("UpdaterService") << "failed to run update install script" << LL_ENDL; + } + else + { ; // No op. } } @@ -341,15 +373,19 @@ bool LLUpdaterServiceImpl::checkForResume() { mIsDownloading = true; mNewVersion = download_info["update_version"].asString(); + mNewChannel = download_info["update_channel"].asString(); mUpdateDownloader.resume(); result = true; } else { // The viewer that started this download is not the same as this viewer; ignore. - llinfos << "ignoring partial download from different viewer version" << llendl; + LL_INFOS("UpdaterService") << "ignoring partial download from different viewer version" << LL_ENDL;; std::string path = download_info["path"].asString(); - if(!path.empty()) LLFile::remove(path); + if(!path.empty()) + { + LLFile::remove(path); + } LLFile::remove(download_marker_path); } } @@ -366,36 +402,43 @@ void LLUpdaterServiceImpl::error(std::string const & message) } } -void LLUpdaterServiceImpl::optionalUpdate(std::string const & newVersion, - LLURI const & uri, - std::string const & hash) +// A successful response was received from the viewer version manager +void LLUpdaterServiceImpl::response(LLSD const & content) { - stopTimer(); - mNewVersion = newVersion; - mIsDownloading = true; - setState(LLUpdaterService::DOWNLOADING); - mUpdateDownloader.download(uri, hash, newVersion, false); -} - -void LLUpdaterServiceImpl::requiredUpdate(std::string const & newVersion, - LLURI const & uri, - std::string const & hash) -{ - stopTimer(); - mNewVersion = newVersion; - mIsDownloading = true; - setState(LLUpdaterService::DOWNLOADING); - mUpdateDownloader.download(uri, hash, newVersion, true); -} - -void LLUpdaterServiceImpl::upToDate(void) -{ - if(mIsChecking) + if(!content.asBoolean()) // an empty response means "no update" { - restartTimer(mCheckPeriod); - } + LL_INFOS("UpdaterService") << "up to date" << LL_ENDL; + if(mIsChecking) + { + restartTimer(mCheckPeriod); + } - setState(LLUpdaterService::UP_TO_DATE); + setState(LLUpdaterService::UP_TO_DATE); + } + else + { + // there is an update available... + stopTimer(); + mNewChannel = content["channel"].asString(); + if (mNewChannel.empty()) + { + LL_INFOS("UpdaterService") << "no channel supplied, assuming current channel" << LL_ENDL; + mNewChannel = mChannel; + } + mNewVersion = content["version"].asString(); + mIsDownloading = true; + setState(LLUpdaterService::DOWNLOADING); + BOOL required = content["required"].asBoolean(); + LLURI url(content["url"].asString()); + std::string more_info = content["more_info"].asString(); + LL_DEBUGS("UpdaterService") + << "Starting download of " + << ( required ? "required" : "optional" ) << " update" + << " to channel '" << mNewChannel << "' version " << mNewVersion + << " more info '" << more_info << "'" + << LL_ENDL; + mUpdateDownloader.download(url, content["hash"].asString(), mNewChannel, mNewVersion, more_info, required); + } } void LLUpdaterServiceImpl::downloadComplete(LLSD const & data) @@ -413,9 +456,19 @@ void LLUpdaterServiceImpl::downloadComplete(LLSD const & data) payload["type"] = LLSD(LLUpdaterService::DOWNLOAD_COMPLETE); payload["required"] = data["required"]; payload["version"] = mNewVersion; + payload["channel"] = mNewChannel; + payload["info_url"] = data["info_url"]; event["payload"] = payload; + LL_DEBUGS("UpdaterService") + << "Download complete " + << ( data["required"].asBoolean() ? "required" : "optional" ) + << " channel " << mNewChannel + << " version " << mNewVersion + << " info " << data["info_url"].asString() + << LL_ENDL; + LLEventPumps::instance().obtain("mainlooprepeater").post(event); - + setState(LLUpdaterService::TERMINAL); } @@ -489,15 +542,18 @@ bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event) // Check for failed install. if(LLFile::isfile(ll_install_failed_marker_path())) { + LL_DEBUGS("UpdaterService") << "found marker " << ll_install_failed_marker_path() << LL_ENDL;; int requiredValue = 0; { llifstream stream(ll_install_failed_marker_path()); stream >> requiredValue; - if(stream.fail()) requiredValue = 0; + if(stream.fail()) + { + requiredValue = 0; + } } // TODO: notify the user. - llinfos << "found marker " << ll_install_failed_marker_path() << llendl; - llinfos << "last install attempt failed" << llendl; + LL_WARNS("UpdaterService") << "last install attempt failed" << LL_ENDL;; LLFile::remove(ll_install_failed_marker_path()); LLSD event; @@ -509,7 +565,7 @@ bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event) } else { - mUpdateChecker.checkVersion(mProtocolVersion, mUrl, mPath, mChannel, mVersion); + mUpdateChecker.checkVersion(mUrl, mPath, mChannel, mVersion, mPlatform, mPlatformVersion, mUniqueId, mWillingToTest); setState(LLUpdaterService::CHECKING_FOR_UPDATE); } } @@ -554,13 +610,17 @@ LLUpdaterService::~LLUpdaterService() { } -void LLUpdaterService::initialize(const std::string& protocol_version, - const std::string& url, - const std::string& path, - const std::string& channel, - const std::string& version) +void LLUpdaterService::initialize(const std::string& url, + const std::string& path, + const std::string& channel, + const std::string& version, + const std::string& platform, + const std::string& platform_version, + const unsigned char uniqueid[MD5HEX_STR_SIZE], + const bool& willing_to_test +) { - mImpl->initialize(protocol_version, url, path, channel, version); + mImpl->initialize(url, path, channel, version, platform, platform_version, uniqueid, willing_to_test); } void LLUpdaterService::setCheckPeriod(unsigned int seconds) @@ -609,10 +669,10 @@ std::string const & ll_get_version(void) { if (version.empty()) { std::ostringstream stream; - stream << LL_VERSION_MAJOR << "." - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VERSION_BUILD; + stream << LL_VIEWER_VERSION_MAJOR << "." + << LL_VIEWER_VERSION_MINOR << "." + << LL_VIEWER_VERSION_PATCH << "." + << LL_VIEWER_VERSION_BUILD; version = stream.str(); } diff --git a/indra/viewer_components/updater/llupdaterservice.h b/indra/viewer_components/updater/llupdaterservice.h index 450f19c1c6..982f99b861 100755 --- a/indra/viewer_components/updater/llupdaterservice.h +++ b/indra/viewer_components/updater/llupdaterservice.h @@ -28,6 +28,7 @@ #include <boost/shared_ptr.hpp> #include <boost/function.hpp> +#include "llhasheduniqueid.h" class LLUpdaterServiceImpl; @@ -70,11 +71,15 @@ public: LLUpdaterService(); ~LLUpdaterService(); - void initialize(const std::string& protocol_version, - const std::string& url, - const std::string& path, - const std::string& channel, - const std::string& version); + void initialize(const std::string& url, + const std::string& path, + const std::string& channel, + const std::string& version, + const std::string& platform, + const std::string& platform_version, + const unsigned char uniqueid[MD5HEX_STR_SIZE], + const bool& willing_to_test + ); void setCheckPeriod(unsigned int seconds); void setBandwidthLimit(U64 bytesPerSecond); diff --git a/indra/viewer_components/updater/scripts/darwin/janitor.py b/indra/viewer_components/updater/scripts/darwin/janitor.py new file mode 100644 index 0000000000..cdf33df731 --- /dev/null +++ b/indra/viewer_components/updater/scripts/darwin/janitor.py @@ -0,0 +1,133 @@ +#!/usr/bin/python +"""\ +@file janitor.py +@author Nat Goodspeed +@date 2011-09-14 +@brief Janitor class to clean up arbitrary resources + +2013-01-04 cloned from vita because it's exactly what update_install.py needs. + +$LicenseInfo:firstyear=2011&license=viewerlgpl$ +Copyright (c) 2011, Linden Research, Inc. +$/LicenseInfo$ +""" + +import sys +import functools +import itertools + +class Janitor(object): + """ + Usage: + + Basic: + self.janitor = Janitor(sys.stdout) # report cleanup actions on stdout + ... + self.janitor.later(os.remove, some_temp_file) + self.janitor.later(os.remove, some_other_file) + ... + self.janitor.cleanup() # perform cleanup actions + + Context Manager: + with Janitor() as janitor: # clean up quietly + ... + janitor.later(shutil.rmtree, some_temp_directory) + ... + # exiting 'with' block performs cleanup + + Test Class: + class TestMySoftware(unittest.TestCase, Janitor): + def __init__(self): + Janitor.__init__(self) # quiet cleanup + ... + + def setUp(self): + ... + self.later(os.rename, saved_file, original_location) + ... + + def tearDown(self): + Janitor.tearDown(self) # calls cleanup() + ... + # Or, if you have no other tearDown() logic for + # TestMySoftware, you can omit the TestMySoftware.tearDown() + # def entirely and let it inherit Janitor.tearDown(). + """ + def __init__(self, stream=None): + """ + If you pass stream= (e.g.) sys.stdout or sys.stderr, Janitor will + report its cleanup operations as it performs them. If you don't, it + will perform them quietly -- unless one or more of the actions throws + an exception, in which case you'll get output on stderr. + """ + self.stream = stream + self.cleanups = [] + + def later(self, func, *args, **kwds): + """ + Pass the callable you want to call at cleanup() time, plus any + positional or keyword args you want to pass it. + """ + # Get a name string for 'func' + try: + # A free function has a __name__ + name = func.__name__ + except AttributeError: + try: + # A class object (even builtin objects like ints!) support + # __class__.__name__ + name = func.__class__.__name__ + except AttributeError: + # Shrug! Just use repr() to get a string describing this func. + name = repr(func) + # Construct a description of this operation in Python syntax from + # args, kwds. + desc = "%s(%s)" % \ + (name, ", ".join(itertools.chain((repr(a) for a in args), + ("%s=%r" % (k, v) for (k, v) in kwds.iteritems())))) + # Use functools.partial() to bind passed args and keywords to the + # passed func so we get a nullary callable that does what caller + # wants. + bound = functools.partial(func, *args, **kwds) + self.cleanups.append((desc, bound)) + + def cleanup(self): + """ + Perform all the actions saved with later() calls. + """ + # Typically one allocates resource A, then allocates resource B that + # depends on it. In such a scenario it's appropriate to delete B + # before A -- so perform cleanup actions in reverse order. (This is + # the same strategy used by atexit().) + while self.cleanups: + # Until our list is empty, pop the last pair. + desc, bound = self.cleanups.pop(-1) + + # If requested, report the action. + if self.stream is not None: + print >>self.stream, desc + + try: + # Call the bound callable + bound() + except Exception, err: + # This is cleanup. Report the problem but continue. + print >>(self.stream or sys.stderr), "Calling %s\nraised %s: %s" % \ + (desc, err.__class__.__name__, err) + + def tearDown(self): + """ + If a unittest.TestCase subclass (or a nose test class) adds Janitor as + one of its base classes, and has no other tearDown() logic, let it + inherit Janitor.tearDown(). + """ + self.cleanup() + + def __enter__(self): + return self + + def __exit__(self, type, value, tb): + # Perform cleanup no matter how we exit this 'with' statement + self.cleanup() + # Propagate any exception from the 'with' statement, don't swallow it + return False diff --git a/indra/viewer_components/updater/scripts/darwin/messageframe.py b/indra/viewer_components/updater/scripts/darwin/messageframe.py new file mode 100644 index 0000000000..8f58848882 --- /dev/null +++ b/indra/viewer_components/updater/scripts/darwin/messageframe.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +"""\ +@file messageframe.py +@author Nat Goodspeed +@date 2013-01-03 +@brief Define MessageFrame class for popping up messages from a command-line + script. + +$LicenseInfo:firstyear=2013&license=viewerlgpl$ +Copyright (c) 2013, Linden Research, Inc. +$/LicenseInfo$ +""" + +import Tkinter as tk +import os + +# Tricky way to obtain the filename of the main script (default title string) +import __main__ + +# This class is intended for displaying messages from a command-line script. +# Getting the base class right took a bit of trial and error. +# If you derive from tk.Frame, the destroy() method doesn't actually close it. +# If you derive from tk.Toplevel, it pops up a separate Tk frame too. destroy() +# closes this frame, but not that one. +# Deriving from tk.Tk appears to do the right thing. +class MessageFrame(tk.Tk): + def __init__(self, text="", title=os.path.splitext(os.path.basename(__main__.__file__))[0], + width=320, height=120): + tk.Tk.__init__(self) + self.grid() + self.title(title) + self.var = tk.StringVar() + self.var.set(text) + self.msg = tk.Label(self, textvariable=self.var) + self.msg.grid() + # from http://stackoverflow.com/questions/3352918/how-to-center-a-window-on-the-screen-in-tkinter : + self.update_idletasks() + + # The constants below are to adjust for typical overhead from the + # frame borders. + xp = (self.winfo_screenwidth() / 2) - (width / 2) - 8 + yp = (self.winfo_screenheight() / 2) - (height / 2) - 20 + self.geometry('{0}x{1}+{2}+{3}'.format(width, height, xp, yp)) + self.update() + + def set(self, text): + self.var.set(text) + self.update() + +if __name__ == "__main__": + # When run as a script, just test the MessageFrame. + import sys + import time + + frame = MessageFrame("something in the way she moves....") + time.sleep(3) + frame.set("smaller") + time.sleep(3) + frame.set("""this has +several +lines""") + time.sleep(3) + frame.destroy() + print "Destroyed!" + sys.stdout.flush() + time.sleep(3) diff --git a/indra/viewer_components/updater/scripts/darwin/update_install b/indra/viewer_components/updater/scripts/darwin/update_install deleted file mode 100755 index e7f36dc5a3..0000000000 --- a/indra/viewer_components/updater/scripts/darwin/update_install +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/bash - -# -# The first argument contains the path to the installer app. The second a path -# to a marker file which should be created if the installer fails.q -# - -cd "$(dirname "$0")" -(../Resources/mac-updater.app/Contents/MacOS/mac-updater -dmg "$1" -name "Second Life Viewer"; if [ $? -ne 0 ]; then echo $3 >> "$2"; fi;) & -exit 0 diff --git a/indra/viewer_components/updater/scripts/darwin/update_install.py b/indra/viewer_components/updater/scripts/darwin/update_install.py new file mode 100755 index 0000000000..2fc6fcdb29 --- /dev/null +++ b/indra/viewer_components/updater/scripts/darwin/update_install.py @@ -0,0 +1,373 @@ +#!/usr/bin/python +"""\ +@file update_install.py +@author Nat Goodspeed +@date 2012-12-20 +@brief Update the containing Second Life application bundle to the version in + the specified disk image file. + + This Python implementation is derived from the previous mac-updater + application, a funky mix of C++, classic C and Objective-C. + +$LicenseInfo:firstyear=2012&license=viewerlgpl$ +Copyright (c) 2012, Linden Research, Inc. +$/LicenseInfo$ +""" + +import os +import sys +import cgitb +import errno +import glob +import plistlib +import re +import shutil +import subprocess +import tempfile +import time +from janitor import Janitor +from messageframe import MessageFrame +import Tkinter, tkMessageBox + +TITLE = "Second Life Viewer Updater" +# Magic bundle identifier used by all Second Life viewer bundles +BUNDLE_IDENTIFIER = "com.secondlife.indra.viewer" + +# Global handle to the MessageFrame so we can update message +FRAME = None +# Global handle to logfile, once it's open +LOGF = None + +# **************************************************************************** +# Logging and messaging +# +# This script is normally run implicitly by the old viewer to update to the +# new viewer. Its UI consists of a MessageFrame and possibly a Tk error box. +# Log details to updater.log -- especially uncaught exceptions! +# **************************************************************************** +def log(message): + """write message only to LOGF (also called by status() and fail())""" + # If we don't even have LOGF open yet, at least write to Console log + logf = LOGF or sys.stderr + logf.writelines((time.strftime("%Y-%m-%dT%H:%M:%SZ ", time.gmtime()), message, '\n')) + logf.flush() + +def status(message): + """display and log normal progress message""" + log(message) + + global FRAME + if not FRAME: + FRAME = MessageFrame(message, TITLE) + else: + FRAME.set(message) + +def fail(message): + """log message, produce error box, then terminate with nonzero rc""" + log(message) + + # If we haven't yet called status() (we don't yet have a FRAME), perform a + # bit of trickery to bypass the spurious "main window" that Tkinter would + # otherwise pop up if the first call is showerror(). + if not FRAME: + root = Tkinter.Tk() + root.withdraw() + + # If we do have a LOGF available, mention it in the error box. + if LOGF: + message = "%s\n(Updater log in %s)" % (message, LOGF.name) + + # We explicitly specify the WARNING icon because, at least on the Tkinter + # bundled with the system-default Python 2.7 on Mac OS X 10.7.4, the + # ERROR, QUESTION and INFO icons are all the silly Tk rocket ship. At + # least WARNING has an exclamation in a yellow triangle, even though + # overlaid by a smaller image of the rocket ship. + tkMessageBox.showerror(TITLE, +"""An error occurred while updating Second Life: +%s +Please download the latest viewer from www.secondlife.com.""" % message, + icon=tkMessageBox.WARNING) + sys.exit(1) + +def exception(err): + """call fail() with an exception instance""" + fail("%s exception: %s" % (err.__class__.__name__, str(err))) + +def excepthook(type, value, traceback): + """ + Store this hook function into sys.excepthook until we have a logfile. + """ + # At least in older Python versions, it could be tricky to produce a + # string from 'type' and 'value'. For instance, an OSError exception would + # pass type=OSError and value=some_tuple. Empirically, this funky + # expression seems to work. + exception(type(*value)) +sys.excepthook = excepthook + +class ExceptHook(object): + """ + Store an instance of this class into sys.excepthook once we have a logfile + open. + """ + def __init__(self, logfile): + # There's no magic to the cgitb.enable() function -- it merely stores + # an instance of cgitb.Hook into sys.excepthook, passing enable()'s + # params into Hook.__init__(). Sadly, enable() doesn't forward all its + # params using (*args, **kwds) syntax -- another story. But the point + # is that all the goodness is in the cgitb.Hook class. Capture an + # instance. + self.hook = cgitb.Hook(file=logfile, format="text") + + def __call__(self, type, value, traceback): + # produce nice text traceback to logfile + self.hook(type, value, traceback) + # Now display an error box. + excepthook(type, value, traceback) + +def write_marker(markerfile, markertext): + log("writing %r to %s" % (markertext, markerfile)) + try: + with open(markerfile, "w") as markerf: + markerf.write(markertext) + except IOError, err: + # write_marker() is invoked by fail(), and fail() is invoked by other + # error-handling functions. If we try to invoke any of those, we'll + # get infinite recursion. If for any reason we can't write markerfile, + # try to log it -- otherwise shrug. + log("%s exception: %s" % (err.__class__.__name__, err)) + +# **************************************************************************** +# Main script logic +# **************************************************************************** +def main(dmgfile, markerfile, markertext): + # Should we fail, we're supposed to write 'markertext' to 'markerfile'. + # Wrap the fail() function so we do that. + global fail + oldfail = fail + def fail(message): + write_marker(markerfile, markertext) + oldfail(message) + + try: + # Starting with the Cocoafied viewer, we'll find viewer logs in + # ~/Library/Application Support/$CFBundleIdentifier/logs rather than in + # ~/Library/Application Support/SecondLife/logs as before. This could be + # obnoxious -- but we Happen To Know that markerfile is a path specified + # within the viewer's logs directory. Use that. + logsdir = os.path.dirname(markerfile) + + # Move the old updater.log file out of the way + logname = os.path.join(logsdir, "updater.log") + try: + os.rename(logname, logname + ".old") + except OSError, err: + # Nonexistence is okay. Anything else, not so much. + if err.errno != errno.ENOENT: + raise + + # Open new updater.log. + global LOGF + LOGF = open(logname, "w") + + # Now that LOGF is in fact open for business, use it to log any further + # uncaught exceptions. + sys.excepthook = ExceptHook(LOGF) + + # log how this script was invoked + log(' '.join(repr(arg) for arg in sys.argv)) + + # prepare for other cleanup + with Janitor(LOGF) as janitor: + + # Try to derive the name of the running viewer app bundle from our + # own pathname. (Hopefully the old viewer won't copy this script + # to a temp dir before running!) + # Somewhat peculiarly, this script is currently packaged in + # Appname.app/Contents/MacOS with the viewer executable. But even + # if we decide to move it to Appname.app/Contents/Resources, we'll + # still find Appname.app two levels up from dirname(__file__). + appdir = os.path.abspath(os.path.join(os.path.dirname(__file__), + os.pardir, os.pardir)) + if not appdir.endswith(".app"): + # This can happen if either this script has been copied before + # being executed, or if it's in an unexpected place in the app + # bundle. + fail(appdir + " is not an application directory") + + # We need to install into appdir's parent directory -- can we? + installdir = os.path.abspath(os.path.join(appdir, os.pardir)) + if not os.access(installdir, os.W_OK): + fail("Can't modify " + installdir) + + # invent a temporary directory + tempdir = tempfile.mkdtemp() + log("created " + tempdir) + # clean it up when we leave + janitor.later(shutil.rmtree, tempdir) + + status("Mounting image...") + + mntdir = os.path.join(tempdir, "mnt") + log("mkdir " + mntdir) + os.mkdir(mntdir) + command = ["hdiutil", "attach", dmgfile, "-mountpoint", mntdir] + log(' '.join(command)) + # Instantiating subprocess.Popen launches a child process with the + # specified command line. stdout=PIPE passes a pipe to its stdout. + hdiutil = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=LOGF) + # Popen.communicate() reads that pipe until the child process + # terminates, returning (stdout, stderr) output. Select just stdout. + hdiutil_out = hdiutil.communicate()[0] + if hdiutil.returncode != 0: + fail("Couldn't mount " + dmgfile) + # hdiutil should report the devnode. Find that. + found = re.search(r"/dev/[^ ]*\b", hdiutil_out) + if not found: + # If we don't spot the devnode, log it and continue -- we only + # use it to detach it. Don't fail the whole update if we can't + # clean up properly. + log("Couldn't spot devnode in hdiutil output:\n" + hdiutil_out) + else: + # If we do spot the devnode, detach it when done. + janitor.later(subprocess.call, ["hdiutil", "detach", found.group(0)], + stdout=LOGF, stderr=subprocess.STDOUT) + + status("Searching for app bundle...") + + for candidate in glob.glob(os.path.join(mntdir, "*.app")): + log("Considering " + candidate) + try: + # By convention, a valid Mac app bundle has a + # Contents/Info.plist file containing at least + # CFBundleIdentifier. + CFBundleIdentifier = \ + plistlib.readPlist(os.path.join(candidate, "Contents", + "Info.plist"))["CFBundleIdentifier"] + except Exception, err: + # might be IOError, xml.parsers.expat.ExpatError, KeyError + # Any of these means it's not a valid app bundle. Instead + # of aborting, just skip this candidate and continue. + log("%s not a valid app bundle: %s: %s" % + (candidate, err.__class__.__name__, err)) + continue + + if CFBundleIdentifier == BUNDLE_IDENTIFIER: + break + + log("unrecognized CFBundleIdentifier: " + CFBundleIdentifier) + + else: + fail("Could not find Second Life viewer in " + dmgfile) + + # Here 'candidate' is the new viewer to install + log("Found " + candidate) + + # This logic was changed to make Mac updates behave more like + # Windows. Most of the time, the user doesn't change the name of + # the app bundle on our .dmg installer (e.g. "Second Life Beta + # Viewer.app"). Most of the time, the version manager directs a + # given viewer to update to another .dmg containing an app bundle + # with THE SAME name. In that case, everything behaves as usual. + + # The case that was changed is when the version manager offers (or + # mandates) an update to a .dmg containing a different app bundle + # name. This can happen, for instance, to a user who's downloaded + # a "project beta" viewer, and the project subsequently publishes + # a Release Candidate viewer. Say the project beta's app bundle + # name is something like "Second Life Beta Neato.app". Anyone + # launching that viewer will be offered an update to the + # corresponding Release Candidate viewer -- which will be built as + # a release viewer, with app bundle name "Second Life Viewer.app". + + # On Windows, we run the NSIS installer, which will update/replace + # the embedded install directory name, e.g. Second Life Viewer. + # But the Mac installer used to locate the app bundle name in the + # mounted .dmg file, then ignore that name, copying its contents + # into the app bundle directory of the running viewer. That is, + # we'd install the Release Candidate from the .dmg's "Second + # Life.app" into "/Applications/Second Life Beta Neato.app". This + # is undesired behavior. + + # Instead, having found the app bundle name on the mounted .dmg, + # we try to install that app bundle name into the parent directory + # of the running app bundle. + + # Are we installing a different app bundle name? If so, call it + # out, both in the log and for the user -- this is an odd case. + # (Presumably they've already agreed to a similar notification in + # the viewer before the viewer launched this script, but still.) + bundlename = os.path.basename(candidate) + if os.path.basename(appdir) == bundlename: + # updating the running app bundle, which we KNOW exists + appexists = True + else: + # installing some other app bundle + newapp = os.path.join(installdir, bundlename) + appexists = os.path.exists(newapp) + message = "Note: %s %s %s" % \ + (appdir, "updating" if appexists else "installing new", newapp) + status(message) + # okay, we have no further need of the name of the running app + # bundle. + appdir = newapp + + status("Preparing to copy files...") + + if appexists: + # move old viewer to temp location in case copy from .dmg fails + aside = os.path.join(tempdir, os.path.basename(appdir)) + log("mv %r %r" % (appdir, aside)) + # Use shutil.move() instead of os.rename(). move() first tries + # os.rename(), but falls back to shutil.copytree() if the dest is + # on a different filesystem. + shutil.move(appdir, aside) + + status("Copying files...") + + # shutil.copytree()'s target must not already exist. But we just + # moved appdir out of the way. + log("cp -p %r %r" % (candidate, appdir)) + try: + # The viewer app bundle does include internal symlinks. Keep them + # as symlinks. + shutil.copytree(candidate, appdir, symlinks=True) + except Exception, err: + # copy failed -- try to restore previous viewer before crumping + type, value, traceback = sys.exc_info() + if appexists: + log("exception response: mv %r %r" % (aside, appdir)) + shutil.move(aside, appdir) + # let our previously-set sys.excepthook handle this + raise type, value, traceback + + status("Cleaning up...") + + log("touch " + appdir) + os.utime(appdir, None) # set to current time + + command = ["open", appdir] + log(' '.join(command)) + subprocess.check_call(command, stdout=LOGF, stderr=subprocess.STDOUT) + + except Exception, err: + # Because we carefully set sys.excepthook -- and even modify it to log + # the problem once we have our log file open -- you might think we + # could just let exceptions propagate. But when we do that, on + # exception in this block, we FIRST restore the no-side-effects fail() + # and THEN implicitly call sys.excepthook(), which calls the (no-side- + # effects) fail(). Explicitly call sys.excepthook() BEFORE restoring + # fail(). Only then do we get the enriched fail() behavior. + sys.excepthook(*sys.exc_info()) + + finally: + # When we leave main() -- for whatever reason -- reset fail() the way + # it was before, because the bound markerfile, markertext params + # passed to this main() call are no longer applicable. + fail = oldfail + +if __name__ == "__main__": + # We expect this script to be invoked with: + # - the pathname to the .dmg we intend to install; + # - the pathname to an update-error marker file to create on failure; + # - the content to write into the marker file. + main(*sys.argv[1:]) diff --git a/indra/viewer_components/updater/tests/llupdaterservice_test.cpp b/indra/viewer_components/updater/tests/llupdaterservice_test.cpp index de07beee7c..4812272ebc 100755 --- a/indra/viewer_components/updater/tests/llupdaterservice_test.cpp +++ b/indra/viewer_components/updater/tests/llupdaterservice_test.cpp @@ -44,11 +44,17 @@ *****************************************************************************/ LLUpdateChecker::LLUpdateChecker(LLUpdateChecker::Client & client) {} -void LLUpdateChecker::checkVersion(std::string const & protocolVersion, std::string const & hostUrl, - std::string const & servicePath, std::string channel, std::string version) +void LLUpdateChecker::checkVersion(std::string const & hostUrl, + std::string const & servicePath, + std::string const & channel, + std::string const & version, + std::string const & platform, + std::string const & platform_version, + unsigned char uniqueid[MD5HEX_STR_SIZE], + bool willing_to_test) {} LLUpdateDownloader::LLUpdateDownloader(Client & ) {} -void LLUpdateDownloader::download(LLURI const & , std::string const &, std::string const &, bool){} +void LLUpdateDownloader::download(LLURI const & , std::string const &, std::string const &, std::string const &, std::string const &, bool){} class LLDir_Mock : public LLDir { @@ -172,9 +178,11 @@ namespace tut bool got_usage_error = false; try { - updater.initialize("1.0",test_url, "update" ,test_channel, test_version); + unsigned char id1[MD5HEX_STR_SIZE] = "11111111111111111111111111111111"; + updater.initialize(test_url, "update" ,test_channel, test_version, "win", "1.2.3", id1, true); updater.startChecking(); - updater.initialize("1.0", "other_url", "update", test_channel, test_version); + unsigned char id2[MD5HEX_STR_SIZE] = "22222222222222222222222222222222"; + updater.initialize("other_url", "update", test_channel, test_version, "win", "4.5.6", id2, true); } catch(LLUpdaterService::UsageError) { @@ -188,7 +196,8 @@ namespace tut { DEBUG; LLUpdaterService updater; - updater.initialize("1.0", test_url, "update", test_channel, test_version); + unsigned char id[MD5HEX_STR_SIZE] = "33333333333333333333333333333333"; + updater.initialize(test_url, "update", test_channel, test_version, "win", "7.8.9", id, true); updater.startChecking(); ensure(updater.isChecking()); updater.stopChecking(); diff --git a/scripts/build_version.py b/scripts/build_version.py deleted file mode 100755 index 203d76fe9e..0000000000 --- a/scripts/build_version.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python -"""\ -@file build_version.py -@brief Print the build information embedded in a header file. - - Expects to be invoked from the command line with a file name and a - list of directories to search. The file name will be one of the - following: - - llversionserver.h - llversionviewer.h - - The directory list that follows will include indra/llcommon, where - these files live. - -$LicenseInfo:firstyear=2010&license=viewerlgpl$ -Second Life Viewer Source Code -Copyright (C) 2010-2011, Linden Research, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; -version 2.1 of the License only. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -$/LicenseInfo$ -""" - -import errno, os, re - -def get_version(filename): - fp = open(filename) - data = fp.read() - fp.close() - - vals = {} - m = re.search('const S32 LL_VERSION_MAJOR = (\d+);', data) - vals['major'] = m.group(1) - m = re.search('const S32 LL_VERSION_MINOR = (\d+);', data) - vals['minor'] = m.group(1) - m = re.search('const S32 LL_VERSION_PATCH = (\d+);', data) - vals['patch'] = m.group(1) - m = re.search('const S32 LL_VERSION_BUILD = (\d+);', data) - vals['build'] = m.group(1) - - return "%(major)s.%(minor)s.%(patch)s.%(build)s" % vals - -if __name__ == '__main__': - import sys - - try: - for path in sys.argv[2:]: - name = os.path.join(path, sys.argv[1]) - try: - print get_version(name) - break - except OSError, err: - if err.errno != errno.ENOENT: - raise - else: - print >> sys.stderr, 'File not found:', sys.argv[1] - sys.exit(1) - except AttributeError: - print >> sys.stderr, 'Error: malformatted file: ', name - sys.exit(1) - except IndexError: - print >> sys.stderr, ('Usage: %s llversion[...].h [directories]' % - sys.argv[0]) diff --git a/scripts/update_version_files.py b/scripts/update_version_files.py deleted file mode 100755 index 87036dc1c0..0000000000 --- a/scripts/update_version_files.py +++ /dev/null @@ -1,343 +0,0 @@ -#!/usr/bin/env python -"""\ -@file update_version_files.py -@brief Update all of the various files in the repository to a new version number, -instead of having to figure it out by hand - -$LicenseInfo:firstyear=2010&license=viewerlgpl$ -Second Life Viewer Source Code -Copyright (C) 2010-2011, Linden Research, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; -version 2.1 of the License only. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -$/LicenseInfo$ -""" - -import sys -import os.path - -# Look for indra/lib/python in all possible parent directories ... -# This is an improvement over the setup-path.py method used previously: -# * the script may blocated anywhere inside the source tree -# * it doesn't depend on the current directory -# * it doesn't depend on another file being present. - -def add_indra_lib_path(): - root = os.path.realpath(__file__) - # always insert the directory of the script in the search path - dir = os.path.dirname(root) - if dir not in sys.path: - sys.path.insert(0, dir) - - # Now go look for indra/lib/python in the parent dies - while root != os.path.sep: - root = os.path.dirname(root) - dir = os.path.join(root, 'indra', 'lib', 'python') - if os.path.isdir(dir): - if dir not in sys.path: - sys.path.insert(0, dir) - break - else: - print >>sys.stderr, "This script is not inside a valid installation." - sys.exit(1) - -add_indra_lib_path() - -import getopt, os, re, commands -from indra.util import llversion - -def usage(): - print "Usage:" - print sys.argv[0] + """ [options] - -Options: - --version - Specify the version string to replace current version. - --revision - Specify the revision to replace the last digit of the version. - By default, revision is computed from the version control system. - --skip-on-branch - Specify a regular expression against which the current branch - is matched. If it matches, then leave version strings alone. - Use this to avoid changing version strings on release candidate - builds. - --server - Update llversionserver.h only with new version - --viewer - Update llversionviewer.h only with new version - --channel - Specify the viewer channel string to replace current channel. - --server_channel - Specify the server channel string to replace current channel. - --verbose - --help - Print this message and exit. - -Common Uses: - # Update server and viewer build numbers to the current hg revision: - update_version_files.py - - # Update build numbers unless we are on a release branch: - update_version_files.py --skip-on-branch='^Branch_' - - # Update server and viewer version numbers explicitly: - update_version_files.py --version=1.18.1.6 - - # Update just the viewer version number explicitly: - update_version_files.py --viewer --version=1.18.1.6 - - # Update just the server build number to the current hg revision: - update_version_files.py --server - - # Update the viewer channel - update_version_files.py --channel="First Look Puppeteering" - - # Update the server channel - update_version_files.py --server_channel="Het Grid" - -""" -def _getstatusoutput(cmd): - """Return Win32 (status, output) of executing cmd -in a shell.""" - if os.path.sep != "/": - # stupid #%#$$ windows - cmd = 'cmd.exe /c "'+cmd+'"' - pipe = os.popen(cmd, 'r') - text = pipe.read() - sts = pipe.close() - if sts is None: sts = 0 - if text[-1:] == '\n': text = text[:-1] - return sts, text - -re_map = {} - -#re_map['filename'] = (('pattern', 'replacement'), -# ('pattern', 'replacement') -re_map['indra/llcommon/llversionviewer.h'] = \ - (('const S32 LL_VERSION_MAJOR = (\d+);', - 'const S32 LL_VERSION_MAJOR = %(VER_MAJOR)s;'), - ('const S32 LL_VERSION_MINOR = (\d+);', - 'const S32 LL_VERSION_MINOR = %(VER_MINOR)s;'), - ('const S32 LL_VERSION_PATCH = (\d+);', - 'const S32 LL_VERSION_PATCH = %(VER_PATCH)s;'), - ('const S32 LL_VERSION_BUILD = (\d+);', - 'const S32 LL_VERSION_BUILD = %(VER_BUILD)s;'), - ('const char \* const LL_CHANNEL = "(.+)";', - 'const char * const LL_CHANNEL = "%(VIEWER_CHANNEL)s";')) -re_map['indra/llcommon/llversionserver.h'] = \ - (('const S32 LL_VERSION_MAJOR = (\d+);', - 'const S32 LL_VERSION_MAJOR = %(SERVER_VER_MAJOR)s;'), - ('const S32 LL_VERSION_MINOR = (\d+);', - 'const S32 LL_VERSION_MINOR = %(SERVER_VER_MINOR)s;'), - ('const S32 LL_VERSION_PATCH = (\d+);', - 'const S32 LL_VERSION_PATCH = %(SERVER_VER_PATCH)s;'), - ('const S32 LL_VERSION_BUILD = (\d+);', - 'const S32 LL_VERSION_BUILD = %(SERVER_VER_BUILD)s;'), - ('const char \* const LL_CHANNEL = "(.+)";', - 'const char * const LL_CHANNEL = "%(SERVER_CHANNEL)s";')) -re_map['indra/newview/res/viewerRes.rc'] = \ - (('FILEVERSION [0-9,]+', - 'FILEVERSION %(VER_MAJOR)s,%(VER_MINOR)s,%(VER_PATCH)s,%(VER_BUILD)s'), - ('PRODUCTVERSION [0-9,]+', - 'PRODUCTVERSION %(VER_MAJOR)s,%(VER_MINOR)s,%(VER_PATCH)s,%(VER_BUILD)s'), - ('VALUE "FileVersion", "[0-9.]+"', - 'VALUE "FileVersion", "%(VER_MAJOR)s.%(VER_MINOR)s.%(VER_PATCH)s.%(VER_BUILD)s"'), - ('VALUE "ProductVersion", "[0-9.]+"', - 'VALUE "ProductVersion", "%(VER_MAJOR)s.%(VER_MINOR)s.%(VER_PATCH)s.%(VER_BUILD)s"')) - -# Trailing ',' in top level tuple is special form to avoid parsing issues with one element tuple -re_map['indra/newview/Info-SecondLife.plist'] = \ - (('<key>CFBundleVersion</key>\n\t<string>[0-9.]+</string>', - '<key>CFBundleVersion</key>\n\t<string>%(VER_MAJOR)s.%(VER_MINOR)s.%(VER_PATCH)s.%(VER_BUILD)s</string>'),) - -# This will probably only work as long as InfoPlist.strings is NOT UTF16, which is should be... -re_map['indra/newview/English.lproj/InfoPlist.strings'] = \ - (('CFBundleShortVersionString = "Second Life version [0-9.]+";', - 'CFBundleShortVersionString = "Second Life version %(VER_MAJOR)s.%(VER_MINOR)s.%(VER_PATCH)s.%(VER_BUILD)s";'), - ('CFBundleGetInfoString = "Second Life version [0-9.]+', - 'CFBundleGetInfoString = "Second Life version %(VER_MAJOR)s.%(VER_MINOR)s.%(VER_PATCH)s.%(VER_BUILD)s')) - - -version_re = re.compile('(\d+).(\d+).(\d+).(\d+)') - -def main(): - script_path = os.path.dirname(__file__) - src_root = script_path + "/../" - verbose = False - - opts, args = getopt.getopt(sys.argv[1:], - "", - ['version=', - 'revision=', - 'channel=', - 'server_channel=', - 'skip-on-branch=', - 'verbose', - 'server', - 'viewer', - 'help']) - update_server = False - update_viewer = False - new_version = None - new_revision = None - new_viewer_channel = None - new_server_channel = None - skip_on_branch_re = None - for o,a in opts: - if o in ('--version'): - new_version = a - if o in ('--revision'): - new_revision = a - if o in ('--skip-on-branch'): - skip_on_branch_re = re.compile(a) - if o in ('--channel'): - new_viewer_channel = a - if o in ('--server_channel'): - new_server_channel = a - if o in ('--verbose'): - verbose = True - if o in ('--server'): - update_server = True - if o in ('--viewer'): - update_viewer = True - if o in ('--help'): - usage() - return 0 - - if not(update_server or update_viewer): - update_server = True - update_viewer = True - - # Get current channel/version from llversion*.h - try: - viewer_channel = llversion.get_viewer_channel() - viewer_version = llversion.get_viewer_version() - except IOError: - print "Viewer version file not present, skipping..." - viewer_channel = None - viewer_version = None - update_viewer = False - - try: - server_channel = llversion.get_server_channel() - server_version = llversion.get_server_version() - except IOError: - print "Server version file not present, skipping..." - server_channel = None - server_version = None - update_server = False - - if verbose: - print "Source Path:", src_root - if viewer_channel != None: - print "Current viewer channel/version: '%(viewer_channel)s' / '%(viewer_version)s'" % locals() - if server_channel != None: - print "Current server channel/version: '%(server_channel)s' / '%(server_version)s'" % locals() - print - - # Determine new channel(s) - if new_viewer_channel != None and len(new_viewer_channel) > 0: - viewer_channel = new_viewer_channel - if new_server_channel != None and len(new_server_channel) > 0: - server_channel = new_server_channel - - # Determine new version(s) - if new_version: - m = version_re.match(new_version) - if not m: - print "Invalid version string specified!" - return -1 - if update_viewer: - viewer_version = new_version - if update_server: - server_version = new_version - else: - - if llversion.using_hg(): - if new_revision: - revision = new_revision - else: - revision = llversion.get_hg_changeset() - branch = llversion.get_hg_repo() - elif new_revision: - revision = new_revision - branch = "unknown" - else: - print >>sys.stderr, "ERROR: could not determine revision and branch" - return -1 - - if skip_on_branch_re and skip_on_branch_re.match(branch): - print "Release Candidate Build, leaving version files untouched." - return 0 - if update_viewer: - m = version_re.match(viewer_version) - viewer_version = m.group(1)+"."+m.group(2)+"."+m.group(3)+"."+revision - if update_server: - m = version_re.match(server_version) - server_version = m.group(1)+"."+m.group(2)+"."+m.group(3)+"."+revision - - if verbose: - if update_viewer: - print "Setting viewer channel/version: '%(viewer_channel)s' / '%(viewer_version)s'" % locals() - if update_server: - print "Setting server channel/version: '%(server_channel)s' / '%(server_version)s'" % locals() - print - - # split out version parts - if viewer_version != None: - m = version_re.match(viewer_version) - VER_MAJOR = m.group(1) - VER_MINOR = m.group(2) - VER_PATCH = m.group(3) - VER_BUILD = m.group(4) - - if server_version != None: - m = version_re.match(server_version) - SERVER_VER_MAJOR = m.group(1) - SERVER_VER_MINOR = m.group(2) - SERVER_VER_PATCH = m.group(3) - SERVER_VER_BUILD = m.group(4) - - # For readability and symmetry with version strings: - VIEWER_CHANNEL = viewer_channel - SERVER_CHANNEL = server_channel - - # Iterate through all of the files in the map, and apply the - # substitution filters - for filename in re_map.keys(): - try: - # Read the entire file into a string - full_fn = src_root + '/' + filename - file = open(full_fn,"r") - file_str = file.read() - file.close() - - if verbose: - print "Processing file:",filename - for rule in re_map[filename]: - repl = rule[1] % locals() - file_str = re.sub(rule[0], repl, file_str) - - file = open(full_fn,"w") - file.write(file_str) - file.close() - except IOError: - print "File %(filename)s not present, skipping..." % locals() - return 0 - -if __name__ == '__main__': - sys.exit(main()) - |