[kyua-cli] Use lutok-0.3 to support Lua 5.2 in rawhide.

Julio Merino jmmv at fedoraproject.org
Sat Jun 15 00:46:03 UTC 2013


commit adf4019f97fc0ad5e1313ecce0e888b405ca373e
Author: Julio Merino <julio at meroh.net>
Date:   Fri Jun 14 20:44:52 2013 -0400

    Use lutok-0.3 to support Lua 5.2 in rawhide.

 kyua-cli-0.5-support-lutok-0.3.patch |   95 ++++++++++++++++++++++++++++++++++
 kyua-cli.spec                        |   11 +++-
 2 files changed, 103 insertions(+), 3 deletions(-)
---
diff --git a/kyua-cli-0.5-support-lutok-0.3.patch b/kyua-cli-0.5-support-lutok-0.3.patch
new file mode 100644
index 0000000..42c19dd
--- /dev/null
+++ b/kyua-cli-0.5-support-lutok-0.3.patch
@@ -0,0 +1,95 @@
+Support Lutok 0.3 (and therefore Lua 5.2).
+
+This comes from upstream change df971a616a4cf930f00c836f837449d5a42589ec.
+
+--- INSTALL.orig	2012-07-08 11:19:34.000000000 -0400
++++ INSTALL	2013-06-14 20:33:53.305547602 -0400
+@@ -31,7 +31,7 @@ Dependencies
+ To build and use Kyua successfully you need:
+ 
+ * A standards-compliant C++ complier.
+-* Lutok 0.2.
++* Lutok 0.3.
+ * pkg-config.
+ * SQLite 3.6.22.
+ 
+--- NEWS.orig	2012-07-10 14:29:16.000000000 -0400
++++ NEWS	2013-06-14 20:33:53.306547602 -0400
+@@ -21,6 +21,8 @@ Experimental version released on June 10
+ * Fixed the build when using a "build directory" and a clean source tree
+   from the repository.
+ 
++* Switched to use Lutok 0.3 to gain compatibility with Lua 5.2.
++
+ 
+ Changes in version 0.4
+ ======================
+--- configure.ac.orig	2012-07-08 11:19:34.000000000 -0400
++++ configure.ac	2013-06-14 20:33:53.306547602 -0400
+@@ -86,7 +86,7 @@ m4_ifndef([ATF_ARG_WITH],
+     [m4_fatal([Cannot find atf-common.m4; see the INSTALL document for help])])
+ ATF_ARG_WITH
+ 
+-PKG_CHECK_MODULES([LUTOK], [lutok >= 0.2],
++PKG_CHECK_MODULES([LUTOK], [lutok >= 0.3],
+                   [],
+                   AC_MSG_ERROR([lutok (0.2 or newer) is required]))
+ PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= 3.6.22],
+--- 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);
+ }
diff --git a/kyua-cli.spec b/kyua-cli.spec
index 76a80a5..8137b14 100644
--- a/kyua-cli.spec
+++ b/kyua-cli.spec
@@ -1,19 +1,20 @@
 Summary: Kyua - Command line interface
 Name: kyua-cli
 Version: 0.5
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: BSD
 Group: Development/Tools
 URL: http://code.google.com/p/kyua/
 Source0: http://kyua.googlecode.com/files/%{name}-%{version}.tar.gz
 Source1: README.Fedora
-Requires: lutok >= 0.2
+Patch0: kyua-cli-0.5-support-lutok-0.3.patch
+Requires: lutok >= 0.3
 Requires: sqlite >= 3.6.22
 Requires(post): info
 Requires(preun): info
 BuildRequires: libatf-c++-devel >= 0.15
 BuildRequires: libatf-sh-devel >= 0.15
-BuildRequires: lutok-devel >= 0.2-1
+BuildRequires: lutok-devel >= 0.3-1
 BuildRequires: sqlite-devel >= 3.6.22
 
 %define _testsdir %{_libexecdir}/kyua-cli/tests
@@ -32,6 +33,7 @@ their results.
 
 %prep
 %setup -q
+%patch0 -p0
 
 # Put the README.Fedora file in the top-level directory of the source tree so
 # that the %doc call below can pick it up.
@@ -84,6 +86,9 @@ details on how to run the installed tests.
 %{_testsdir}
 
 %changelog
+* Fri Jun 14 2013 Julio Merino <jmmv at google.com> 0.5-4
+- Use Lutok 0.3 to support Lua 5.2.
+
 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.5-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 


More information about the scm-commits mailing list