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
This commit is contained in:
Michael Schröder 2015-08-10 13:16:09 +00:00 committed by Git OBS Bridge
parent fd797ab9c6
commit bee2b38880
5 changed files with 77 additions and 3 deletions

View File

@ -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

View File

@ -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[] =

View File

@ -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

View File

@ -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

View File

@ -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