summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-lua-fix-print.patch104
-rw-r--r--meta/recipes-devtools/rpm/rpm_5.4.14.bb1
2 files changed, 105 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-lua-fix-print.patch b/meta/recipes-devtools/rpm/rpm/rpm-lua-fix-print.patch
new file mode 100644
index 0000000000..7ab49e97e2
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-lua-fix-print.patch
@@ -0,0 +1,104 @@
1Lua 'print' statement is not working properly inside of RPM 5
2
3The print statement should capture the output and send it to the script
4processing engine, and not display it directly to the screen.
5
6This patch is from: http://rpm5.org/cvs/patchset?cn=17671
7
8Upstream-Status: backport (patchset 17671 from rpm5.org)
9
10Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
11
12Index: rpm-5.4.14/CHANGES
13===================================================================
14--- rpm-5.4.14.orig/CHANGES
15+++ rpm-5.4.14/CHANGES
16@@ -1,3 +1,4 @@
17+ - jbj: lua: fix: resurrect output capture with lua-5.2.
18 - jbj: verify: fix: broken logic for %ghost avoidance (Mark Hatle).
19
20 5.4.13 -> 5.4.14:
21Index: rpm-5.4.14/rpmio/rpmlua.c
22===================================================================
23--- rpm-5.4.14.orig/rpmio/rpmlua.c
24+++ rpm-5.4.14/rpmio/rpmlua.c
25@@ -175,7 +175,7 @@ rpmlua rpmluaNew(void)
26 };
27 /*@=readonlytrans =nullassign @*/
28 /*@observer@*/ /*@unchecked@*/
29- const luaL_Reg *lib = lualibs;
30+ const luaL_Reg *lib;
31 char *path_buf;
32 char *path_next;
33 char *path;
34@@ -190,31 +190,34 @@ rpmlua rpmluaNew(void)
35
36 luaL_openlibs(L);
37
38- for (; lib->name; lib++) {
39+ for (lib = lualibs; lib->name; lib++) {
40 luaL_requiref(L, lib->name, lib->func, 1);
41+ lua_pop(L, 1);
42 }
43
44 { const char * _lua_path = rpmGetPath(rpmluaPath, NULL);
45 if (_lua_path != NULL) {
46+#if defined(LUA_GLOBALSINDEX)
47 lua_pushliteral(L, "LUA_PATH");
48 lua_pushstring(L, _lua_path);
49+ lua_rawset(L, LUA_GLOBALSINDEX);
50+#else
51+ lua_pushstring(L, _lua_path);
52+ lua_setglobal(L, "LUA_PATH");
53+#endif
54 _lua_path = _free(_lua_path);
55 }
56 }
57
58 #if defined(LUA_GLOBALSINDEX)
59- lua_rawset(L, LUA_GLOBALSINDEX);
60-#else
61- lua_pushglobaltable(L);
62-#endif
63 lua_pushliteral(L, "print");
64 lua_pushcfunction(L, rpm_print);
65-
66-#if defined(LUA_GLOBALSINDEX)
67 lua_rawset(L, LUA_GLOBALSINDEX);
68 #else
69- lua_pushglobaltable(L);
70+ lua_pushcfunction(L, rpm_print);
71+ lua_setglobal(L, "print");
72 #endif
73+
74 rpmluaSetData(lua, "lua", lua);
75
76 /* load all standard RPM Lua script files */
77@@ -351,6 +354,9 @@ void rpmluaSetVar(rpmlua _lua, rpmluav v
78 #if defined(LUA_GLOBALSINDEX)
79 if (lua->pushsize == 0)
80 lua_pushvalue(L, LUA_GLOBALSINDEX);
81+#else
82+ if (lua->pushsize == 0)
83+ lua_pushglobaltable(L);
84 #endif
85 if (pushvar(L, var->keyType, &var->key) != -1) {
86 if (pushvar(L, var->valueType, &var->value) != -1)
87@@ -1039,14 +1045,15 @@ static int rpm_print (lua_State *L)
88 lua_getglobal(L, "tostring");
89 for (i = 1; i <= n; i++) {
90 const char *s;
91+ size_t l;
92 lua_pushvalue(L, -1); /* function to be called */
93 lua_pushvalue(L, i); /* value to print */
94 lua_call(L, 1, 1);
95- s = lua_tostring(L, -1); /* get result */
96+ s = lua_tolstring(L, -1, &l); /* get result */
97 if (s == NULL)
98 return luaL_error(L, "`tostring' must return a string to `print'");
99 if (lua->storeprint) {
100- size_t sl = lua_rawlen(L, -1);
101+ size_t sl = l;
102 if ((size_t)(lua->printbufused+sl+1) > lua->printbufsize) {
103 lua->printbufsize += sl+512;
104 lua->printbuf = (char *) xrealloc(lua->printbuf, lua->printbufsize);
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.14.bb b/meta/recipes-devtools/rpm/rpm_5.4.14.bb
index 03a24f08be..d7aadd2f57 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.14.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.14.bb
@@ -96,6 +96,7 @@ SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.14-0.20131024.src.rpm;e
96 file://rpm-realpath.patch \ 96 file://rpm-realpath.patch \
97 file://0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch \ 97 file://0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch \
98 file://no-ldflags-in-pkgconfig.patch \ 98 file://no-ldflags-in-pkgconfig.patch \
99 file://rpm-lua-fix-print.patch \
99 " 100 "
100 101
101# Uncomment the following line to enable platform score debugging 102# Uncomment the following line to enable platform score debugging