]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Global: Remove support for Lua 5.2
authorJosef 'Jeff' Sipek <jeff.sipek@open-xchange.com>
Thu, 11 Mar 2021 18:13:03 +0000 (13:13 -0500)
committerjeff.sipek <jeff.sipek@open-xchange.com>
Mon, 15 Mar 2021 15:44:36 +0000 (15:44 +0000)
It took far too much effort to keep compatible with it.  Since every distro
out there provides either Lua 5.1 or 5.3, it makes sense to give up on 5.2.

m4/want_lua.m4
src/lib-lua/test-lua.c

index 4415500d00c4362faa63035aa2072b11a886ab4d..9179d4ae7d811b89f54b4fca0052888dce9301fa 100644 (file)
@@ -16,8 +16,8 @@ AC_DEFUN([DOVECOT_WANT_LUA],[
     AS_IF([test -n "$LUA_CFLAGS" -o -n "$LUA_LIBS"], [
       with_lua=yes
     ], [
-      for LUAPC in lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51 lua; do
-         PKG_CHECK_MODULES([LUA], $LUAPC >= 5.1 , [
+      for LUAPC in lua5.3 lua-5.3 lua53 lua5.1 lua-5.1 lua51 lua; do
+         PKG_CHECK_MODULES([LUA], [$LUAPC >= 5.1 $LUAPC != 5.2] , [
            with_lua=yes
          ], [LUAPC=""]) # otherwise pkg_check will fail
          if test "x$LUA_LIBS" != "x"; then break; fi
index 76b7855148e8630fee6c4da22f36eab737e8e3a5..375a53c982c6bf41b0c33005eb1e3869c5a7bdb1 100644 (file)
@@ -214,11 +214,7 @@ static void test_lua(void)
        check_table_get_luainteger_ok(script, -1, -5, "small-negative-int", 0);
        check_table_get_luainteger_ok(script, -1, 1ll<<48, "large-positive-int", 1);
        check_table_get_luainteger_ok(script, -1, -(1ll<<48), "large-negative-int", 2);
-#if LUA_VERSION_NUM != 502
        check_table_get_luainteger_err(script, -1, -1, "small-float", 3);
-#else
-       check_table_get_uintmax_ok(script, -1, 1, "small-float", 3);
-#endif
        check_table_get_luainteger_err(script, -1, -1, "bool-true", 4);
        check_table_get_luainteger_err(script, -1, -1, "bool-false", 5);
        check_table_get_luainteger_err(script, -1, -1, "str", 6);
@@ -229,11 +225,7 @@ static void test_lua(void)
        check_table_get_int_ok(script, -1, -5, "small-negative-int", 0);
        check_table_get_int_err(script, -1, -1, "large-positive-int", 1);
        check_table_get_int_err(script, -1, -1, "large-negative-int", 2);
-#if LUA_VERSION_NUM != 502
        check_table_get_int_err(script, -1, -1, "small-float", 3);
-#else
-       check_table_get_uintmax_ok(script, -1, 1, "small-float", 3);
-#endif
        check_table_get_int_err(script, -1, -1, "bool-true", 4);
        check_table_get_int_err(script, -1, -1, "bool-false", 5);
        check_table_get_int_err(script, -1, -1, "str", 6);
@@ -244,11 +236,7 @@ static void test_lua(void)
        check_table_get_intmax_ok(script, -1, -5, "small-negative-int", 0);
        check_table_get_intmax_ok(script, -1, 1ll<<48, "large-positive-int", 1);
        check_table_get_intmax_ok(script, -1, -(1ll<<48), "large-negative-int", 2);
-#if LUA_VERSION_NUM != 502
        check_table_get_intmax_err(script, -1, -1, "small-float", 3);
-#else
-       check_table_get_uintmax_ok(script, -1, 1, "small-float", 3);
-#endif
        check_table_get_intmax_err(script, -1, -1, "bool-true", 4);
        check_table_get_intmax_err(script, -1, -1, "bool-false", 5);
        check_table_get_intmax_err(script, -1, -1, "str", 6);
@@ -259,11 +247,7 @@ static void test_lua(void)
        check_table_get_uint_err(script, -1, -1, "small-negative-int", 0);
        check_table_get_uint_err(script, -1, -1, "large-positive-int", 1);
        check_table_get_uint_err(script, -1, -1, "large-negative-int", 2);
-#if LUA_VERSION_NUM != 502
        check_table_get_uint_err(script, -1, -1, "small-float", 3);
-#else
-       check_table_get_uintmax_ok(script, -1, 1, "small-float", 3);
-#endif
        check_table_get_uint_err(script, -1, -1, "bool-true", 4);
        check_table_get_uint_err(script, -1, -1, "bool-false", 5);
        check_table_get_uint_err(script, -1, -1, "str", 6);
@@ -274,11 +258,7 @@ static void test_lua(void)
        check_table_get_uintmax_err(script, -1, -1, "small-negative-int", 0);
        check_table_get_uintmax_ok(script, -1, 1ll<<48, "large-positive-int", 1);
        check_table_get_uintmax_err(script, -1, -1, "large-negative-int", 2);
-#if LUA_VERSION_NUM != 502
        check_table_get_uintmax_err(script, -1, -1, "small-float", 3);
-#else
-       check_table_get_uintmax_ok(script, -1, 1, "small-float", 3);
-#endif
        check_table_get_uintmax_err(script, -1, -1, "bool-true", 4);
        check_table_get_uintmax_err(script, -1, -1, "bool-false", 5);
        check_table_get_uintmax_err(script, -1, -1, "str", 6);
@@ -361,20 +341,8 @@ static void test_compat_tointegerx_and_isinteger(void)
                { "0xabcdef", 0xabcdef, 1 },
                { "0xabcdefg", 0, 0 },
                { "abc", 0, 0 },
-
-               /*
-                * The following tests fail with Lua 5.2, but work on 5.1 &
-                * 5.3.  (See lua_tointegerx() comment in dlua-compat.h.)
-                *
-                * We just hack around it and provide a different set of
-                * expected test results for 5.2.
-                */
-#if LUA_VERSION_NUM != 502
                { "1.525", 0, 0 },
                { "52.51", 0, 0 },
-#else
-               { "52.51", 52, 1 },
-#endif
        };
        static const struct {
                lua_Number input;
@@ -386,24 +354,11 @@ static void test_compat_tointegerx_and_isinteger(void)
                { 1, 1, 1 },
                { INT_MIN, INT_MIN, 1 },
                { INT_MAX, INT_MAX, 1 },
-
-               /*
-                * The following tests fail with Lua 5.2, but work on 5.1 &
-                * 5.3.  (See lua_tointegerx() comment in dlua-compat.h.)
-                *
-                * We just hack around it and provide a different set of
-                * expected test results for 5.2.
-                */
-#if LUA_VERSION_NUM != 502
                { 1.525, 0, 0 },
                { 52.51, 0, 0 },
                { NAN, 0, 0 },
                { +INFINITY, 0, 0},
                { -INFINITY, 0, 0},
-#else
-               { 1.525, 1, 1 },
-               { 52.51, 52, 1 },
-#endif
        };
        static const struct {
                lua_Integer input;