From bee2b38880d5100e60e66e54b9e0a93e4b7a1bcc1f22dcb80b087c795f9f3a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Schr=C3=B6der?= Date: Mon, 10 Aug 2015 13:16:09 +0000 Subject: [PATCH] Accepting request 317830 from home:MargueriteSu:lua53-fix:rpm OBS-URL: https://build.opensuse.org/request/show/317830 OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=357 --- python3-rpm.spec | 2 +- rpm-4.12.0.1-lua-5.3.patch | 65 ++++++++++++++++++++++++++++++++++++++ rpm-python.spec | 2 +- rpm.changes | 7 ++++ rpm.spec | 4 ++- 5 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 rpm-4.12.0.1-lua-5.3.patch diff --git a/python3-rpm.spec b/python3-rpm.spec index 35e4a81..24e7bc9 100644 --- a/python3-rpm.spec +++ b/python3-rpm.spec @@ -31,7 +31,7 @@ BuildRequires: libelf-devel BuildRequires: libselinux-devel BuildRequires: libsemanage-devel BuildRequires: libtool -BuildRequires: lua51-devel +BuildRequires: lua-devel BuildRequires: ncurses-devel BuildRequires: popt-devel BuildRequires: python3-devel diff --git a/rpm-4.12.0.1-lua-5.3.patch b/rpm-4.12.0.1-lua-5.3.patch new file mode 100644 index 0000000..6992bbe --- /dev/null +++ b/rpm-4.12.0.1-lua-5.3.patch @@ -0,0 +1,65 @@ +Index: rpm-4.12.0.1/luaext/lposix.c +=================================================================== +--- rpm-4.12.0.1.orig/luaext/lposix.c ++++ rpm-4.12.0.1/luaext/lposix.c +@@ -361,22 +361,35 @@ static int Pfork(lua_State *L) /** for + + static int Pwait(lua_State *L) /** wait([pid]) */ + { ++#if LUA_VERSION_NUM < 503 + pid_t pid = luaL_optint(L, 1, -1); ++#else ++ pid_t pid = (int)luaL_optinteger(L, 1, -1); ++#endif + return pushresult(L, waitpid(pid, NULL, 0), NULL); + } + + + static int Pkill(lua_State *L) /** kill(pid,[sig]) */ + { ++#if LUA_VERSION_NUM < 503 + pid_t pid = luaL_checkint(L, 1); + int sig = luaL_optint(L, 2, SIGTERM); ++#else ++ pid_t pid = (int)luaL_checkinteger(L, 1); ++ int sig = (int)luaL_optinteger(L, 2, SIGTERM); ++#endif + return pushresult(L, kill(pid, sig), NULL); + } + + + static int Psleep(lua_State *L) /** sleep(seconds) */ + { ++#if LUA_VERSION_NUM < 503 + unsigned int seconds = luaL_checkint(L, 1); ++#else ++ unsigned int seconds = (int)luaL_checkinteger(L, 1); ++#endif + lua_pushnumber(L, sleep(seconds)); + return 1; + } +@@ -529,7 +542,11 @@ static int Pgetprocessid(lua_State *L) + + static int Pttyname(lua_State *L) /** ttyname(fd) */ + { ++#if LUA_VERSION_NUM < 503 + int fd=luaL_optint(L, 1, 0); ++#else ++ int fd = (int)luaL_optinteger(L, 1, 0); ++#endif + lua_pushstring(L, ttyname(fd)); + return 1; + } +@@ -879,8 +896,11 @@ static int exit_override(lua_State *L) + { + if (!have_forked) + return luaL_error(L, "exit not permitted in this context"); +- ++#if LUA_VERSION_NUM < 503 + exit(luaL_optint(L, 1, EXIT_SUCCESS)); ++#else ++ exit((int)luaL_optinteger(L, 1, EXIT_SUCCESS)); ++#endif + } + + static const luaL_Reg os_overrides[] = diff --git a/rpm-python.spec b/rpm-python.spec index 919dcc5..0a4c513 100644 --- a/rpm-python.spec +++ b/rpm-python.spec @@ -32,7 +32,7 @@ BuildRequires: libelf-devel BuildRequires: libselinux-devel BuildRequires: libsemanage-devel BuildRequires: libtool -BuildRequires: lua51-devel +BuildRequires: lua-devel BuildRequires: ncurses-devel BuildRequires: popt-devel BuildRequires: python-devel diff --git a/rpm.changes b/rpm.changes index 4350098..15ec093 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Jul 18 09:01:11 UTC 2015 - i@marguerite.su + +- add patch: rpm-4.12.0.1-lua-5.3.patch + * replace luaL_optint/luaL_checkint w/ (int)luaL_optinteger + (int)luaL_checkinteger for compatibility w/ lua 5.3 + ------------------------------------------------------------------- Sun Jun 21 16:41:03 UTC 2015 - lmuelle@suse.com diff --git a/rpm.spec b/rpm.spec index e77d8d5..a0115e6 100644 --- a/rpm.spec +++ b/rpm.spec @@ -32,7 +32,7 @@ BuildRequires: libelf-devel BuildRequires: libselinux-devel BuildRequires: libsemanage-devel BuildRequires: libtool -BuildRequires: lua51-devel +BuildRequires: lua-devel BuildRequires: make BuildRequires: ncurses-devel BuildRequires: patch @@ -131,6 +131,7 @@ Patch93: weakdepscompat.diff Patch94: checksepwarn.diff Patch95: fixsizeforbigendian.diff Patch96: modalias-no-kgraft.diff +Patch97: rpm-4.12.0.1-lua-5.3.patch Patch6464: auto-config-update-aarch64-ppc64le.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # @@ -224,6 +225,7 @@ rm -f rpmdb/db.h %patch -P 70 -P 71 -P 73 -P 74 -P 75 -P 76 -P 77 -P 78 -P 79 %patch -P 85 %patch -P 92 -P 93 -P 94 -P 95 -P 96 +%patch97 -p1 %ifarch aarch64 ppc64le %patch6464