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

Panu Matilainen notifications at github.com
Fri Nov 19 08:12:22 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)
+	rpm_print(L);

Right, I was wondering about the "common practise" of doing such a thing and that maybe the beef of rpm_print() should be refactored out to better faciliate calling from C or something.

-- 
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_r752940718
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20211119/ca173635/attachment.html>


More information about the Rpm-maint mailing list