head 1.2; access; symbols pkgsrc-2013Q3:1.1.0.4 pkgsrc-2013Q3-base:1.1 pkgsrc-2013Q2:1.1.0.2 pkgsrc-2013Q2-base:1.1; locks; strict; comment @// @; 1.2 date 2013.10.18.21.02.02; author jmmv; state dead; branches; next 1.1; commitid WbDmlKlFNpAlOO9x; 1.1 date 2013.06.15.00.31.34; author jmmv; state Exp; branches; next ; commitid 4WYkOnkhwXlj1ETw; desc @@ 1.2 log @Update to 0.7: Experimental version released on October 18th, 2013. * Made failures from testers more resilent. If a tester fails, the corresponding test case will be marked as broken instead of causing kyua to exit. * Added the '--results-filter' option to the 'report-html' command and set its default value to skip passed results from HTML reports. This is to keep these reports more succint and to avoid generating tons of detail files that will be, in general, useless. * Switched to use Lutok 0.3 to gain compatibility with Lua 5.2. * Issue 69: Cope with the lack of AM_PROG_AR in configure.ac, which first appeared in Automake 1.11.2. Fixes a problem in Ubuntu 10.04 LTS, which appears stuck in 1.11.1. @ text @$NetBSD: patch-utils_config_lua_module.cpp,v 1.1 2013/06/15 00:31:34 jmmv Exp $ Support Lutok 0.3 (and therefore Lua 5.2). This comes from upstream change df971a616a4cf930f00c836f837449d5a42589ec. --- utils/config/lua_module.cpp +++ utils/config/lua_module.cpp @@@@ -42,7 +42,7 @@@@ namespace { /// Gets the tree singleton stored in the Lua state. /// -/// \param state The Lua state. The metadata of _G must contain a key named +/// \param state The Lua state. The registry must contain a key named /// "tree" with a pointer to the singleton. /// /// \return A reference to the tree associated with the Lua state. @@@@ -53,10 +53,15 @@@@ get_global_tree(lutok::state& state) { lutok::stack_cleaner cleaner(state); - if (!state.get_metafield(lutok::globals_index, "tree")) + state.push_value(lutok::registry_index); + state.push_string("tree"); + state.get_table(-2); + if (state.is_nil()) throw config::syntax_error("Cannot find tree singleton; global state " "corrupted?"); - return **state.to_userdata< config::tree* >(); + config::tree& tree = **state.to_userdata< config::tree* >(); + state.pop(1); + return tree; } @@@@ -254,7 +259,7 @@@@ config::redirect(lutok::state& state, tree& out_tree) { lutok::stack_cleaner cleaner(state); - state.new_table(); + state.get_global_table(); { state.push_string("__index"); state.push_cxx_function(redirect_index); @@@@ -263,11 +268,13 @@@@ config::redirect(lutok::state& state, tree& out_tree) state.push_string("__newindex"); state.push_cxx_function(redirect_newindex); state.set_table(-3); - - state.push_string("tree"); - config::tree** tree = state.new_userdata< config::tree* >(); - *tree = &out_tree; - state.set_table(-3); } - state.set_metatable(lutok::globals_index); + state.set_metatable(-1); + + state.push_value(lutok::registry_index); + state.push_string("tree"); + config::tree** tree = state.new_userdata< config::tree* >(); + *tree = &out_tree; + state.set_table(-3); + state.pop(1); } @ 1.1 log @Switch to use Lutok 0.3. Bump PKGREVISION to 2. @ text @d1 1 a1 1 $NetBSD$ @