forked from pool/lua54
Compare commits
13 Commits
Author | SHA256 | Date | |
---|---|---|---|
e748694fd6
|
|||
41f2bc1313
|
|||
b6168d41b6
|
|||
0fa5783653
|
|||
74c6aa5eb9
|
|||
a9f3c2169c
|
|||
07794071cf
|
|||
b8ca1bcce1
|
|||
ff37df0ddf
|
|||
595733ab8e
|
|||
6957aee288
|
|||
a815e81e87
|
|||
b832770e08
|
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1 +1,5 @@
|
|||||||
.osc
|
.osc
|
||||||
|
_scmsync.obsinfo
|
||||||
|
_buildconfig-*
|
||||||
|
_buildinfo-*.xml
|
||||||
|
lua54-*-build/
|
||||||
|
@@ -1,10 +1,14 @@
|
|||||||
Inspect errno only after failure
|
Inspect errno only after failure
|
||||||
|
|
||||||
Index: lua-5.4.6/src/lauxlib.c
|
---
|
||||||
|
src/lauxlib.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
Index: lua-5.4.8/src/lauxlib.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- lua-5.4.6.orig/src/lauxlib.c
|
--- lua-5.4.8.orig/src/lauxlib.c 2025-07-15 22:59:14.411309750 +0200
|
||||||
+++ lua-5.4.6/src/lauxlib.c
|
+++ lua-5.4.8/src/lauxlib.c 2025-07-15 22:59:24.858384379 +0200
|
||||||
@@ -283,7 +283,7 @@ LUALIB_API int luaL_fileresult (lua_Stat
|
@@ -286,7 +286,7 @@
|
||||||
|
|
||||||
|
|
||||||
LUALIB_API int luaL_execresult (lua_State *L, int stat) {
|
LUALIB_API int luaL_execresult (lua_State *L, int stat) {
|
||||||
|
BIN
lua-5.4.7-tests.tar.gz
(Stored with Git LFS)
BIN
lua-5.4.7-tests.tar.gz
(Stored with Git LFS)
Binary file not shown.
BIN
lua-5.4.7.tar.gz
(Stored with Git LFS)
BIN
lua-5.4.7.tar.gz
(Stored with Git LFS)
Binary file not shown.
BIN
lua-5.4.8-tests.tar.gz
(Stored with Git LFS)
Normal file
BIN
lua-5.4.8-tests.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
lua-5.4.8.tar.gz
(Stored with Git LFS)
Normal file
BIN
lua-5.4.8.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
@@ -1,3 +1,30 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Aug 5 07:22:18 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
||||||
|
|
||||||
|
- interpreter should only provide, not conflict lua symbol
|
||||||
|
(bsc#1247521)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Jul 19 09:23:33 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
||||||
|
|
||||||
|
- Switch from update-alternatives to libalternatives (and
|
||||||
|
dependency on lua-interpreter)
|
||||||
|
- improve .gitignore and overall improve the packaging.
|
||||||
|
- this package also provides devel symlink directly and conflicts
|
||||||
|
other -devel packages
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Jul 12 18:38:52 UTC 2025 - Callum Farmer <gmbr3@opensuse.org>
|
||||||
|
|
||||||
|
- Update to version 5.4.8:
|
||||||
|
* Fixed 8 bugs from 5.4.7
|
||||||
|
- Add upstream1.patch: Numbered upstream patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Apr 23 07:55:24 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
||||||
|
|
||||||
|
- Fix license: it is MIT, not GPL-3.0-or-later.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Jul 24 11:26:59 UTC 2024 - Callum Farmer <gmbr3@opensuse.org>
|
Wed Jul 24 11:26:59 UTC 2024 - Callum Farmer <gmbr3@opensuse.org>
|
||||||
|
|
||||||
@@ -388,7 +415,7 @@ Wed Sep 17 15:04:25 UTC 2014 - i@marguerite.su
|
|||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Sep 12 09:19:07 UTC 2014 - pgajdos@suse.com
|
Fri Sep 12 09:19:07 UTC 2014 - pgajdos@suse.com
|
||||||
|
|
||||||
- fix update-alternatives
|
- fix update-alternatives
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Sep 10 10:21:23 UTC 2014 - pgajdos@suse.com
|
Wed Sep 10 10:21:23 UTC 2014 - pgajdos@suse.com
|
||||||
@@ -412,13 +439,13 @@ Mon Mar 31 11:05:05 UTC 2014 - pgajdos@suse.com
|
|||||||
Mon Sep 9 11:12:20 UTC 2013 - pgajdos@suse.com
|
Mon Sep 9 11:12:20 UTC 2013 - pgajdos@suse.com
|
||||||
|
|
||||||
- updated to 5.2.2: bugfix release, fixed:
|
- updated to 5.2.2: bugfix release, fixed:
|
||||||
* Stack overflow in vararg functions with many fixed parameters
|
* Stack overflow in vararg functions with many fixed parameters
|
||||||
called with few arguments.
|
called with few arguments.
|
||||||
* Garbage collector can trigger too many times in recursive loops.
|
* Garbage collector can trigger too many times in recursive loops.
|
||||||
* Wrong assert when reporting concatenation errors (manifests only
|
* Wrong assert when reporting concatenation errors (manifests only
|
||||||
when Lua is compiled in debug mode).
|
when Lua is compiled in debug mode).
|
||||||
* Wrong error message in some short-cut expressions.
|
* Wrong error message in some short-cut expressions.
|
||||||
* luac listings choke on long strings.
|
* luac listings choke on long strings.
|
||||||
* see http://www.lua.org/bugs.html for details
|
* see http://www.lua.org/bugs.html for details
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
@@ -439,32 +466,32 @@ Tue Feb 5 14:18:18 UTC 2013 - coolo@suse.com
|
|||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Nov 15 15:11:34 UTC 2012 - pgajdos@suse.com
|
Thu Nov 15 15:11:34 UTC 2012 - pgajdos@suse.com
|
||||||
|
|
||||||
- export luaU_dump in order to fix linking of luac binary
|
- export luaU_dump in order to fix linking of luac binary
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Oct 9 14:55:31 UTC 2012 - crrodriguez@opensuse.org
|
Tue Oct 9 14:55:31 UTC 2012 - crrodriguez@opensuse.org
|
||||||
|
|
||||||
- Tweak lua-suse.diff again:
|
- Tweak lua-suse.diff again:
|
||||||
* LUA_IFUNC must be defined as upstream but without "extern",
|
* LUA_IFUNC must be defined as upstream but without "extern",
|
||||||
revert the previous mod.
|
revert the previous mod.
|
||||||
* LUA_API must be defined as visibility default
|
* LUA_API must be defined as visibility default
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Aug 16 00:34:57 UTC 2012 - crrodriguez@opensuse.org
|
Thu Aug 16 00:34:57 UTC 2012 - crrodriguez@opensuse.org
|
||||||
|
|
||||||
- Even after the previous update, third party modules/libraries
|
- Even after the previous update, third party modules/libraries
|
||||||
would not work because LUA_CDIR constant is wrong in x86_64
|
would not work because LUA_CDIR constant is wrong in x86_64
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Aug 15 22:34:12 UTC 2012 - crrodriguez@opensuse.org
|
Wed Aug 15 22:34:12 UTC 2012 - crrodriguez@opensuse.org
|
||||||
|
|
||||||
- devel package must require libluaver = %{version}
|
- devel package must require libluaver = %{version}
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Aug 15 22:24:01 UTC 2012 - crrodriguez@opensuse.org
|
Wed Aug 15 22:24:01 UTC 2012 - crrodriguez@opensuse.org
|
||||||
|
|
||||||
- Broken lua-suse patch breaks loading third party modules
|
- Broken lua-suse patch breaks loading third party modules
|
||||||
or scripts
|
or scripts
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jun 18 09:09:13 UTC 2012 - pgajdos@suse.com
|
Mon Jun 18 09:09:13 UTC 2012 - pgajdos@suse.com
|
||||||
@@ -544,7 +571,7 @@ Wed Dec 21 13:58:22 UTC 2011 - pgajdos@suse.com
|
|||||||
lua_rawgetp, lua_rawsetp, lua_upvalueid, lua_upvaluejoin,
|
lua_rawgetp, lua_rawsetp, lua_upvalueid, lua_upvaluejoin,
|
||||||
lua_version, luaL_checkversion, luaL_setmetatable,
|
lua_version, luaL_checkversion, luaL_setmetatable,
|
||||||
luaL_testudata, luaL_tolstring
|
luaL_testudata, luaL_tolstring
|
||||||
[lua_pushstring] and <CODE>pushlstring</CODE> return string
|
[lua_pushstring] and <CODE>pushlstring</CODE> return string
|
||||||
[nparams] and <CODE>isvararg</CODE> available in debug API
|
[nparams] and <CODE>isvararg</CODE> available in debug API
|
||||||
new lua_Unsigned
|
new lua_Unsigned
|
||||||
* Implementation
|
* Implementation
|
||||||
@@ -641,18 +668,18 @@ Tue Feb 19 10:37:22 CET 2008 - pgajdos@suse.cz
|
|||||||
- created -doc package
|
- created -doc package
|
||||||
- updated to version 5.1.3, bug fix release. Fixed bugs:
|
- updated to version 5.1.3, bug fix release. Fixed bugs:
|
||||||
* wrong error message in some concatenations
|
* wrong error message in some concatenations
|
||||||
* too many variables in an assignment may cause a C stack
|
* too many variables in an assignment may cause a C stack
|
||||||
overflow
|
overflow
|
||||||
* an error in a module loaded through the '-l' option shows no
|
* an error in a module loaded through the '-l' option shows no
|
||||||
traceback
|
traceback
|
||||||
* gsub may go wild when wrongly called without its third
|
* gsub may go wild when wrongly called without its third
|
||||||
argument and with a large subject
|
argument and with a large subject
|
||||||
* table.remove removes last element of a table when given
|
* table.remove removes last element of a table when given
|
||||||
an out-of-bound index
|
an out-of-bound index
|
||||||
* lua_setfenv may crash if called over an invalid object
|
* lua_setfenv may crash if called over an invalid object
|
||||||
* stand-alone interpreter shows incorrect error message when
|
* stand-alone interpreter shows incorrect error message when
|
||||||
the "message" is a coroutine.
|
the "message" is a coroutine.
|
||||||
* debug.sethook/gethook may overflow the thread's stack
|
* debug.sethook/gethook may overflow the thread's stack
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Jul 24 14:31:30 CEST 2007 - pgajdos@suse.cz
|
Tue Jul 24 14:31:30 CEST 2007 - pgajdos@suse.cz
|
||||||
|
86
lua54.spec
86
lua54.spec
@@ -25,11 +25,16 @@
|
|||||||
%endif
|
%endif
|
||||||
%define major_version 5.4
|
%define major_version 5.4
|
||||||
%define libname liblua5_4-5
|
%define libname liblua5_4-5
|
||||||
|
%if 0%{?suse_version} > 1500
|
||||||
|
%bcond_without libalternatives
|
||||||
|
%else
|
||||||
|
%bcond_with libalternatives
|
||||||
|
%endif
|
||||||
Name: lua54%{name_ext}
|
Name: lua54%{name_ext}
|
||||||
Version: 5.4.7
|
Version: 5.4.8
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Small Embeddable Language with Procedural Syntax
|
Summary: Small Embeddable Language with Procedural Syntax
|
||||||
License: GPL-3.0-or-later
|
License: MIT
|
||||||
Group: Development/Languages/Other
|
Group: Development/Languages/Other
|
||||||
URL: https://www.lua.org
|
URL: https://www.lua.org
|
||||||
Source: https://www.lua.org/ftp/lua-%{version}.tar.gz
|
Source: https://www.lua.org/ftp/lua-%{version}.tar.gz
|
||||||
@@ -45,17 +50,26 @@ Patch3: main_test.patch
|
|||||||
Patch6: shared_link.patch
|
Patch6: shared_link.patch
|
||||||
# PATCH-FIX-UPSTREAM inspect errno only after failure
|
# PATCH-FIX-UPSTREAM inspect errno only after failure
|
||||||
Patch8: execresult.patch
|
Patch8: execresult.patch
|
||||||
Requires(post): update-alternatives
|
Patch100: upstream1.patch
|
||||||
Requires(postun):update-alternatives
|
|
||||||
Provides: lua = %{version}
|
Provides: lua = %{version}
|
||||||
Obsoletes: lua < %{version}
|
Obsoletes: lua < %{version}
|
||||||
Provides: Lua(API) = %{major_version}
|
Provides: Lua(API) = %{major_version}
|
||||||
|
%if %{with libalternatives}
|
||||||
|
BuildRequires: alts
|
||||||
|
BuildRequires: lua-interpreter
|
||||||
|
Requires: alts
|
||||||
|
Requires: lua-interpreter
|
||||||
|
%else
|
||||||
|
Requires(post): update-alternatives
|
||||||
|
Requires(postun): update-alternatives
|
||||||
|
%endif
|
||||||
%if "%{flavor}" == "test"
|
%if "%{flavor}" == "test"
|
||||||
BuildRequires: lua54
|
BuildRequires: lua54
|
||||||
BuildRequires: lua54-devel
|
BuildRequires: lua54-devel
|
||||||
%else
|
%else
|
||||||
|
# Ensure we can build without $self
|
||||||
|
#!BuildIgnore: lua54
|
||||||
BuildRequires: libtool
|
BuildRequires: libtool
|
||||||
BuildRequires: lua-macros
|
|
||||||
BuildRequires: pkgconfig
|
BuildRequires: pkgconfig
|
||||||
BuildRequires: readline-devel
|
BuildRequires: readline-devel
|
||||||
%endif
|
%endif
|
||||||
@@ -74,13 +88,11 @@ of C functions, written in ANSI C.
|
|||||||
|
|
||||||
%package devel
|
%package devel
|
||||||
Summary: Development files for lua
|
Summary: Development files for lua
|
||||||
License: MIT
|
|
||||||
Group: Development/Libraries/C and C++
|
Group: Development/Libraries/C and C++
|
||||||
Requires: %{libname} = %{version}
|
Requires: %{libname} = %{version}
|
||||||
Requires: %{name} = %{version}
|
Requires: %{name} = %{version}
|
||||||
Requires: lua-macros
|
Requires: lua-macros
|
||||||
Requires(post): update-alternatives
|
Conflicts: lua-devel
|
||||||
Requires(postun):update-alternatives
|
|
||||||
Provides: lua-devel = %{version}
|
Provides: lua-devel = %{version}
|
||||||
Provides: Lua(devel) = %{major_version}
|
Provides: Lua(devel) = %{major_version}
|
||||||
Provides: pkgconfig(lua) = %{version}
|
Provides: pkgconfig(lua) = %{version}
|
||||||
@@ -95,7 +107,6 @@ application.
|
|||||||
|
|
||||||
%package -n %{libname}
|
%package -n %{libname}
|
||||||
Summary: The Lua integration library
|
Summary: The Lua integration library
|
||||||
License: MIT
|
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Provides: liblua5_4 = %{version}-%{release}
|
Provides: liblua5_4 = %{version}-%{release}
|
||||||
Obsoletes: liblua5_4 < %{version}-%{release}
|
Obsoletes: liblua5_4 < %{version}-%{release}
|
||||||
@@ -122,7 +133,6 @@ of C functions, written in ANSI C.
|
|||||||
|
|
||||||
%package doc
|
%package doc
|
||||||
Summary: Documentation for Lua, a small embeddable language
|
Summary: Documentation for Lua, a small embeddable language
|
||||||
License: MIT
|
|
||||||
Group: Documentation/HTML
|
Group: Documentation/HTML
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%if 0%{?suse_version} > 1315
|
%if 0%{?suse_version} > 1315
|
||||||
@@ -150,8 +160,10 @@ mv lua-%{version}-tests testes
|
|||||||
%if "%{flavor}" != "test"
|
%if "%{flavor}" != "test"
|
||||||
cat doc/lua.1 | sed 's/TH LUA 1/TH LUA%{major_version} 1/' > doc/lua%{major_version}.1
|
cat doc/lua.1 | sed 's/TH LUA 1/TH LUA%{major_version} 1/' > doc/lua%{major_version}.1
|
||||||
cat doc/luac.1 | sed 's/TH LUAC 1/TH LUAC%{major_version} 1/' > doc/luac%{major_version}.1
|
cat doc/luac.1 | sed 's/TH LUAC 1/TH LUAC%{major_version} 1/' > doc/luac%{major_version}.1
|
||||||
|
%endif
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
%if "%{flavor}" != "test"
|
||||||
sed -i -e "s@lib/lua/@%{_lib}/lua/@g" src/luaconf.h
|
sed -i -e "s@lib/lua/@%{_lib}/lua/@g" src/luaconf.h
|
||||||
%make_build linux-readline -C src \
|
%make_build linux-readline -C src \
|
||||||
CC="cc" LIBDIR="%{_libdir}" \
|
CC="cc" LIBDIR="%{_libdir}" \
|
||||||
@@ -183,9 +195,21 @@ Version: %{version}
|
|||||||
Libs: -llua%{major_version} -lm
|
Libs: -llua%{major_version} -lm
|
||||||
Cflags: -I\${includedir}
|
Cflags: -I\${includedir}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
install -D -m 644 lua%{major_version}.pc %{buildroot}%{_libdir}/pkgconfig/lua%{major_version}.pc
|
install -D -m 644 lua%{major_version}.pc %{buildroot}%{_libdir}/pkgconfig/lua%{major_version}.pc
|
||||||
|
|
||||||
|
%if %{with libalternatives}
|
||||||
|
# alternatives - create configuration file
|
||||||
|
mkdir -p %{buildroot}%{_datadir}/libalternatives/lua
|
||||||
|
cat > %{buildroot}%{_datadir}/libalternatives/lua/54.conf <<EOF
|
||||||
|
binary=%{_bindir}/lua5.4
|
||||||
|
man=lua5.4
|
||||||
|
EOF
|
||||||
|
mkdir -p %{buildroot}%{_datadir}/libalternatives/luac
|
||||||
|
cat > %{buildroot}%{_datadir}/libalternatives/luac/54.conf <<EOF
|
||||||
|
binary=%{_bindir}/luac5.4
|
||||||
|
man=luac5.4
|
||||||
|
EOF
|
||||||
|
%else
|
||||||
# update-alternatives
|
# update-alternatives
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
||||||
for file in lua luac ; do
|
for file in lua luac ; do
|
||||||
@@ -194,22 +218,23 @@ for file in lua luac ; do
|
|||||||
touch "%{buildroot}%{_sysconfdir}/alternatives/${file}.1%{ext_man}"
|
touch "%{buildroot}%{_sysconfdir}/alternatives/${file}.1%{ext_man}"
|
||||||
ln -sf "%{_sysconfdir}/alternatives/${file}.1%{ext_man}" "%{buildroot}%{_mandir}/man1/${file}.1%{ext_man}"
|
ln -sf "%{_sysconfdir}/alternatives/${file}.1%{ext_man}" "%{buildroot}%{_mandir}/man1/${file}.1%{ext_man}"
|
||||||
done
|
done
|
||||||
|
%endif
|
||||||
|
|
||||||
# Compat link with older unprefixed library and with soname 0 from deb/etc
|
# Compat link with older unprefixed library and with soname 0 from deb/etc
|
||||||
ln -s %{_libdir}/liblua%{major_version}.so.%{major_version}.0 %{buildroot}%{_libdir}/liblua%{major_version}.so.%{major_version}
|
ln -s %{_libdir}/liblua%{major_version}.so.%{major_version}.0 %{buildroot}%{_libdir}/liblua%{major_version}.so.%{major_version}
|
||||||
ln -s %{_libdir}/liblua%{major_version}.so.%{major_version}.0 %{buildroot}%{_libdir}/liblua%{major_version}.so.0
|
ln -s %{_libdir}/liblua%{major_version}.so.%{major_version}.0 %{buildroot}%{_libdir}/liblua%{major_version}.so.0
|
||||||
ln -s %{_libdir}/liblua%{major_version}.so.%{major_version}.0 %{buildroot}%{_libdir}/liblua.so.%{major_version}
|
ln -s %{_libdir}/liblua%{major_version}.so.%{major_version}.0 %{buildroot}%{_libdir}/liblua.so.%{major_version}
|
||||||
# Library devel alternatives
|
|
||||||
touch %{buildroot}%{_sysconfdir}/alternatives/liblua.so
|
# We don’t create alternatives for -devel content, just conflict those
|
||||||
ln -sf %{_sysconfdir}/alternatives/liblua.so %{buildroot}%{_libdir}/liblua.so
|
ln -s %{_libdir}/liblua%{major_version}.so %{buildroot}%{_libdir}/liblua.so
|
||||||
touch %{buildroot}%{_sysconfdir}/alternatives/lua.pc
|
ln -s %{_libdir}/pkgconfig/lua%{major_version}.pc %{buildroot}%{_libdir}/pkgconfig/lua.pc
|
||||||
ln -sf %{_sysconfdir}/alternatives/lua.pc %{buildroot}%{_libdir}/pkgconfig/lua.pc
|
%endif # flavor != "test"
|
||||||
%else
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
|
%if "%{flavor}" == "test"
|
||||||
cd testes
|
cd testes
|
||||||
pushd libs
|
pushd libs
|
||||||
make all LUA_DIR=%{_includedir}/lua%{major_version}
|
%make_build all LUA_DIR=%{_includedir}/lua%{major_version}
|
||||||
cp *.so ..
|
cp *.so ..
|
||||||
popd
|
popd
|
||||||
LD_LIBRARY_PATH=%{_libdir} %{_bindir}/lua%{major_version} all.lua
|
LD_LIBRARY_PATH=%{_libdir} %{_bindir}/lua%{major_version} all.lua
|
||||||
@@ -219,6 +244,7 @@ LD_LIBRARY_PATH=%{_libdir} %{_bindir}/lua%{major_version} all.lua
|
|||||||
%post -n %{libname} -p /sbin/ldconfig
|
%post -n %{libname} -p /sbin/ldconfig
|
||||||
%postun -n %{libname} -p /sbin/ldconfig
|
%postun -n %{libname} -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%if %{without libalternatives}
|
||||||
%post
|
%post
|
||||||
%{_sbindir}/update-alternatives --install \
|
%{_sbindir}/update-alternatives --install \
|
||||||
%{_bindir}/lua lua %{_bindir}/lua%{major_version} 54 \
|
%{_bindir}/lua lua %{_bindir}/lua%{major_version} 54 \
|
||||||
@@ -230,18 +256,13 @@ LD_LIBRARY_PATH=%{_libdir} %{_bindir}/lua%{major_version} all.lua
|
|||||||
if [ "$1" = 0 ] ; then
|
if [ "$1" = 0 ] ; then
|
||||||
%{_sbindir}/update-alternatives --remove lua %{_bindir}/lua%{major_version}
|
%{_sbindir}/update-alternatives --remove lua %{_bindir}/lua%{major_version}
|
||||||
fi
|
fi
|
||||||
|
%endif
|
||||||
|
|
||||||
%post devel
|
%endif # flavor != "test"
|
||||||
%{_sbindir}/update-alternatives --install \
|
|
||||||
%{_libdir}/liblua.so liblua.so %{_libdir}/liblua%{major_version}.so 54 \
|
|
||||||
--slave %{_libdir}/pkgconfig/lua.pc lua.pc %{_libdir}/pkgconfig/lua%{major_version}.pc
|
|
||||||
|
|
||||||
%postun devel
|
|
||||||
if [ "$1" = 0 ] ; then
|
|
||||||
%{_sbindir}/update-alternatives --remove liblua.so %{_libdir}/liblua%{major_version}.so
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
%if "%{flavor}" != "test"
|
||||||
%files
|
%files
|
||||||
|
%doc README
|
||||||
%dir %{_libdir}/lua
|
%dir %{_libdir}/lua
|
||||||
%dir %{_libdir}/lua/%{major_version}
|
%dir %{_libdir}/lua/%{major_version}
|
||||||
%dir %{_datadir}/lua
|
%dir %{_datadir}/lua
|
||||||
@@ -250,6 +271,10 @@ fi
|
|||||||
%{_bindir}/luac%{major_version}
|
%{_bindir}/luac%{major_version}
|
||||||
%{_mandir}/man1/lua%{major_version}.1%{?ext_man}
|
%{_mandir}/man1/lua%{major_version}.1%{?ext_man}
|
||||||
%{_mandir}/man1/luac%{major_version}.1%{?ext_man}
|
%{_mandir}/man1/luac%{major_version}.1%{?ext_man}
|
||||||
|
%if %{with libalternatives}
|
||||||
|
%{_datadir}/libalternatives/lua/54.conf
|
||||||
|
%{_datadir}/libalternatives/luac/54.conf
|
||||||
|
%else
|
||||||
# alternatives
|
# alternatives
|
||||||
%{_bindir}/lua
|
%{_bindir}/lua
|
||||||
%{_bindir}/luac
|
%{_bindir}/luac
|
||||||
@@ -259,6 +284,7 @@ fi
|
|||||||
%ghost %{_sysconfdir}/alternatives/luac
|
%ghost %{_sysconfdir}/alternatives/luac
|
||||||
%ghost %{_sysconfdir}/alternatives/lua.1%{ext_man}
|
%ghost %{_sysconfdir}/alternatives/lua.1%{ext_man}
|
||||||
%ghost %{_sysconfdir}/alternatives/luac.1%{ext_man}
|
%ghost %{_sysconfdir}/alternatives/luac.1%{ext_man}
|
||||||
|
%endif
|
||||||
|
|
||||||
%files -n %{libname}
|
%files -n %{libname}
|
||||||
%{_libdir}/liblua%{major_version}.so.*
|
%{_libdir}/liblua%{major_version}.so.*
|
||||||
@@ -273,15 +299,11 @@ fi
|
|||||||
%{_includedir}/lua%{major_version}/lualib.h
|
%{_includedir}/lua%{major_version}/lualib.h
|
||||||
%{_libdir}/liblua%{major_version}.so
|
%{_libdir}/liblua%{major_version}.so
|
||||||
%{_libdir}/pkgconfig/lua%{major_version}.pc
|
%{_libdir}/pkgconfig/lua%{major_version}.pc
|
||||||
# alternatives
|
|
||||||
%{_libdir}/liblua.so
|
%{_libdir}/liblua.so
|
||||||
%{_libdir}/pkgconfig/lua.pc
|
%{_libdir}/pkgconfig/lua.pc
|
||||||
%ghost %{_sysconfdir}/alternatives/liblua.so
|
|
||||||
%ghost %{_sysconfdir}/alternatives/lua.pc
|
|
||||||
|
|
||||||
%files doc
|
%files doc
|
||||||
%doc doc/*
|
%doc doc/*
|
||||||
|
%endif # flavor != "test"
|
||||||
%endif
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
@@ -2,9 +2,11 @@
|
|||||||
testes/main.lua | 12 ++++++------
|
testes/main.lua | 12 ++++++------
|
||||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
--- a/testes/main.lua
|
Index: lua-5.4.8/testes/main.lua
|
||||||
+++ b/testes/main.lua
|
===================================================================
|
||||||
@@ -47,7 +47,7 @@ local function checkprogout (s)
|
--- lua-5.4.8.orig/testes/main.lua 2025-07-15 22:59:14.472309613 +0200
|
||||||
|
+++ lua-5.4.8/testes/main.lua 2025-07-15 22:59:20.829403778 +0200
|
||||||
|
@@ -49,7 +49,7 @@
|
||||||
assert(string.sub(s, -1) == "\n")
|
assert(string.sub(s, -1) == "\n")
|
||||||
local t = getoutput()
|
local t = getoutput()
|
||||||
for line in string.gmatch(s, ".-\n") do
|
for line in string.gmatch(s, ".-\n") do
|
||||||
@@ -13,7 +15,7 @@
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -367,11 +367,11 @@ a = 2
|
@@ -382,11 +382,11 @@
|
||||||
]]
|
]]
|
||||||
RUN([[lua -e "%s" -i < %s > %s]], prompt, prog, out)
|
RUN([[lua -e "%s" -i < %s > %s]], prompt, prog, out)
|
||||||
local t = getoutput()
|
local t = getoutput()
|
||||||
|
@@ -4,8 +4,10 @@
|
|||||||
src/lundump.h | 2 +-
|
src/lundump.h | 2 +-
|
||||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
--- a/src/ldebug.h
|
Index: lua-5.4.8/src/ldebug.h
|
||||||
+++ b/src/ldebug.h
|
===================================================================
|
||||||
|
--- lua-5.4.8.orig/src/ldebug.h 2025-07-15 22:59:14.442309680 +0200
|
||||||
|
+++ lua-5.4.8/src/ldebug.h 2025-07-15 22:59:22.983017316 +0200
|
||||||
@@ -36,7 +36,7 @@
|
@@ -36,7 +36,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -15,9 +17,11 @@
|
|||||||
LUAI_FUNC const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n,
|
LUAI_FUNC const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n,
|
||||||
StkId *pos);
|
StkId *pos);
|
||||||
LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o,
|
LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o,
|
||||||
--- a/src/lmem.h
|
Index: lua-5.4.8/src/lmem.h
|
||||||
+++ b/src/lmem.h
|
===================================================================
|
||||||
@@ -81,7 +81,7 @@ LUAI_FUNC void *luaM_realloc_ (lua_State
|
--- lua-5.4.8.orig/src/lmem.h 2025-07-15 22:59:14.442309680 +0200
|
||||||
|
+++ lua-5.4.8/src/lmem.h 2025-07-15 22:59:22.983203934 +0200
|
||||||
|
@@ -81,7 +81,7 @@
|
||||||
size_t size);
|
size_t size);
|
||||||
LUAI_FUNC void *luaM_saferealloc_ (lua_State *L, void *block, size_t oldsize,
|
LUAI_FUNC void *luaM_saferealloc_ (lua_State *L, void *block, size_t oldsize,
|
||||||
size_t size);
|
size_t size);
|
||||||
@@ -26,9 +30,11 @@
|
|||||||
LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int nelems,
|
LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int nelems,
|
||||||
int *size, int size_elem, int limit,
|
int *size, int size_elem, int limit,
|
||||||
const char *what);
|
const char *what);
|
||||||
--- a/src/lundump.h
|
Index: lua-5.4.8/src/lundump.h
|
||||||
+++ b/src/lundump.h
|
===================================================================
|
||||||
@@ -30,7 +30,7 @@
|
--- lua-5.4.8.orig/src/lundump.h 2025-07-15 22:59:14.442309680 +0200
|
||||||
|
+++ lua-5.4.8/src/lundump.h 2025-07-15 22:59:22.983321338 +0200
|
||||||
|
@@ -29,7 +29,7 @@
|
||||||
LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name);
|
LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name);
|
||||||
|
|
||||||
/* dump one chunk; from ldump.c */
|
/* dump one chunk; from ldump.c */
|
||||||
|
53
upstream1.patch
Normal file
53
upstream1.patch
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
From 1b0f943da7dfb25987456a77259edbeea0b94edc Mon Sep 17 00:00:00 2001
|
||||||
|
From: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
|
||||||
|
Date: Mon, 16 Jun 2025 16:33:02 -0300
|
||||||
|
Subject: [PATCH] Bug: new metatable in weak table can fool the GC
|
||||||
|
|
||||||
|
All-weak tables are not being revisited after being visited during
|
||||||
|
propagation; if it gets a new metatable after that, the new metatable
|
||||||
|
may not be marked.
|
||||||
|
---
|
||||||
|
lgc.c | 8 ++++++--
|
||||||
|
testes/gc.lua | 10 ++++++++++
|
||||||
|
2 files changed, 16 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/lgc.c b/lgc.c
|
||||||
|
index 5817f9eec3..c01660abc5 100644
|
||||||
|
--- a/src/lgc.c
|
||||||
|
+++ b/src/lgc.c
|
||||||
|
@@ -553,8 +553,12 @@ static lu_mem traversetable (global_State *g, Table *h) {
|
||||||
|
traverseweakvalue(g, h);
|
||||||
|
else if (!weakvalue) /* strong values? */
|
||||||
|
traverseephemeron(g, h, 0);
|
||||||
|
- else /* all weak */
|
||||||
|
- linkgclist(h, g->allweak); /* nothing to traverse now */
|
||||||
|
+ else { /* all weak */
|
||||||
|
+ if (g->gcstate == GCSpropagate)
|
||||||
|
+ linkgclist(h, g->grayagain); /* must visit again its metatable */
|
||||||
|
+ else
|
||||||
|
+ linkgclist(h, g->allweak); /* must clear collected entries */
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
else /* not weak */
|
||||||
|
traversestrongtable(g, h);
|
||||||
|
diff --git a/testes/gc.lua b/testes/gc.lua
|
||||||
|
index 03093e34ff..f017f33056 100644
|
||||||
|
--- a/testes/gc.lua
|
||||||
|
+++ b/testes/gc.lua
|
||||||
|
@@ -301,6 +301,16 @@ collectgarbage()
|
||||||
|
assert(next(a) == string.rep('$', 11))
|
||||||
|
|
||||||
|
|
||||||
|
+if T then -- bug since 5.3: all-weak tables are not being revisited
|
||||||
|
+ T.gcstate("propagate")
|
||||||
|
+ local t = setmetatable({}, {__mode = "kv"})
|
||||||
|
+ T.gcstate("atomic") -- 't' was visited
|
||||||
|
+ setmetatable(t, {__mode = "kv"})
|
||||||
|
+ T.gcstate("pause") -- its new metatable is not being visited
|
||||||
|
+ assert(getmetatable(t).__mode == "kv")
|
||||||
|
+end
|
||||||
|
+
|
||||||
|
+
|
||||||
|
-- 'bug' in 5.1
|
||||||
|
a = {}
|
||||||
|
local t = {x = 10}
|
Reference in New Issue
Block a user