Files
termux-packages/packages/luarocks/sysdetect-no-proc.patch
termux-pacman-bot ff5a922150 fix(main/luarocks): wrap return "linux" with if true condition in sysdetect-no-proc.patch
- Fixes https://github.com/termux/termux-packages/issues/25320

- In Lua, unfortunately, **`return` statement before the end of a block is not allowed** and produces a syntax error at runtime. Placing the `return "linux"` statement at the beginnning of the function for easier rebasing of the patch is possible, but **only by placing it inside of an `if true` condition**.
  - https://www.lua.org/pil/4.4.html
  - "For syntactic reasons, a `break` or `return` can appear only as the last statement of a block"
2025-07-11 08:43:35 +00:00

14 lines
334 B
Diff

--- a/src/luarocks/core/sysdetect.lua
+++ b/src/luarocks/core/sysdetect.lua
@@ -226,6 +226,10 @@ local function read_elf_section_headers(fd, hdr)
end
local function detect_elf_system(fd, hdr, sections)
+ if true then
+ return "linux"
+ end
+
local system = e_osabi[hdr.osabi]
local endian = endians[hdr.endian]