SHA256
10
0
forked from pool/lua-macros

feat: Rework Lua version and path macros using RPM Lua blocks

The `%lua_version`, `%lua_version_nodots`, and `%lua_noarchdir`
macros have been refactored to use the RPM internal Lua
interpreter blocks (`%{lua:...}`) instead of relying solely on
shell command execution (`%()`).

This change offers several benefits:
1. Consistency: Standardizes the approach, as other macros like
   `%lua_version_default` already use RPM Lua blocks.
2. Robustness: Improves path handling by explicitly trimming
   whitespace/newlines from the `pkgconf` output in
   `%lua_noarchdir`.
3. Clarity: Simplifies the logic for extracting the version
   number and calculating the no-dots version.

The `%lua_noarchdir` logic was also improved to correctly handle
a failure of the `pkgconf` command (e.g., when the package isn't
installed) by checking for `f == nil`.

A comment was also added to `%lua_provides` to clarify the
required definition of `%mod_name`.
This commit is contained in:
2025-10-11 18:43:45 +02:00
parent 21cfcf02e2
commit 984b4bf4f2
2 changed files with 31 additions and 8 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Sat Oct 11 16:45:06 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Rework Lua version and path macros using RPM Lua blocks.
-------------------------------------------------------------------
Fri Oct 10 10:56:01 UTC 2025 - Matej Cepl <mcepl@cepl.eu>