forked from pool/lua-luacheck
Compare commits
8 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
|
280c732979
|
|||
|
0356366085
|
|||
|
b975013bba
|
|||
|
fbe91033fe
|
|||
|
c47c965157
|
|||
|
d84d860526
|
|||
|
3c2cb1d1bb
|
|||
|
3b8eafbc53
|
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -21,3 +21,4 @@
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
*.changes merge=merge-changes
|
||||
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1 +1,6 @@
|
||||
.osc
|
||||
*.obscpio
|
||||
*.osc
|
||||
_build.*
|
||||
.pbuild
|
||||
lua*-luacheck-*-build/
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<multibuild>
|
||||
<package>lua51</package>
|
||||
<package>luajit</package>
|
||||
<package>lua53</package>
|
||||
<package>lua54</package>
|
||||
<package>lua55</package>
|
||||
</multibuild>
|
||||
|
||||
@@ -1,3 +1,25 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 22 15:20:04 UTC 2026 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Add luacheck-lua55.patch to make package buildable with Lua
|
||||
5.5, because of changing cycle counters.
|
||||
(gh#mpeterv/luacheck!238)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 24 14:48:56 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Switch off building lua51 build of the package.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Oct 12 21:59:08 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Fix shebang in the provide start script
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Oct 11 23:30:50 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Allow building with LuaJIT.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed May 3 11:07:50 UTC 2023 - Michal Suchanek <msuchanek@suse.com>
|
||||
|
||||
|
||||
@@ -17,9 +17,15 @@
|
||||
#
|
||||
|
||||
|
||||
%define flavor @BUILD_FLAVOR@%{nil}
|
||||
%define flavor @BUILD_FLAVOR@
|
||||
%define mod_name luacheck
|
||||
# Remove file dependency on the interpreter
|
||||
%global __requires_exclude ^%{_bindir}/lua(5\\.[1-9]|jit)?$
|
||||
%if "%{flavor}" == "luajit"
|
||||
%define lua_value 52
|
||||
%else
|
||||
%define lua_value %(echo "%{flavor}" |sed -e 's:lua::')
|
||||
%endif
|
||||
Version: 1.1.0
|
||||
Release: 0
|
||||
Summary: Command-line tool for linting and static analysis of Lua code
|
||||
@@ -29,6 +35,9 @@ URL: https://github.com/lunarmodules/luacheck
|
||||
Source: https://github.com/lunarmodules/luacheck/archive/v%{version}.tar.gz#/%{mod_name}-%{version}.tar.gz
|
||||
# PATCH-FIX-OPENSUSE - silence rpmlint
|
||||
Patch0: env.patch
|
||||
# PATCH-FIX-UPSTREAM luacheck-lua55.patch gh#mpeterv/luacheck!238 mcepl@suse.com
|
||||
# Fix incompatibility with Lua 5.5 (changing of for cycle counters)
|
||||
Patch1: luacheck-lua55.patch
|
||||
BuildRequires: %{flavor}
|
||||
BuildRequires: %{flavor}-argparse
|
||||
BuildRequires: %{flavor}-luafilesystem
|
||||
@@ -39,7 +48,7 @@ Requires: %{flavor}-luafilesystem
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
Provides: luacheck
|
||||
Obsoletes: luacheck < 1.0.0
|
||||
Obsoletes: luacheck < %{version}
|
||||
BuildArch: noarch
|
||||
%lua_provides
|
||||
%if "%{flavor}" == ""
|
||||
@@ -68,10 +77,10 @@ checked files as Lua comments.
|
||||
%install
|
||||
mkdir -p %{buildroot}%{lua_noarchdir}
|
||||
mkdir -p %{buildroot}%{_bindir}
|
||||
cp bin/luacheck.lua %{buildroot}%{_bindir}/luacheck-%{lua_version}
|
||||
cp -r src/luacheck %{buildroot}%{lua_noarchdir}
|
||||
chmod +x %{buildroot}%{_bindir}/luacheck-%{lua_version}
|
||||
sed -i -e 's,%{_bindir}/lua,%{_bindir}/lua%{lua_version},' %{buildroot}%{_bindir}/luacheck-%{lua_version}
|
||||
cp -v bin/luacheck.lua %{buildroot}%{_bindir}/luacheck-%{flavor}
|
||||
cp -rv src/luacheck %{buildroot}%{lua_noarchdir}
|
||||
chmod +x %{buildroot}%{_bindir}/luacheck-%{flavor}
|
||||
sed -i -e 's,# *\!%{_bindir}/.*lua,#!%{_bindir}/lua,' %{buildroot}%{_bindir}/luacheck-%{flavor}
|
||||
|
||||
# update-alternatives
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/alternatives/
|
||||
@@ -79,17 +88,16 @@ touch %{buildroot}%{_sysconfdir}/alternatives/luacheck
|
||||
ln -sf %{_sysconfdir}/alternatives/luacheck %{buildroot}%{_bindir}/luacheck
|
||||
|
||||
%check
|
||||
LUA_PATH='%{_datadir}/lua/%{lua_version}/?.lua'
|
||||
LUA_PATH="%{buildroot}%{lua_noarchdir}/?/init.lua;${LUA_PATH}"
|
||||
export LUA_PATH="%{buildroot}%{lua_noarchdir}/?.lua;${LUA_PATH}"
|
||||
%{_bindir}/lua%{lua_version} %{buildroot}%{_bindir}/luacheck-%{lua_version} src/
|
||||
LUA_PATH='%{lua_noarchdir}/?.lua;%{lua_noarchdir}/?/init.lua'
|
||||
export LUA_PATH="%{buildroot}%{lua_noarchdir}/?.lua;%{buildroot}%{lua_noarchdir}/?/init.lua;${LUA_PATH}"
|
||||
lua %{buildroot}%{_bindir}/luacheck-%{flavor} src/
|
||||
|
||||
%post
|
||||
%{_sbindir}/update-alternatives --install %{_bindir}/luacheck luacheck %{_bindir}/luacheck-%{lua_version} %{lua_value}
|
||||
%{_sbindir}/update-alternatives --install %{_bindir}/luacheck luacheck %{_bindir}/luacheck-%{flavor} %{lua_value}
|
||||
|
||||
%postun
|
||||
if [ "$1" = 0 ] ; then
|
||||
%{_sbindir}/update-alternatives --remove luacheck %{_bindir}/luacheck-%{lua_version}
|
||||
%{_sbindir}/update-alternatives --remove luacheck %{_bindir}/luacheck-%{flavor}
|
||||
fi
|
||||
|
||||
%files
|
||||
@@ -97,7 +105,7 @@ fi
|
||||
%license LICENSE
|
||||
%ghost %{_sysconfdir}/alternatives/luacheck
|
||||
%{_bindir}/luacheck
|
||||
%{_bindir}/luacheck-%{lua_version}
|
||||
%{_bindir}/luacheck-%{flavor}
|
||||
%{lua_noarchdir}/luacheck/
|
||||
|
||||
%changelog
|
||||
|
||||
58
luacheck-lua55.patch
Normal file
58
luacheck-lua55.patch
Normal file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
src/luacheck/standards.lua | 24 ++++++++++++++----------
|
||||
1 file changed, 14 insertions(+), 10 deletions(-)
|
||||
|
||||
Index: luacheck-1.1.0/src/luacheck/standards.lua
|
||||
===================================================================
|
||||
--- luacheck-1.1.0.orig/src/luacheck/standards.lua 2022-12-19 18:51:56.000000000 +0100
|
||||
+++ luacheck-1.1.0/src/luacheck/standards.lua 2026-01-22 16:17:00.555611296 +0100
|
||||
@@ -130,21 +130,25 @@
|
||||
|
||||
for field_name, field_def in pairs(fields) do
|
||||
if type(field_name) == "string" or not ignore_array_part then
|
||||
+
|
||||
+ local actual_field_name = field_name
|
||||
+ local actual_field_def = field_def
|
||||
+
|
||||
if type(field_name) ~= "string" then
|
||||
- field_name = field_def
|
||||
- field_def = infinitely_indexable_def
|
||||
+ actual_field_name = field_def
|
||||
+ actual_field_def = infinitely_indexable_def
|
||||
end
|
||||
|
||||
if not def.fields then
|
||||
def.fields = {}
|
||||
end
|
||||
|
||||
- if not def.fields[field_name] then
|
||||
- def.fields[field_name] = {}
|
||||
+ if not def.fields[actual_field_name] then
|
||||
+ def.fields[actual_field_name] = {}
|
||||
end
|
||||
|
||||
- local existing_field_def = def.fields[field_name]
|
||||
- local new_read_only = field_def.read_only
|
||||
+ local existing_field_def = def.fields[actual_field_name]
|
||||
+ local new_read_only = actual_field_def.read_only
|
||||
|
||||
if new_read_only == nil then
|
||||
new_read_only = default_read_only
|
||||
@@ -156,13 +160,13 @@
|
||||
end
|
||||
end
|
||||
|
||||
- if field_def.other_fields ~= nil then
|
||||
- if overwrite or field_def.other_fields == true then
|
||||
- existing_field_def.other_fields = field_def.other_fields
|
||||
+ if actual_field_def.other_fields ~= nil then
|
||||
+ if overwrite or actual_field_def.other_fields == true then
|
||||
+ existing_field_def.other_fields = actual_field_def.other_fields
|
||||
end
|
||||
end
|
||||
|
||||
- add_fields(existing_field_def, field_def.fields, overwrite, false, nil)
|
||||
+ add_fields(existing_field_def, actual_field_def.fields, overwrite, false, nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user