Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b6a677ee55 |
17
.gitignore
vendored
17
.gitignore
vendored
@ -1,15 +1,2 @@
|
||||
lua-5.1.4.tar.gz
|
||||
lua-5.1.4/
|
||||
.build*
|
||||
*.src.rpm
|
||||
/x86_64/
|
||||
/i386/
|
||||
/lua-5.2.2.tar.gz
|
||||
/lua-5.2.3.tar.gz
|
||||
/lua-5.3.0.tar.gz
|
||||
/lua-5.3.2-tests.tar.gz
|
||||
/lua-5.3.2.tar.gz
|
||||
/lua-5.3.3.tar.gz
|
||||
/lua-5.3.3-tests.tar.gz
|
||||
/lua-5.3.4.tar.gz
|
||||
/lua-5.3.4-tests.tar.gz
|
||||
lua-5.4.6-tests.tar.gz
|
||||
lua-5.4.6.tar.gz
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-8
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
||||
@ -1,11 +0,0 @@
|
||||
--- lua-5.3.4/src/lapi.c.orig 2019-06-03 17:29:46.376205064 +0200
|
||||
+++ lua-5.3.4/src/lapi.c 2019-06-03 17:31:08.869905663 +0200
|
||||
@@ -1289,6 +1289,8 @@
|
||||
LClosure *f1;
|
||||
UpVal **up1 = getupvalref(L, fidx1, n1, &f1);
|
||||
UpVal **up2 = getupvalref(L, fidx2, n2, NULL);
|
||||
+ if (*up1 == *up2)
|
||||
+ return;
|
||||
luaC_upvdeccount(L, *up1);
|
||||
*up1 = *up2;
|
||||
(*up1)->refcount++;
|
||||
@ -1,34 +0,0 @@
|
||||
diff -up lua-5.2.2/configure.ac.compat-module lua-5.2.2/configure.ac
|
||||
--- lua-5.2.2/configure.ac.compat-module 2013-05-10 10:16:05.344137597 -0400
|
||||
+++ lua-5.2.2/configure.ac 2013-05-10 10:16:05.357137596 -0400
|
||||
@@ -11,6 +11,19 @@ AC_PROG_CC
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
AC_ARG_WITH(
|
||||
+ [compat-module],
|
||||
+ [AC_HELP_STRING([--with-compat-module], [Enable LUA_COMPAT_MODULE functions [default=no]])],
|
||||
+ [use_compat_module=$withval],
|
||||
+ [use_compat_module=no]
|
||||
+)
|
||||
+
|
||||
+COMPAT_DEFS="#undef LUA_COMPAT_ALL"
|
||||
+if test "x$use_compat_module" == "xyes"; then
|
||||
+ COMPAT_DEFS="#define LUA_COMPAT_ALL"
|
||||
+fi
|
||||
+AC_SUBST(COMPAT_DEFS)
|
||||
+
|
||||
+AC_ARG_WITH(
|
||||
[readline],
|
||||
[AC_HELP_STRING([--with-readline], [Use readline for interpreter input [default=yes]])],
|
||||
[use_readline=$withval],
|
||||
diff -up lua-5.2.2/src/luaconf.h.template.in.compat-module lua-5.2.2/src/luaconf.h.template.in
|
||||
--- lua-5.2.2/src/luaconf.h.template.in.compat-module 2013-05-10 10:25:42.586116963 -0400
|
||||
+++ lua-5.2.2/src/luaconf.h.template.in 2013-05-10 10:26:29.957115269 -0400
|
||||
@@ -15,6 +15,7 @@
|
||||
@LUA_DL_DEFS@
|
||||
@LUA_BUILD_AS_DLL_DEFS@
|
||||
@READLINE_DEFS@
|
||||
+@COMPAT_DEFS@
|
||||
|
||||
|
||||
/*
|
||||
@ -1,13 +0,0 @@
|
||||
diff --git a/src/luaconf.h.template.in b/src/luaconf.h.template.in
|
||||
index a427c53..6f1d567 100644
|
||||
--- a/src/luaconf.h.template.in
|
||||
+++ b/src/luaconf.h.template.in
|
||||
@@ -206,7 +206,7 @@
|
||||
@* of a function in debug information.
|
||||
** CHANGE it if you want a different size.
|
||||
*/
|
||||
-#define LUA_IDSIZE 60
|
||||
+#define LUA_IDSIZE 512
|
||||
|
||||
|
||||
/*
|
||||
@ -1,54 +0,0 @@
|
||||
diff -up lua-5.2.2/src/lopcodes.c.luac-shared lua-5.2.2/src/lopcodes.c
|
||||
--- lua-5.2.2/src/lopcodes.c.luac-shared 2012-05-14 09:34:18.000000000 -0400
|
||||
+++ lua-5.2.2/src/lopcodes.c 2013-05-09 14:36:30.874581104 -0400
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
/* ORDER OP */
|
||||
|
||||
-LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = {
|
||||
+LUA_API const char *const luaP_opnames[NUM_OPCODES+1] = {
|
||||
"MOVE",
|
||||
"LOADK",
|
||||
"LOADKX",
|
||||
@@ -61,7 +61,7 @@ LUAI_DDEF const char *const luaP_opnames
|
||||
|
||||
#define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m))
|
||||
|
||||
-LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = {
|
||||
+LUA_API const lu_byte luaP_opmodes[NUM_OPCODES] = {
|
||||
/* T A B C mode opcode */
|
||||
opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */
|
||||
,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */
|
||||
diff -up lua-5.2.2/src/lopcodes.h.luac-shared lua-5.2.2/src/lopcodes.h
|
||||
--- lua-5.2.2/src/lopcodes.h.luac-shared 2013-05-09 14:37:14.718581762 -0400
|
||||
+++ lua-5.2.2/src/lopcodes.h 2013-05-09 14:37:40.998582156 -0400
|
||||
@@ -269,7 +269,7 @@ enum OpArgMask {
|
||||
OpArgK /* argument is a constant or register/constant */
|
||||
};
|
||||
|
||||
-LUAI_DDEC const lu_byte luaP_opmodes[NUM_OPCODES];
|
||||
+LUA_API const lu_byte luaP_opmodes[NUM_OPCODES];
|
||||
|
||||
#define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3))
|
||||
#define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3))
|
||||
@@ -278,7 +278,7 @@ LUAI_DDEC const lu_byte luaP_opmodes[NUM
|
||||
#define testTMode(m) (luaP_opmodes[m] & (1 << 7))
|
||||
|
||||
|
||||
-LUAI_DDEC const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */
|
||||
+LUA_API const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */
|
||||
|
||||
|
||||
/* number of list items to accumulate before a SETLIST instruction */
|
||||
diff -up lua-5.2.2/src/lundump.h.luac-shared lua-5.2.2/src/lundump.h
|
||||
--- lua-5.2.2/src/lundump.h.luac-shared 2012-05-08 09:53:33.000000000 -0400
|
||||
+++ lua-5.2.2/src/lundump.h 2013-05-09 14:36:30.874581104 -0400
|
||||
@@ -17,7 +17,7 @@ LUAI_FUNC Closure* luaU_undump (lua_Stat
|
||||
LUAI_FUNC void luaU_header (lu_byte* h);
|
||||
|
||||
/* dump one chunk; from ldump.c */
|
||||
-LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip);
|
||||
+LUA_API int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip);
|
||||
|
||||
/* data to catch conversion errors */
|
||||
#define LUAC_TAIL "\x19\x93\r\n\x1a\n"
|
||||
@ -1,204 +0,0 @@
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
new file mode 100644
|
||||
index 0000000..8d968c4
|
||||
--- /dev/null
|
||||
+++ b/Makefile.am
|
||||
@@ -0,0 +1,3 @@
|
||||
+SUBDIRS = src doc
|
||||
+
|
||||
+EXTRA_DIST = README
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
new file mode 100644
|
||||
index 0000000..3af6625
|
||||
--- /dev/null
|
||||
+++ b/configure.ac
|
||||
@@ -0,0 +1,69 @@
|
||||
+AC_PREREQ(2.59)
|
||||
+AC_INIT([lua], [5.2.3], [https://bugzilla.redhat.com/], [lua-at], [http://www.lua.org])
|
||||
+AC_SUBST([MAJOR_VERSION], [5.2])
|
||||
+
|
||||
+AC_CONFIG_HEADERS([config.h])
|
||||
+AC_CONFIG_SRCDIR([src/lapi.c])
|
||||
+
|
||||
+AM_INIT_AUTOMAKE([1.9 foreign])
|
||||
+
|
||||
+AC_PROG_CC
|
||||
+AC_PROG_LIBTOOL
|
||||
+
|
||||
+AC_ARG_WITH(
|
||||
+ [readline],
|
||||
+ [AC_HELP_STRING([--with-readline], [Use readline for interpreter input [default=yes]])],
|
||||
+ [use_readline=$withval],
|
||||
+ [use_readline=yes]
|
||||
+)
|
||||
+
|
||||
+LUA_LIBS="-lm"
|
||||
+
|
||||
+# Check for readline
|
||||
+READLINE_DEFS="#undef LUA_USE_READLINE"
|
||||
+if test "x$use_readline" == "xyes"; then
|
||||
+ AC_CHECK_LIB([readline], [readline], [:], [use_readline=no], [-lncurses])
|
||||
+ AC_CHECK_HEADERS([readline/readline.h readline/history.h], [], [use_readline=no])
|
||||
+ if test "x$use_readline" == "xno"; then
|
||||
+ AC_MSG_WARN([readline headers could not be found, disabling readline support])
|
||||
+ else
|
||||
+ READLINE_DEFS="#define LUA_USE_READLINE"
|
||||
+ READLINE_LIBS="-lreadline -lncurses"
|
||||
+ fi
|
||||
+fi
|
||||
+AC_SUBST(READLINE_DEFS)
|
||||
+AC_SUBST(READLINE_LIBS)
|
||||
+
|
||||
+case "$host" in
|
||||
+ *-mingw*) use_os=win32 ;;
|
||||
+ *-darwin*) use_os=macosx ;;
|
||||
+ *) use_os=posix ;;
|
||||
+esac
|
||||
+
|
||||
+POSIX_DEFS="#undef LUA_USE_POSIX"
|
||||
+LUA_DL_DEFS="#undef LUA_USE_DLOPEN"
|
||||
+LUA_BUILD_AS_DLL_DEFS="#undef LUA_BUILD_AS_DLL"
|
||||
+
|
||||
+if test "x$use_os" == "xwin32"; then
|
||||
+ LUA_BUILD_AS_DLL_DEFS="#define LUA_BUILD_AS_DLL"
|
||||
+elif test "x$use_os" == "xmacosx"; then
|
||||
+ POSIX_DEFS="#define LUA_USE_POSIX"
|
||||
+ LUA_DL_DEFS="#define LUA_DL_DYLD"
|
||||
+elif test "x$use_os" == "xposix"; then
|
||||
+ POSIX_DEFS="#define LUA_USE_POSIX"
|
||||
+ LUA_DL_DEFS="#define LUA_DL_DLOPEN"
|
||||
+ LUA_LIBS="$LUA_LIBS -ldl"
|
||||
+fi
|
||||
+AC_SUBST(POSIX_DEFS)
|
||||
+AC_SUBST(LUA_DL_DEFS)
|
||||
+AC_SUBST(LUA_BUILD_AS_DLL_DEFS)
|
||||
+
|
||||
+AC_SUBST(LUA_LIBS)
|
||||
+
|
||||
+AC_CONFIG_FILES([Makefile
|
||||
+ src/Makefile
|
||||
+ src/lua.pc
|
||||
+ src/luaconf.h.template
|
||||
+ doc/Makefile
|
||||
+])
|
||||
+AC_OUTPUT
|
||||
diff --git a/doc/Makefile.am b/doc/Makefile.am
|
||||
new file mode 100644
|
||||
index 0000000..3705696
|
||||
--- /dev/null
|
||||
+++ b/doc/Makefile.am
|
||||
@@ -0,0 +1,4 @@
|
||||
+man1_MANS = lua.1 luac.1
|
||||
+
|
||||
+EXTRA_DIST = \
|
||||
+ contents.html logo.gif lua.1 luac.1 lua.css manual.css manual.html osi-certified-72x60.png readme.html
|
||||
diff --git a/src/.gitignore b/src/.gitignore
|
||||
new file mode 100644
|
||||
index 0000000..0abd9dd
|
||||
--- /dev/null
|
||||
+++ b/src/.gitignore
|
||||
@@ -0,0 +1,5 @@
|
||||
+lua
|
||||
+lua.pc
|
||||
+luac
|
||||
+luaconf.h
|
||||
+luaconf.h.template
|
||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||
new file mode 100644
|
||||
index 0000000..6c7c79f
|
||||
--- /dev/null
|
||||
+++ b/src/Makefile.am
|
||||
@@ -0,0 +1,46 @@
|
||||
+AM_CFLAGS = -Wall
|
||||
+
|
||||
+include_HEADERS = lua.h lualib.h lauxlib.h lua.hpp
|
||||
+
|
||||
+nodist_include_HEADERS = luaconf.h
|
||||
+
|
||||
+lib_LTLIBRARIES = liblua.la
|
||||
+liblua_la_LDFLAGS = -release @MAJOR_VERSION@
|
||||
+liblua_la_SOURCES = \
|
||||
+ lapi.c lauxlib.c lbaselib.c lbitlib.c lcode.c lcorolib.c lctype.c ldblib.c \
|
||||
+ ldebug.c ldo.c ldump.c lfunc.c lgc.c linit.c liolib.c llex.c lmathlib.c lmem.c \
|
||||
+ loadlib.c lobject.c lopcodes.c loslib.c lparser.c lstate.c lstring.c lstrlib.c \
|
||||
+ ltable.c ltablib.c ltm.c lundump.c lvm.c lzio.c \
|
||||
+ lapi.h lcode.h lctype.h ldebug.h ldo.h lfunc.h lgc.h llex.h llimits.h \
|
||||
+ lmem.h lobject.h lopcodes.h lparser.h lstate.h lstring.h ltable.h ltm.h \
|
||||
+ lundump.h lvm.h lzio.h
|
||||
+
|
||||
+pkgconfigdir = $(libdir)/pkgconfig
|
||||
+pkgconfig_DATA = lua.pc
|
||||
+
|
||||
+bin_PROGRAMS = lua luac
|
||||
+
|
||||
+lua_SOURCES = lua.c
|
||||
+lua_LDADD = liblua.la @LUA_LIBS@ @READLINE_LIBS@
|
||||
+lua_DEPENDENCIES = liblua.la
|
||||
+
|
||||
+luac_SOURCES = luac.c
|
||||
+# Statically link liblua against luac since luac uses symbols not exported in liblua
|
||||
+luac_LDADD = .libs/liblua.a @LUA_LIBS@
|
||||
+luac_DEPENDENCIES = liblua.la
|
||||
+
|
||||
+EXTRA_DIST = luaconf.h.template
|
||||
+BUILT_SOURCES = luaconf.h
|
||||
+CLEANFILES = luaconf.h luaconf.h.template
|
||||
+
|
||||
+readline_defs = @READLINE_DEFS@
|
||||
+
|
||||
+edit = sed \
|
||||
+ -e 's,%prefix%,$(prefix),g' \
|
||||
+ -e 's,%lua_datadir%,$(datadir),g' \
|
||||
+ -e 's,%lua_libdir%,$(libdir),g'
|
||||
+
|
||||
+luaconf.h : luaconf.h.template
|
||||
+ rm -f $@ $@.tmp
|
||||
+ $(edit) $< >$@.tmp
|
||||
+ mv $@.tmp $@
|
||||
diff --git a/src/lua.pc.in b/src/lua.pc.in
|
||||
new file mode 100644
|
||||
index 0000000..25faa8d
|
||||
--- /dev/null
|
||||
+++ b/src/lua.pc.in
|
||||
@@ -0,0 +1,13 @@
|
||||
+V= @MAJOR_VERSION@
|
||||
+R= @VERSION@
|
||||
+prefix= @prefix@
|
||||
+exec_prefix=${prefix}
|
||||
+libdir= @libdir@
|
||||
+includedir=${prefix}/include
|
||||
+
|
||||
+Name: Lua
|
||||
+Description: An Extensible Extension Language
|
||||
+Version: ${R}
|
||||
+Requires:
|
||||
+Libs: -llua @LUA_LIBS@
|
||||
+Cflags: -I${includedir}
|
||||
diff --git a/src/luaconf.h b/src/luaconf.h.template.in
|
||||
--- a/src/luaconf.h.template.in
|
||||
+++ b/src/luaconf.h.template.in
|
||||
@@ -11,6 +11,11 @@
|
||||
#include <limits.h>
|
||||
#include <stddef.h>
|
||||
|
||||
+@POSIX_DEFS@
|
||||
+@LUA_DL_DEFS@
|
||||
+@LUA_BUILD_AS_DLL_DEFS@
|
||||
+@READLINE_DEFS@
|
||||
+
|
||||
|
||||
/*
|
||||
** ==================================================================
|
||||
@@ -100,9 +105,9 @@
|
||||
#else /* }{ */
|
||||
|
||||
#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/"
|
||||
-#define LUA_ROOT "/usr/local/"
|
||||
-#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR
|
||||
-#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR
|
||||
+#define LUA_ROOT "@prefix@/"
|
||||
+#define LUA_LDIR "@pkgdatadir@/lua/" LUA_VDIR
|
||||
+#define LUA_CDIR "@libdir@/lua/" LUA_VDIR
|
||||
#define LUA_PATH_DEFAULT \
|
||||
LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
|
||||
LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" "./?.lua"
|
||||
@ -1,12 +0,0 @@
|
||||
diff -up lua-5.3.0/src/luaconf.h.template.in.idsize lua-5.3.0/src/luaconf.h.template.in
|
||||
--- lua-5.3.0/src/luaconf.h.template.in.idsize 2015-01-15 10:23:20.515801344 -0500
|
||||
+++ lua-5.3.0/src/luaconf.h.template.in 2015-01-15 10:23:48.955651916 -0500
|
||||
@@ -693,7 +693,7 @@
|
||||
@@ of a function in debug information.
|
||||
** CHANGE it if you want a different size.
|
||||
*/
|
||||
-#define LUA_IDSIZE 60
|
||||
+#define LUA_IDSIZE 512
|
||||
|
||||
|
||||
/*
|
||||
@ -1,12 +0,0 @@
|
||||
diff -up lua-5.3.4/src/lparser.c.bug1 lua-5.3.4/src/lparser.c
|
||||
--- lua-5.3.4/src/lparser.c.bug1 2017-08-02 16:03:43.730247916 -0400
|
||||
+++ lua-5.3.4/src/lparser.c 2017-08-02 16:03:56.507957260 -0400
|
||||
@@ -1392,7 +1392,7 @@ static void test_then_block (LexState *l
|
||||
luaK_goiffalse(ls->fs, &v); /* will jump to label if condition is true */
|
||||
enterblock(fs, &bl, 0); /* must enter block before 'goto' */
|
||||
gotostat(ls, v.t); /* handle goto/break */
|
||||
- skipnoopstat(ls); /* skip other no-op statements */
|
||||
+ while (testnext(ls, ';')) {} /* skip colons */
|
||||
if (block_follow(ls, 0)) { /* 'goto' is the entire block? */
|
||||
leaveblock(fs);
|
||||
return; /* and that is it */
|
||||
@ -1,11 +0,0 @@
|
||||
diff -up lua-5.3.4/src/ldebug.c.bug4 lua-5.3.4/src/ldebug.c
|
||||
--- lua-5.3.4/src/ldebug.c.bug4 2017-08-02 16:05:36.985671687 -0400
|
||||
+++ lua-5.3.4/src/ldebug.c 2017-08-02 16:05:55.257256062 -0400
|
||||
@@ -653,6 +653,7 @@ l_noret luaG_runerror (lua_State *L, con
|
||||
CallInfo *ci = L->ci;
|
||||
const char *msg;
|
||||
va_list argp;
|
||||
+ luaC_checkGC(L); /* error message uses memory */
|
||||
va_start(argp, fmt);
|
||||
msg = luaO_pushvfstring(L, fmt, argp); /* format message */
|
||||
va_end(argp);
|
||||
@ -1,14 +0,0 @@
|
||||
diff -up lua-5.3.4/src/lgc.c.bug5 lua-5.3.4/src/lgc.c
|
||||
--- lua-5.3.4/src/lgc.c.bug5 2017-10-29 20:30:18.824283152 -0400
|
||||
+++ lua-5.3.4/src/lgc.c 2017-10-29 20:31:12.133021523 -0400
|
||||
@@ -643,8 +643,9 @@ static void clearkeys (global_State *g,
|
||||
for (n = gnode(h, 0); n < limit; n++) {
|
||||
if (!ttisnil(gval(n)) && (iscleared(g, gkey(n)))) {
|
||||
setnilvalue(gval(n)); /* remove value ... */
|
||||
- removeentry(n); /* and remove entry from table */
|
||||
}
|
||||
+ if (ttisnil(gval(n))) /* is entry empty? */
|
||||
+ removeentry(n); /* remove entry from table */
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
diff -up lua-5.3.4/src/lapi.c.bug6 lua-5.3.4/src/lapi.c
|
||||
--- lua-5.3.4/src/lapi.c.bug6 2018-02-13 10:18:59.386451581 -0500
|
||||
+++ lua-5.3.4/src/lapi.c 2018-02-13 10:19:42.700575448 -0500
|
||||
@@ -533,6 +533,7 @@ LUA_API void lua_pushcclosure (lua_State
|
||||
lua_lock(L);
|
||||
if (n == 0) {
|
||||
setfvalue(L->top, fn);
|
||||
+ api_incr_top(L);
|
||||
}
|
||||
else {
|
||||
CClosure *cl;
|
||||
@@ -546,9 +547,9 @@ LUA_API void lua_pushcclosure (lua_State
|
||||
/* does not need barrier because closure is white */
|
||||
}
|
||||
setclCvalue(L, L->top, cl);
|
||||
+ api_incr_top(L);
|
||||
+ luaC_checkGC(L);
|
||||
}
|
||||
- api_incr_top(L);
|
||||
- luaC_checkGC(L);
|
||||
lua_unlock(L);
|
||||
}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
diff -up lua-5.3.0/configure.ac.autoxxx lua-5.3.0/configure.ac
|
||||
--- lua-5.3.0/configure.ac.autoxxx 2015-01-15 10:20:03.826889574 -0500
|
||||
+++ lua-5.3.0/configure.ac 2015-01-15 10:20:03.826889574 -0500
|
||||
diff -up lua-5.4.0-beta/configure.ac.autoxxx lua-5.4.0-beta/configure.ac
|
||||
--- lua-5.4.0-beta/configure.ac.autoxxx 2019-10-23 15:03:13.296916443 -0400
|
||||
+++ lua-5.4.0-beta/configure.ac 2019-10-23 15:03:13.296916443 -0400
|
||||
@@ -0,0 +1,69 @@
|
||||
+AC_PREREQ(2.59)
|
||||
+AC_INIT([lua], [5.3.0], [https://bugzilla.redhat.com/], [lua-at], [http://www.lua.org])
|
||||
+AC_SUBST([MAJOR_VERSION], [5.3])
|
||||
+AC_INIT([lua], [5.4.0], [https://bugzilla.redhat.com/], [lua-at], [http://www.lua.org])
|
||||
+AC_SUBST([MAJOR_VERSION], [5.4])
|
||||
+
|
||||
+AC_CONFIG_HEADERS([config.h])
|
||||
+AC_CONFIG_SRCDIR([src/lapi.c])
|
||||
@ -71,33 +71,33 @@ diff -up lua-5.3.0/configure.ac.autoxxx lua-5.3.0/configure.ac
|
||||
+ doc/Makefile
|
||||
+])
|
||||
+AC_OUTPUT
|
||||
diff -up lua-5.3.0/doc/Makefile.am.autoxxx lua-5.3.0/doc/Makefile.am
|
||||
--- lua-5.3.0/doc/Makefile.am.autoxxx 2015-01-15 10:20:03.826889574 -0500
|
||||
+++ lua-5.3.0/doc/Makefile.am 2015-01-15 10:20:03.826889574 -0500
|
||||
diff -up lua-5.4.0-beta/doc/Makefile.am.autoxxx lua-5.4.0-beta/doc/Makefile.am
|
||||
--- lua-5.4.0-beta/doc/Makefile.am.autoxxx 2019-10-23 15:03:13.296916443 -0400
|
||||
+++ lua-5.4.0-beta/doc/Makefile.am 2019-10-23 15:03:13.296916443 -0400
|
||||
@@ -0,0 +1,4 @@
|
||||
+man1_MANS = lua.1 luac.1
|
||||
+
|
||||
+EXTRA_DIST = \
|
||||
+ contents.html logo.gif lua.1 luac.1 lua.css manual.css manual.html osi-certified-72x60.png readme.html
|
||||
diff -up lua-5.3.0/Makefile.am.autoxxx lua-5.3.0/Makefile.am
|
||||
--- lua-5.3.0/Makefile.am.autoxxx 2015-01-15 10:20:03.826889574 -0500
|
||||
+++ lua-5.3.0/Makefile.am 2015-01-15 10:20:03.826889574 -0500
|
||||
diff -up lua-5.4.0-beta/Makefile.am.autoxxx lua-5.4.0-beta/Makefile.am
|
||||
--- lua-5.4.0-beta/Makefile.am.autoxxx 2019-10-23 15:03:13.296916443 -0400
|
||||
+++ lua-5.4.0-beta/Makefile.am 2019-10-23 15:03:13.296916443 -0400
|
||||
@@ -0,0 +1,3 @@
|
||||
+SUBDIRS = src doc
|
||||
+
|
||||
+EXTRA_DIST = README
|
||||
diff -up lua-5.3.0/src/.gitignore.autoxxx lua-5.3.0/src/.gitignore
|
||||
--- lua-5.3.0/src/.gitignore.autoxxx 2015-01-15 10:20:03.826889574 -0500
|
||||
+++ lua-5.3.0/src/.gitignore 2015-01-15 10:20:03.826889574 -0500
|
||||
diff -up lua-5.4.0-beta/src/.gitignore.autoxxx lua-5.4.0-beta/src/.gitignore
|
||||
--- lua-5.4.0-beta/src/.gitignore.autoxxx 2019-10-23 15:03:13.297916423 -0400
|
||||
+++ lua-5.4.0-beta/src/.gitignore 2019-10-23 15:03:13.296916443 -0400
|
||||
@@ -0,0 +1,5 @@
|
||||
+lua
|
||||
+lua.pc
|
||||
+luac
|
||||
+luaconf.h
|
||||
+luaconf.h.template
|
||||
diff -up lua-5.3.0/src/luaconf.h.template.in.autoxxx lua-5.3.0/src/luaconf.h.template.in
|
||||
--- lua-5.3.0/src/luaconf.h.template.in.autoxxx 2015-01-15 10:20:03.828889562 -0500
|
||||
+++ lua-5.3.0/src/luaconf.h.template.in 2015-01-15 10:22:37.420027778 -0500
|
||||
diff -up lua-5.4.0-beta/src/luaconf.h.template.in.autoxxx lua-5.4.0-beta/src/luaconf.h.template.in
|
||||
--- lua-5.4.0-beta/src/luaconf.h.template.in.autoxxx 2019-09-30 19:52:16.000000000 -0400
|
||||
+++ lua-5.4.0-beta/src/luaconf.h.template.in 2019-10-23 15:05:45.139817627 -0400
|
||||
@@ -11,6 +11,11 @@
|
||||
#include <limits.h>
|
||||
#include <stddef.h>
|
||||
@ -110,7 +110,7 @@ diff -up lua-5.3.0/src/luaconf.h.template.in.autoxxx lua-5.3.0/src/luaconf.h.tem
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
@@ -175,9 +180,9 @@
|
||||
@@ -227,9 +232,9 @@
|
||||
|
||||
#else /* }{ */
|
||||
|
||||
@ -120,12 +120,12 @@ diff -up lua-5.3.0/src/luaconf.h.template.in.autoxxx lua-5.3.0/src/luaconf.h.tem
|
||||
+#define LUA_ROOT "@prefix@/"
|
||||
+#define LUA_LDIR "@pkgdatadir@/lua/" LUA_VDIR "/"
|
||||
+#define LUA_CDIR "@libdir@/lua/" LUA_VDIR "/"
|
||||
|
||||
#if !defined(LUA_PATH_DEFAULT)
|
||||
#define LUA_PATH_DEFAULT \
|
||||
LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
|
||||
LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \
|
||||
diff -up lua-5.3.0/src/lua.pc.in.autoxxx lua-5.3.0/src/lua.pc.in
|
||||
--- lua-5.3.0/src/lua.pc.in.autoxxx 2015-01-15 10:20:03.827889568 -0500
|
||||
+++ lua-5.3.0/src/lua.pc.in 2015-01-15 10:20:03.827889568 -0500
|
||||
diff -up lua-5.4.0-beta/src/lua.pc.in.autoxxx lua-5.4.0-beta/src/lua.pc.in
|
||||
--- lua-5.4.0-beta/src/lua.pc.in.autoxxx 2019-10-23 15:03:13.297916423 -0400
|
||||
+++ lua-5.4.0-beta/src/lua.pc.in 2019-10-23 15:03:13.297916423 -0400
|
||||
@@ -0,0 +1,13 @@
|
||||
+V= @MAJOR_VERSION@
|
||||
+R= @VERSION@
|
||||
@ -140,9 +140,9 @@ diff -up lua-5.3.0/src/lua.pc.in.autoxxx lua-5.3.0/src/lua.pc.in
|
||||
+Requires:
|
||||
+Libs: -llua @LUA_LIBS@
|
||||
+Cflags: -I${includedir}
|
||||
diff -up lua-5.3.0/src/Makefile.am.autoxxx lua-5.3.0/src/Makefile.am
|
||||
--- lua-5.3.0/src/Makefile.am.autoxxx 2015-01-15 10:20:03.826889574 -0500
|
||||
+++ lua-5.3.0/src/Makefile.am 2015-01-15 10:20:03.826889574 -0500
|
||||
diff -up lua-5.4.0-beta/src/Makefile.am.autoxxx lua-5.4.0-beta/src/Makefile.am
|
||||
--- lua-5.4.0-beta/src/Makefile.am.autoxxx 2019-10-23 15:03:13.297916423 -0400
|
||||
+++ lua-5.4.0-beta/src/Makefile.am 2019-10-23 15:03:13.297916423 -0400
|
||||
@@ -0,0 +1,46 @@
|
||||
+AM_CFLAGS = -Wall
|
||||
+
|
||||
@ -153,7 +153,7 @@ diff -up lua-5.3.0/src/Makefile.am.autoxxx lua-5.3.0/src/Makefile.am
|
||||
+lib_LTLIBRARIES = liblua.la
|
||||
+liblua_la_LDFLAGS = -release @MAJOR_VERSION@
|
||||
+liblua_la_SOURCES = \
|
||||
+ lapi.c lauxlib.c lbaselib.c lbitlib.c lcode.c lcorolib.c lctype.c ldblib.c \
|
||||
+ lapi.c lauxlib.c lbaselib.c lcode.c lcorolib.c lctype.c ldblib.c \
|
||||
+ ldebug.c ldo.c ldump.c lfunc.c lgc.c linit.c liolib.c llex.c lmathlib.c lmem.c \
|
||||
+ loadlib.c lobject.c lopcodes.c loslib.c lparser.c lstate.c lstring.c lstrlib.c \
|
||||
+ ltable.c ltablib.c ltm.c lundump.c lutf8lib.c lvm.c lzio.c \
|
||||
@ -1,30 +0,0 @@
|
||||
From a585eae6e7ada1ca9271607a4f48dfb17868ab7b Mon Sep 17 00:00:00 2001
|
||||
From: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
|
||||
Date: Mon, 27 Jul 2020 12:01:38 -0300
|
||||
Subject: [PATCH] Fixed bug: Negation overflow in getlocal/setlocal
|
||||
|
||||
Adjusted for 5.3
|
||||
|
||||
---
|
||||
diff --git a/src/ldebug.c b/src/ldebug.c
|
||||
index f1835890..a44e5439 100644
|
||||
--- a/src/ldebug.c
|
||||
+++ b/src/ldebug.c
|
||||
@@ -133,7 +133,7 @@ static const char *upvalname (Proto *p, int uv) {
|
||||
|
||||
static const char *findvararg (CallInfo *ci, int n, StkId *pos) {
|
||||
int nparams = clLvalue(ci->func)->p->numparams;
|
||||
- if (n >= cast_int(ci->u.l.base - ci->func) - nparams)
|
||||
+ if (n < cast_int(ci->u.l.base - ci->func) - nparams) /* 'n' is negative */
|
||||
return NULL; /* no such vararg */
|
||||
else {
|
||||
*pos = ci->func + nparams + n;
|
||||
@@ -148,7 +148,7 @@ static const char *findlocal (lua_State *L, CallInfo *ci, int n,
|
||||
StkId base;
|
||||
if (isLua(ci)) {
|
||||
if (n < 0) /* access to vararg values? */
|
||||
- return findvararg(ci, -n, pos);
|
||||
+ return findvararg(ci, n, pos);
|
||||
else {
|
||||
base = ci->u.l.base;
|
||||
name = luaF_getlocalname(ci_func(ci)->p, n, currentpc(ci));
|
||||
24
lua-5.4.6-big-endian-fix.patch
Normal file
24
lua-5.4.6-big-endian-fix.patch
Normal file
@ -0,0 +1,24 @@
|
||||
diff -up lua-5.4.6/lua-5.4.6-tests/calls.lua.big-endian-fix lua-5.4.6/lua-5.4.6-tests/calls.lua
|
||||
--- lua-5.4.6/lua-5.4.6-tests/calls.lua.big-endian-fix 2023-08-01 09:21:13.212388469 -0400
|
||||
+++ lua-5.4.6/lua-5.4.6-tests/calls.lua 2023-08-01 09:21:34.552557272 -0400
|
||||
@@ -342,20 +342,6 @@ do -- another bug (in 5.4.0)
|
||||
end
|
||||
|
||||
|
||||
-do -- another bug (since 5.2)
|
||||
- -- corrupted binary dump: list of upvalue names is larger than number
|
||||
- -- of upvalues, overflowing the array of upvalues.
|
||||
- local code =
|
||||
- "\x1b\x4c\x75\x61\x54\x00\x19\x93\x0d\x0a\x1a\x0a\x04\x08\x08\x78\x56\z
|
||||
- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x77\x40\x00\x86\x40\z
|
||||
- \x74\x65\x6d\x70\x81\x81\x01\x00\x02\x82\x48\x00\x02\x00\xc7\x00\x01\z
|
||||
- \x00\x80\x80\x80\x82\x00\x00\x80\x81\x82\x78\x80\x82\x81\x86\x40\x74\z
|
||||
- \x65\x6d\x70"
|
||||
-
|
||||
- assert(load(code)) -- segfaults in previous versions
|
||||
-end
|
||||
-
|
||||
-
|
||||
x = string.dump(load("x = 1; return x"))
|
||||
a = assert(load(read1(x), nil, "b"))
|
||||
assert(a() == 1 and _G.x == 1)
|
||||
66
lua-5.4.6-bug1.patch
Normal file
66
lua-5.4.6-bug1.patch
Normal file
@ -0,0 +1,66 @@
|
||||
From f623b969325be736297bc1dff48e763c08778243 Mon Sep 17 00:00:00 2001
|
||||
From: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
|
||||
Date: Wed, 14 Jun 2023 14:38:07 -0300
|
||||
Subject: [PATCH] Bug: read overflow in 'l_strcmp'
|
||||
|
||||
Equality according to 'strcoll' does not imply that strings have
|
||||
the same length.
|
||||
---
|
||||
lvm.c | 38 ++++++++++++++++++++------------------
|
||||
1 file changed, 20 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/src/lvm.c b/src/lvm.c
|
||||
index 4c300a87a..2b437bdfd 100644
|
||||
--- a/src/lvm.c
|
||||
+++ b/src/lvm.c
|
||||
@@ -366,30 +366,32 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key,
|
||||
|
||||
|
||||
/*
|
||||
-** Compare two strings 'ls' x 'rs', returning an integer less-equal-
|
||||
-** -greater than zero if 'ls' is less-equal-greater than 'rs'.
|
||||
+** Compare two strings 'ts1' x 'ts2', returning an integer less-equal-
|
||||
+** -greater than zero if 'ts1' is less-equal-greater than 'ts2'.
|
||||
** The code is a little tricky because it allows '\0' in the strings
|
||||
-** and it uses 'strcoll' (to respect locales) for each segments
|
||||
-** of the strings.
|
||||
+** and it uses 'strcoll' (to respect locales) for each segment
|
||||
+** of the strings. Note that segments can compare equal but still
|
||||
+** have different lengths.
|
||||
*/
|
||||
-static int l_strcmp (const TString *ls, const TString *rs) {
|
||||
- const char *l = getstr(ls);
|
||||
- size_t ll = tsslen(ls);
|
||||
- const char *r = getstr(rs);
|
||||
- size_t lr = tsslen(rs);
|
||||
+static int l_strcmp (const TString *ts1, const TString *ts2) {
|
||||
+ const char *s1 = getstr(ts1);
|
||||
+ size_t rl1 = tsslen(ts1); /* real length */
|
||||
+ const char *s2 = getstr(ts2);
|
||||
+ size_t rl2 = tsslen(ts2);
|
||||
for (;;) { /* for each segment */
|
||||
- int temp = strcoll(l, r);
|
||||
+ int temp = strcoll(s1, s2);
|
||||
if (temp != 0) /* not equal? */
|
||||
return temp; /* done */
|
||||
else { /* strings are equal up to a '\0' */
|
||||
- size_t len = strlen(l); /* index of first '\0' in both strings */
|
||||
- if (len == lr) /* 'rs' is finished? */
|
||||
- return (len == ll) ? 0 : 1; /* check 'ls' */
|
||||
- else if (len == ll) /* 'ls' is finished? */
|
||||
- return -1; /* 'ls' is less than 'rs' ('rs' is not finished) */
|
||||
- /* both strings longer than 'len'; go on comparing after the '\0' */
|
||||
- len++;
|
||||
- l += len; ll -= len; r += len; lr -= len;
|
||||
+ size_t zl1 = strlen(s1); /* index of first '\0' in 's1' */
|
||||
+ size_t zl2 = strlen(s2); /* index of first '\0' in 's2' */
|
||||
+ if (zl2 == rl2) /* 's2' is finished? */
|
||||
+ return (zl1 == rl1) ? 0 : 1; /* check 's1' */
|
||||
+ else if (zl1 == rl1) /* 's1' is finished? */
|
||||
+ return -1; /* 's1' is less than 's2' ('s2' is not finished) */
|
||||
+ /* both strings longer than 'zl'; go on comparing after the '\0' */
|
||||
+ zl1++; zl2++;
|
||||
+ s1 += zl1; rl1 -= zl1; s2 += zl2; rl2 -= zl2;
|
||||
}
|
||||
}
|
||||
}
|
||||
12
lua-5.4.6-idsize.patch
Normal file
12
lua-5.4.6-idsize.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -up lua-5.4.6/src/luaconf.h.template.in.idsize lua-5.4.6/src/luaconf.h.template.in
|
||||
--- lua-5.4.6/src/luaconf.h.template.in.idsize 2023-05-22 11:02:54.207370261 -0400
|
||||
+++ lua-5.4.6/src/luaconf.h.template.in 2023-05-22 11:04:21.410747055 -0400
|
||||
@@ -761,7 +761,7 @@
|
||||
** of a function in debug information.
|
||||
** CHANGE it if you want a different size.
|
||||
*/
|
||||
-#define LUA_IDSIZE 60
|
||||
+#define LUA_IDSIZE 512
|
||||
|
||||
|
||||
/*
|
||||
225
lua.spec
225
lua.spec
@ -1,53 +1,47 @@
|
||||
%global major_version 5.3
|
||||
%global major_version 5.4
|
||||
# Normally, this is the same as version, but... not always.
|
||||
%global test_version 5.4.6
|
||||
# If you are incrementing major_version, enable bootstrapping and adjust accordingly.
|
||||
# Version should be the latest prior build. If you don't do this, RPM will break and
|
||||
# everything will grind to a halt.
|
||||
%global bootstrap 0
|
||||
%global bootstrap_major_version 5.2
|
||||
%global bootstrap_version %{bootstrap_major_version}.3
|
||||
%global bootstrap_major_version 5.3
|
||||
%global bootstrap_version %{bootstrap_major_version}.6
|
||||
|
||||
# Place rpm-macros into proper location.
|
||||
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
|
||||
|
||||
|
||||
Name: lua
|
||||
Version: %{major_version}.4
|
||||
Release: 12%{?dist}
|
||||
Version: %{major_version}.6
|
||||
Release: 7%{?dist}
|
||||
Summary: Powerful light-weight programming language
|
||||
Group: Development/Languages
|
||||
License: MIT
|
||||
URL: http://www.lua.org/
|
||||
Source0: http://www.lua.org/ftp/lua-%{version}.tar.gz
|
||||
URL: https://www.lua.org/
|
||||
Source0: https://www.lua.org/ftp/lua-%{version}.tar.gz
|
||||
# copied from doc/readme.html on 2014-07-18
|
||||
Source1: mit.txt
|
||||
%if 0%{?bootstrap}
|
||||
Source2: http://www.lua.org/ftp/lua-%{bootstrap_version}.tar.gz
|
||||
Source2: https://www.lua.org/ftp/lua-%{bootstrap_version}.tar.gz
|
||||
%endif
|
||||
Source3: http://www.lua.org/tests/lua-%{version}-tests.tar.gz
|
||||
Source3: https://www.lua.org/tests/lua-%{test_version}-tests.tar.gz
|
||||
# multilib
|
||||
Source4: luaconf.h
|
||||
# rpm-macro
|
||||
Source1000: macros.lua
|
||||
Patch0: %{name}-5.3.0-autotoolize.patch
|
||||
Patch1: %{name}-5.3.0-idsize.patch
|
||||
Patch0: %{name}-5.4.0-beta-autotoolize.patch
|
||||
Patch1: %{name}-5.4.6-idsize.patch
|
||||
#Patch2: %%{name}-5.3.0-luac-shared-link-fix.patch
|
||||
Patch3: %{name}-5.2.2-configure-linux.patch
|
||||
Patch4: %{name}-5.3.0-configure-compat-module.patch
|
||||
%if 0%{?bootstrap}
|
||||
Patch5: %{name}-5.2.3-autotoolize.patch
|
||||
Patch6: %{name}-5.2.2-idsize.patch
|
||||
Patch7: %{name}-5.2.2-luac-shared-link-fix.patch
|
||||
Patch8: %{name}-5.2.2-configure-compat-module.patch
|
||||
Patch5: %{name}-5.3.0-autotoolize.patch
|
||||
Patch6: %{name}-5.3.5-luac-shared-link-fix.patch
|
||||
%endif
|
||||
Patch7: lua-5.4.6-big-endian-fix.patch
|
||||
# https://www.lua.org/bugs.html
|
||||
Patch9: lua-5.3.4-bug1.patch
|
||||
Patch10: lua-5.3.4-bug4.patch
|
||||
Patch11: lua-5.3.4-bug5.patch
|
||||
Patch12: lua-5.3.4-bug6.patch
|
||||
Patch13: lua-5-3.4-upvaluejoin.patch
|
||||
Patch14: lua-5.4.1-bug11.patch
|
||||
Patch8: lua-5.4.6-bug1.patch
|
||||
|
||||
BuildRequires: automake autoconf libtool readline-devel ncurses-devel
|
||||
BuildRequires: make
|
||||
Requires: lua-libs = %{version}-%{release}
|
||||
|
||||
%description
|
||||
@ -62,8 +56,10 @@ configuration, scripting, and rapid prototyping.
|
||||
|
||||
%package devel
|
||||
Summary: Development files for %{name}
|
||||
Group: System Environment/Libraries
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
# The RPM related dependencies bring nothing to a non-RPM Lua developer
|
||||
# But we want them when packages BuildRequire lua-devel
|
||||
Requires: (lua-rpm-macros if rpm-build)
|
||||
Requires: pkgconfig
|
||||
|
||||
%description devel
|
||||
@ -78,7 +74,6 @@ This package contains the shared libraries for %{name}.
|
||||
|
||||
%package static
|
||||
Summary: Static library for %{name}
|
||||
Group: System Environment/Libraries
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description static
|
||||
@ -87,35 +82,31 @@ This package contains the static version of liblua for %{name}.
|
||||
|
||||
%prep
|
||||
%if 0%{?bootstrap}
|
||||
%setup -q -a 2 -a 3
|
||||
%setup -q -a 2 -a 3 -n %{name}-%{version}
|
||||
%else
|
||||
%setup -q -a 3
|
||||
%endif
|
||||
cp %{SOURCE1} .
|
||||
mv src/luaconf.h src/luaconf.h.template.in
|
||||
%patch0 -p1 -E -z .autoxxx
|
||||
%patch1 -p1 -z .idsize
|
||||
#%% patch2 -p1 -z .luac-shared
|
||||
%patch3 -p1 -z .configure-linux
|
||||
%patch4 -p1 -z .configure-compat-all
|
||||
%patch9 -p1 -b .bug1
|
||||
%patch10 -p1 -b .bug4
|
||||
%patch11 -p1 -b .bug5
|
||||
%patch12 -p1 -b .bug6
|
||||
%patch13 -p1 -b .upvaluejoin
|
||||
%patch14 -p1 -b .bug11
|
||||
%patch -P0 -p1 -E -z .autoxxx
|
||||
%patch -P1 -p1 -z .idsize
|
||||
#%% patch -P2 -p1 -z .luac-shared
|
||||
%patch -P3 -p1 -z .configure-linux
|
||||
# Put proper version in configure.ac, patch0 hardcodes 5.3.0
|
||||
sed -i 's|5.3.0|%{version}|g' configure.ac
|
||||
autoreconf -ifv
|
||||
%patch -P7 -p1 -b .big-endian-fix
|
||||
%patch -P8 -p1 -b .bug1
|
||||
|
||||
|
||||
%if 0%{?bootstrap}
|
||||
cd lua-%{bootstrap_version}/
|
||||
mv src/luaconf.h src/luaconf.h.template.in
|
||||
%patch5 -p1 -b .autoxxx
|
||||
%patch6 -p1 -b .idsize
|
||||
%patch7 -p1 -b .luac-shared
|
||||
%patch3 -p1 -z .configure-linux
|
||||
%patch8 -p1 -z .configure-compat-all
|
||||
%patch -P5 -p1 -b .autoxxx
|
||||
%patch -P1 -p1 -b .idsize
|
||||
%patch -P3 -p1 -z .configure-linux
|
||||
%patch -P4 -p1 -z .configure-compat-all
|
||||
%patch -P6 -p1 -b .luac-shared-link-fix
|
||||
autoreconf -i
|
||||
cd ..
|
||||
%endif
|
||||
@ -130,7 +121,7 @@ sed -i 's|@pkgdatadir@|%{_datadir}|g' src/luaconf.h.template
|
||||
|
||||
# hack so that only /usr/bin/lua gets linked with readline as it is the
|
||||
# only one which needs this and otherwise we get License troubles
|
||||
make %{?_smp_mflags} LIBS="-lm -ldl"
|
||||
%make_build LIBS="-lm -ldl"
|
||||
# only /usr/bin/lua links with readline now #luac_LDADD="liblua.la -lm -ldl"
|
||||
|
||||
%if 0%{?bootstrap}
|
||||
@ -143,12 +134,12 @@ sed -i 's|@pkgdatadir@|%{_datadir}|g' src/luaconf.h.template
|
||||
|
||||
# hack so that only /usr/bin/lua gets linked with readline as it is the
|
||||
# only one which needs this and otherwise we get License troubles
|
||||
make %{?_smp_mflags} LIBS="-lm -ldl" luac_LDADD="liblua.la -lm -ldl"
|
||||
%make_build LIBS="-lm -ldl" luac_LDADD="liblua.la -lm -ldl"
|
||||
popd
|
||||
%endif
|
||||
|
||||
%check
|
||||
cd ./lua-%{version}-tests/
|
||||
cd ./lua-%{test_version}-tests/
|
||||
|
||||
# Dont skip the fully portable or ram-hungry tests:
|
||||
# sed -i.orig -e '
|
||||
@ -167,7 +158,7 @@ sed -i.orig -e '
|
||||
LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{_libdir} $RPM_BUILD_ROOT/%{_bindir}/lua -e"_U=true" all.lua
|
||||
|
||||
%install
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
%make_install
|
||||
rm $RPM_BUILD_ROOT%{_libdir}/*.la
|
||||
mkdir -p $RPM_BUILD_ROOT%{_libdir}/lua/%{major_version}
|
||||
mkdir -p $RPM_BUILD_ROOT%{_datadir}/lua/%{major_version}
|
||||
@ -188,9 +179,6 @@ rm -rf $RPM_BUILD_ROOT/installdir
|
||||
popd
|
||||
%endif
|
||||
|
||||
# Install rpm-macro
|
||||
install -Dpm 0644 %{SOURCE1000} $RPM_BUILD_ROOT/%{macrosdir}/macros.lua
|
||||
|
||||
%files
|
||||
%{!?_licensedir:%global license %%doc}
|
||||
%license mit.txt
|
||||
@ -198,20 +186,19 @@ install -Dpm 0644 %{SOURCE1000} $RPM_BUILD_ROOT/%{macrosdir}/macros.lua
|
||||
%doc README doc/*.html doc/*.css doc/*.gif doc/*.png
|
||||
%{_bindir}/lua
|
||||
%{_bindir}/luac
|
||||
%if 0%{?bootstrap}
|
||||
%dir %{_libdir}/lua/%{bootstrap_major_version}
|
||||
%dir %{_datadir}/lua/%{bootstrap_major_version}
|
||||
%endif
|
||||
%{_mandir}/man1/lua*.1*
|
||||
|
||||
%files libs
|
||||
%dir %{_libdir}/lua
|
||||
%dir %{_libdir}/lua/%{major_version}
|
||||
%{_libdir}/liblua-%{major_version}.so
|
||||
%dir %{_datadir}/lua
|
||||
%dir %{_datadir}/lua/%{major_version}
|
||||
|
||||
%files libs
|
||||
%{_libdir}/liblua-%{major_version}.so
|
||||
%if 0%{?bootstrap}
|
||||
%dir %{_libdir}/lua/%{bootstrap_major_version}
|
||||
%{_libdir}/liblua-%{bootstrap_major_version}.so
|
||||
%dir %{_datadir}/lua/%{bootstrap_major_version}
|
||||
%endif
|
||||
|
||||
%files devel
|
||||
@ -219,18 +206,132 @@ install -Dpm 0644 %{SOURCE1000} $RPM_BUILD_ROOT/%{macrosdir}/macros.lua
|
||||
%{_includedir}/l*.hpp
|
||||
%{_libdir}/liblua.so
|
||||
%{_libdir}/pkgconfig/*.pc
|
||||
%{macrosdir}/macros.lua
|
||||
|
||||
%files static
|
||||
%{_libdir}/*.a
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Aug 02 2019 Florian Festi <ffesti@redhat.com> - 5.3.4-12
|
||||
- Fix segfault in getlocal and setlocal (#1880445)
|
||||
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 5.4.6-7
|
||||
- Bump release for October 2024 mass rebuild:
|
||||
Resolves: RHEL-64018
|
||||
|
||||
* Mon Jun 03 2019 Florian Festi <ffesti@redhat.com> - 5.3.4-11
|
||||
- Fix use after free in lua_upvaluejoin (#1670167)
|
||||
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 5.4.6-6
|
||||
- Bump release for June 2024 mass rebuild
|
||||
|
||||
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.6-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.6-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Tue Aug 1 2023 Tom Callaway <spot@fedoraproject.org> - 5.4.6-3
|
||||
- disable "corrupted binary dump" test that has issues on big-endian architectures
|
||||
- apply upstream fix for 5.4.6 bug 1
|
||||
|
||||
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.6-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
* Mon May 22 2023 Tom Callaway <spot@fedoraproject.org> - 5.4.6-1
|
||||
- update to 5.4.6
|
||||
|
||||
* Tue Feb 14 2023 Tom Callaway <spot@fedoraproject.org> - 5.4.4-9
|
||||
- add upstream fixes for Bugs 8 and 9
|
||||
|
||||
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.4-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Thu Dec 8 2022 Charles R. Anderson <cra@alum.wpi.edu> - 5.4.4-7
|
||||
- Add patch for http://lua-users.org/lists/lua-l/2022-02/msg00112.html (#2111138)
|
||||
|
||||
* Mon Oct 17 2022 Tom Callaway <spot@fedoraproject.org> - 5.4.4-6
|
||||
- add upstream fix for Bug 7
|
||||
|
||||
* Mon Oct 17 2022 Panu Matilainen <pmatilai@redhat.com> - 5.4.4-5
|
||||
- Disable bootstrap mode forgotten on 5.4 rebase
|
||||
|
||||
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.4-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Tue Jul 19 2022 Tom Callaway <spot@fedoraproject.org> - 5.4.4-3
|
||||
- upstream bug fixes (3,4,5) including fix for CVE-2022-33099
|
||||
|
||||
* Tue Apr 5 2022 Tom Callaway <spot@fedoraproject.org> - 5.4.4-2
|
||||
- upstream bug fixes
|
||||
|
||||
* Tue Feb 1 2022 Tom Callaway <spot@fedoraproject.org> - 5.4.4-1
|
||||
- update to 5.4.4, update bootstrap code to 5.3.6
|
||||
- 5.4.4 contains the fix for 5.4.3 bug7, which is also CVE-2021-43519
|
||||
This fix was also in 5.4.3-4, so you do not need to update solely for that.
|
||||
|
||||
* Mon Jan 24 2022 Tom Callaway <spot@fedoraproject.org> - 5.4.3-4
|
||||
- apply upstream fix for CVE-2021-44647
|
||||
- apply upstream fixes for known lua bugs 4-10 (11 assumes other changes beyond 5.4.3)
|
||||
|
||||
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.3-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.3-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Wed Mar 31 2021 Tom Callaway <spot@fedoraproject.org> - 5.4.3-1
|
||||
- update to 5.4.3
|
||||
- apply fix for bug3
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.2-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Thu Dec 3 2020 Tom Callaway <spot@fedoraproject.org> - 5.4.2-1
|
||||
- update to 5.4.2
|
||||
|
||||
* Mon Oct 12 2020 Tom Callaway <spot@fedoraproject.org> - 5.4.1-1
|
||||
- update to 5.4.1
|
||||
|
||||
* Wed Sep 2 2020 Tom Callaway <spot@fedoraproject.org> - 5.4.0-8
|
||||
- apply upstream fix for CVE-2020-24342
|
||||
|
||||
* Mon Aug 31 2020 Michel Alexandre Salim <salimma@fedoraproject.org> - 5.4.0-7
|
||||
- Refactor macros into lua-rpm-macros
|
||||
|
||||
* Wed Aug 19 2020 Tom Callaway <spot@fedoraproject.org> - 5.4.0-6
|
||||
- apply upstream fix for CVE-2020-24370, CVE-2020-24371
|
||||
|
||||
* Wed Aug 19 2020 Tom Callaway <spot@fedoraproject.org> - 5.4.0-5
|
||||
- apply upstream fix for CVE-2020-24369
|
||||
|
||||
* Fri Jul 31 2020 Tom Callaway <spot@fedoraproject.org> - 5.4.0-4
|
||||
- apply upstream fix for CVE-2020-15889
|
||||
- apply upstream fix for CVE-2020-15945
|
||||
- apply upstream fixes for "known bugs"
|
||||
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.0-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Tue Jun 30 2020 Miro Hrončok <mhroncok@redhat.com> - 5.4.0-2
|
||||
- Add lua(abi) requirements generator (requires RPM 4.16+)
|
||||
|
||||
* Mon Jun 29 2020 Tom Callaway <spot@fedoraproject.org> - 5.4.0-1
|
||||
- update to 5.4.0
|
||||
|
||||
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.5-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.5-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 5.3.5-5
|
||||
- Rebuild for readline 8.0
|
||||
|
||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.5-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Mon Jan 28 2019 Tom Callaway <spot@fedoraproject.org> - 5.3.5-3
|
||||
- apply fix for CVE-2019-6706 (bz1670020)
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.5-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Tue Jul 10 2018 Tom Callaway <spot@fedoraproject.org> - 5.3.5-1
|
||||
- update to 5.3.5
|
||||
|
||||
* Tue Feb 13 2018 Tom Callaway <spot@fedoraproject.org> - 5.3.4-10
|
||||
- move lua(abi) provide to -libs
|
||||
|
||||
13
macros.lua
13
macros.lua
@ -1,13 +0,0 @@
|
||||
%lua_version %{lua: print(string.sub(_VERSION, 5))}
|
||||
|
||||
%lua_libdir %{_libdir}/lua/%{lua_version}
|
||||
%lua_pkgdir %{_datadir}/lua/%{lua_version}
|
||||
|
||||
%lua_requires \
|
||||
%if 0%{?fedora} >= 16 || 0%{?rhel} >= 7 \
|
||||
Requires: lua(abi) = %{lua_version} \
|
||||
%else \
|
||||
Requires: lua >= %{lua_version} \
|
||||
Requires: lua < %{lua: os.setlocale('C'); print(string.sub(_VERSION, 5) + 0.1)} \
|
||||
%endif \
|
||||
%{nil}
|
||||
4
sources
4
sources
@ -1,2 +1,2 @@
|
||||
SHA512 (lua-5.3.4.tar.gz) = 739e31f82e6a60fa99910c2005e991b3a1e21339af52847f653cb190b30842054d189ca116ffcfdf9b36e07888c9ce5642b1dd2988cc7eff9f8789f9a2e34997
|
||||
SHA512 (lua-5.3.4-tests.tar.gz) = 79575d100a2efabc8243f55b55d912443e09ef7e8b0219cb93541d85c2ba802fb9538015e1228703f09ca57bdb28a640a8f1fa0735716ba1e4bca2179c712dfb
|
||||
SHA512 (lua-5.4.6-tests.tar.gz) = 428b50b9546d8ad81a7c7e74582135a317d27f0c65307f899ec6de50d71c6220672c53648f999b3019503c8fa6f0c1542131621a6bab9e09a7ef2e2919183b2d
|
||||
SHA512 (lua-5.4.6.tar.gz) = d90c6903355ee1309cb0d92a8a024522ff049091a117ea21efb585b5de35776191cd67d17a65b18c2f9d374795b7c944f047576f0e3fe818d094b26f0e4845c5
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
# lua
|
||||
|
||||
lua tests
|
||||
@ -1,63 +0,0 @@
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /CoreOS/lua/Sanity/Smoke
|
||||
# Description: Basic smoke for lua component
|
||||
# Author: Stepan Sigut <ssigut@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2016 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/CoreOS/lua/Sanity/Smoke
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE *.lua
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Stepan Sigut <ssigut@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Basic smoke for lua component" >> $(METADATA)
|
||||
@echo "Type: Sanity" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: lua" >> $(METADATA)
|
||||
@echo "Requires: lua" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
@ -1,3 +0,0 @@
|
||||
PURPOSE of /CoreOS/lua/Sanity/Smoke
|
||||
Description: Basic smoke for lua component
|
||||
Author: Stepan Sigut <ssigut@redhat.com>
|
||||
@ -1,35 +0,0 @@
|
||||
-- account.lua
|
||||
-- from PiL 1, Chapter 16
|
||||
|
||||
Account = {balance = 0}
|
||||
|
||||
function Account:new (o, name)
|
||||
o = o or {name=name}
|
||||
setmetatable(o, self)
|
||||
self.__index = self
|
||||
return o
|
||||
end
|
||||
|
||||
function Account:deposit (v)
|
||||
self.balance = self.balance + v
|
||||
end
|
||||
|
||||
function Account:withdraw (v)
|
||||
if v > self.balance then error("insufficient funds on account "..self.name) end
|
||||
self.balance = self.balance - v
|
||||
end
|
||||
|
||||
function Account:show (title)
|
||||
print(title or "", self.name, self.balance)
|
||||
end
|
||||
|
||||
a = Account:new(nil,"demo")
|
||||
a:show("after creation")
|
||||
a:deposit(1000.00)
|
||||
a:show("after deposit")
|
||||
a:withdraw(100.00)
|
||||
a:show("after withdraw")
|
||||
|
||||
-- this would raise an error
|
||||
b = Account:new(nil,"DEMO")
|
||||
b:withdraw(100.00)
|
||||
@ -1,28 +0,0 @@
|
||||
-- bisect.lua
|
||||
-- bisection method for solving non-linear equations
|
||||
|
||||
delta=1e-6 -- tolerance
|
||||
|
||||
function bisect(f,a,b,fa,fb)
|
||||
local c=(a+b)/2
|
||||
io.write(n," c=",c," a=",a," b=",b,"\n")
|
||||
if c==a or c==b or math.abs(a-b)<delta then return c,b-a end
|
||||
n=n+1
|
||||
local fc=f(c)
|
||||
if fa*fc<0 then return bisect(f,a,c,fa,fc) else return bisect(f,c,b,fc,fb) end
|
||||
end
|
||||
|
||||
-- find root of f in the inverval [a,b]. needs f(a)*f(b)<0
|
||||
function solve(f,a,b)
|
||||
n=0
|
||||
local z,e=bisect(f,a,b,f(a),f(b))
|
||||
io.write(string.format("after %d steps, root is %.17g with error %.1e, f=%.1e\n",n,z,e,f(z)))
|
||||
end
|
||||
|
||||
-- our function
|
||||
function f(x)
|
||||
return x*x*x-x-1
|
||||
end
|
||||
|
||||
-- find zero in [1,2]
|
||||
solve(f,1,2)
|
||||
@ -1,23 +0,0 @@
|
||||
-- globals.lua
|
||||
-- show all global variables
|
||||
|
||||
local seen={}
|
||||
|
||||
function dump(t,i)
|
||||
seen[t]=true
|
||||
local s={}
|
||||
local n=0
|
||||
for k in pairs(t) do
|
||||
n=n+1 s[n]=k
|
||||
end
|
||||
table.sort(s)
|
||||
for k,v in ipairs(s) do
|
||||
print(i,v)
|
||||
v=t[v]
|
||||
if type(v)=="table" and not seen[v] then
|
||||
dump(v,i.."\t")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
dump(_G,"")
|
||||
@ -1,4 +0,0 @@
|
||||
-- hello.lua
|
||||
-- the first program in every language
|
||||
|
||||
io.write("Hello world, from ",_VERSION,"!\n")
|
||||
@ -1,70 +0,0 @@
|
||||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /CoreOS/lua/Sanity/Smoke
|
||||
# Description: Basic smoke for lua component
|
||||
# Author: Stepan Sigut <ssigut@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2016 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/bin/rhts-environment.sh || exit 1
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGES=${PACKAGES:-"lua"}
|
||||
LUA=${LUA:-"lua"}
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm --all
|
||||
rlAssertBinaryOrigin $LUA
|
||||
set -o pipefail
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "cp *.lua $TmpDir"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "$LUA hello.lua 2>&1 | tee dump.log" 0
|
||||
rlAssertGrep "Hello world, from Lua" "dump.log"
|
||||
rlPhaseEnd
|
||||
rlPhaseStartTest
|
||||
rlRun "$LUA bisect.lua 2>&1 | tee dump.log" 0
|
||||
rlAssertGrep "after 20 steps, root is 1.3247179985046387 with error 9.5e-07, f=1.8e-07" "dump.log"
|
||||
rlPhaseEnd
|
||||
rlPhaseStartTest
|
||||
rlRun "$LUA globals.lua &>/dev/null" 0
|
||||
rlPhaseEnd
|
||||
rlPhaseStartTest
|
||||
rlRun "$LUA account.lua 2>&1 | tee dump.log" 1
|
||||
rlAssertGrep "after creation" "dump.log"
|
||||
rlAssertGrep "lua: account.lua:18: insufficient funds on account DEMO" "dump.log"
|
||||
rlPhaseEnd
|
||||
rlPhaseStartTest
|
||||
rlRun "$LUA sieve.lua &>/dev/null" 0
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@ -1,28 +0,0 @@
|
||||
-- sieve.lua
|
||||
-- the sieve of Eratosthenes programmed with coroutines
|
||||
-- typical usage: lua -e N=500 sieve.lua | column
|
||||
|
||||
-- generate all the numbers from 2 to n
|
||||
function gen (n)
|
||||
return coroutine.wrap(function ()
|
||||
for i=2,n do coroutine.yield(i) end
|
||||
end)
|
||||
end
|
||||
|
||||
-- filter the numbers generated by `g', removing multiples of `p'
|
||||
function filter (p, g)
|
||||
return coroutine.wrap(function ()
|
||||
for n in g do
|
||||
if n%p ~= 0 then coroutine.yield(n) end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
N=N or 500 -- from command line
|
||||
x = gen(N) -- generate primes up to N
|
||||
while 1 do
|
||||
local n = x() -- pick a number until done
|
||||
if n == nil then break end
|
||||
print(n) -- must be a prime number
|
||||
x = filter(n, x) -- now remove its multiples
|
||||
end
|
||||
@ -1,14 +0,0 @@
|
||||
---
|
||||
# This first play always runs on the local staging system
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: standard-test-beakerlib
|
||||
tags:
|
||||
- classic
|
||||
- container
|
||||
- atomic
|
||||
tests:
|
||||
- Smoke
|
||||
required_packages:
|
||||
- lua # Required for smoke test
|
||||
- which # Required for smoke test
|
||||
Loading…
Reference in New Issue
Block a user