From 98504c24682d0582751fae9af85ca5f3d968190ba36fd017311b8826cce7bea6 Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Sat, 28 Aug 2021 10:37:37 +0000 Subject: [PATCH] Accepting request 914762 from home:gmbr3:Lua - Change usage of math to string.gsub to prevent extra decimal places causing issues OBS-URL: https://build.opensuse.org/request/show/914762 OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-macros?expand=0&rev=21 --- lua-macros.changes | 6 ++++++ macros.lua | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lua-macros.changes b/lua-macros.changes index 9940228..3fab09e 100644 --- a/lua-macros.changes +++ b/lua-macros.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Aug 28 09:42:55 UTC 2021 - Callum Farmer + +- Change usage of math to string.gsub to prevent extra decimal + places causing issues + ------------------------------------------------------------------- Fri Aug 27 10:07:01 UTC 2021 - Callum Farmer diff --git a/macros.lua b/macros.lua index f0e0c63..92e222a 100644 --- a/macros.lua +++ b/macros.lua @@ -2,7 +2,7 @@ # The major.minor version of Lua %lua_version %(lua -e 'print(_VERSION)' | cut -d ' ' -f 2) -%lua_version_nodots %(lua -e 'print(math.floor((%{lua_version}*10)))') +%lua_version_nodots %(lua -e 'print((string.gsub("%{lua_version}", "%.", "")))') # compiled modules should go here %lua_archdir %{_libdir}/lua/%{lua_version} @@ -14,7 +14,7 @@ %lua_incdir %{_includedir}/lua%{lua_version} %lua_version_default 5.4 -%lua_version_default_nodots %(lua -e 'print(math.floor((%{lua_version_default}*10)))') +%lua_version_default_nodots %(lua -e 'print((string.gsub("%{lua_version_default}", "%.", "")))') %ifluadefault \ %if %{lua_version_nodots} == %{lua_version_default_nodots} \