Merge branch 'lua-archcheck' into 'master'

Draft: abuild: detect precompiled lua files

See merge request alpine/abuild!286
This commit is contained in:
Sertonix 2024-04-26 17:13:20 +00:00
commit 0e724c9a19
1 changed files with 4 additions and 0 deletions

View File

@ -1361,6 +1361,10 @@ dir_has_arch_binaries() {
# look for static *.a
[ -n "$(find "$dir" -type f -name '*.a' | head -n 1)" ] && return 0
# look for precompiled lua files (luac: 0x1b Lua; luajit: 0x1b LJ)
find "$dir" -type f \( -name '*.lua' -o -name '*.luac' \) -exec od -N 4 -A n -t x4 -- {} \; |
grep -q -E -e '(6175|4a)4c1b$' && return 0
return 1
}