[Rpm-maint] [rpm-software-management/rpm] Auto-print returned values from Lua macros (PR #1837)

Panu Matilainen notifications at github.com
Mon Nov 22 14:34:45 UTC 2021


@pmatilai commented on this pull request.



>  	rpmlog(RPMLOG_ERR, _("lua script failed: %s\n"),
 		 lua_tostring(L, -1));
 	lua_pop(L, 1);
 	goto exit;
     }
+
+    int nret = lua_gettop(L) - otop;
+    if (nret > 0 && lua->printbuf) {
+	lua_getglobal(L, "print");
+	lua_insert(L, -(nret + 1));
+	if (lua_pcall(L, nret, 0, 0) != 0) {
+	    rpmlog(RPMLOG_ERR, _("result print failed: %s\n"),
+		    lua_tostring(L, -1));
+	    lua_pop(L, 1);

Doh. It's Monday alright...

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1837#discussion_r754334930
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20211122/27148cca/attachment.html>


More information about the Rpm-maint mailing list