openwrt/package/utils/lua/patches
David Thornley da0226fa7e lua: Fixed broken __lt/__le operators caused by lnum patch.
This was found while investigating why luarocks does not work. It was
traced to a quite old lnum patch for 5.1.3. I compared against the
latest 5.1.4 patch - https://github.com/LuaDist/lualnum and discovered
the lessthan/lessequal evaluation was not falling through to the
call_orderTM (tag methods).

I have tested LuCI (simple tests) and used the following lua code to
validate the patch (both host and target patches supplied): -

> local my_mt = {
> __eq = function(v1, v2)
> print("__eq")
> return false
> end,
> __lt = function(v1, v2)
> print("__lt")
> return false
> end,
> __le = function(v1, v2)
> print("__le")
> return false
> end
> }
>
> function get_my(vstring)
> local my = {}
> my.string = vstring;
> setmetatable(my, my_mt);
> return my;
> end
>
> local a = get_my("1.0")
> local b = get_my("1.0")
>
> local eq_works = a == b;
> local lt_works = a < b;
> local gt_works = a > b;
>
> local lte_works = a <= b;
> local gte_works = a >= b;

Without the patch the following error will be presented: -

“attempt to compare two table values”

Signed-off-by: David Thornley <david.thornley@touchstargroup.com>
2016-05-13 17:03:53 +02:00
..
010-lua-5.1.3-lnum-full-260308.patch packages: clean up the package folder 2013-06-21 16:54:37 +00:00
011-lnum-use-double.patch packages: clean up the package folder 2013-06-21 16:54:37 +00:00
012-lnum-fix-ltle-relational-operators.patch lua: Fixed broken __lt/__le operators caused by lnum patch. 2016-05-13 17:03:53 +02:00
015-lnum-ppc-compat.patch packages: clean up the package folder 2013-06-21 16:54:37 +00:00
020-shared_liblua.patch packages: clean up the package folder 2013-06-21 16:54:37 +00:00
030-archindependent-bytecode.patch packages: clean up the package folder 2013-06-21 16:54:37 +00:00
040-use-symbolic-functions.patch lua: link library with -Bsymbolic-functions 2015-04-19 18:33:13 +00:00
050-honor-cflags.patch lua: honor LDFLAGS 2015-06-18 10:55:57 +00:00
100-no_readline.patch packages: clean up the package folder 2013-06-21 16:54:37 +00:00
200-lua-path.patch packages: clean up the package folder 2013-06-21 16:54:37 +00:00
300-opcode_performance.patch packages: clean up the package folder 2013-06-21 16:54:37 +00:00